For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
  • API Guides
    • Overview
    • Streaming
    • Embeddings
    • Limits
    • Authentication
    • Parameters
    • Errors and Debugging
  • API Reference
      • GETGet request & usage metadata for a generation
      • GETGet stored prompt and completion content for a generation
LogoLogo
ModelsChatRankingsDocs
API ReferenceGenerations

Get stored prompt and completion content for a generation

GET
https://openrouter.ai/api/v1/generation/content
GET
/api/v1/generation/content
$curl -G https://openrouter.ai/api/v1/generation/content \
> -H "Authorization: Bearer <token>" \
> -d id=gen-1234567890
1{
2 "data": {
3 "input": {
4 "prompt": "What is the meaning of life?",
5 "messages": [
6 {
7 "content": "What is the meaning of life?",
8 "role": "user"
9 }
10 ]
11 },
12 "output": {
13 "completion": "The meaning of life is a philosophical question...",
14 "reasoning": null
15 }
16 }
17}
Was this page helpful?
Previous

List guardrails

Next
Built with

Authentication

AuthorizationBearer
API key as bearer token in Authorization header

Query parameters

idstringRequired>=1 character
The generation ID

Response

Returns the stored prompt and completion content
dataobject
Stored prompt and completion content

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error