Generations

Get stored prompt, completion, and error content for a generation

Changed on
get/generation/content

Request

  • Base URL: https://openrouter.ai/api/v1
  • URL: https://openrouter.ai/api/v1/generation/content
  • Auth: HTTP bearer

Query parameters

idstring required

The generation ID

Example:gen-1234567890

Response

Returns the stored prompt and completion content, plus the failure error when the generation failed

Example response

{
  "data": {
    "error": null,
    "input": {
      "messages": [
        {
          "content": "What is the meaning of life?",
          "role": "user"
        }
      ]
    },
    "output": {
      "completion": "The meaning of life is a philosophical question...",
      "reasoning": null
    }
  }
}

Changes

    • breaking

      added the pattern ^gen-[0-9A-Za-z-]+$ to the query request parameter id

    • warning

      for the query request parameter id, the maxLength was set to 128

    • info

      for the query request parameter id, the minLength was decreased from 1 to 0

    • info

      added the non-success response with the status

    • info

      added the required property / to the response with the status