Skip to main content
GET
/
v1
/
generation
Get Generation
curl --request GET \
  --url https://api.shuyou.ai/v1/generation \
  --header 'Authorization: Bearer <token>'
{
  "api": "chat.completions",
  "generationId": "gen_01abc123def456",
  "model": "openai/gpt-4o",
  "createAt": "2026-03-26T06:00:00.000Z",
  "generationTime": 3200,
  "latency": 500,
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 222,
    "total_tokens": 234,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0,
      "audio_tokens": 0,
      "video_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 206,
      "image_tokens": 0,
      "audio_tokens": 0
    },
    "upstream_cost": 0.0004368,
    "discount": 0.00004368,
    "discount_percent": 0.9,
    "cost": 0.00039312
  },
  "streamed": true,
  "finishReason": "stop"
}

Authorizations

Authorization
string
header
required

Authorization: Bearer YOUR_API_KEY

Query Parameters

id
string
required

Generation ID returned from inference or async jobs.

Response

Generation detail

api
string
required

API route or protocol identifier for the generation.

Example:

"chat.completions"

generationId
string
required

Unique generation ID.

Example:

"gen_01abc123def456"

model
string
required

Model slug used for the request.

Example:

"openai/gpt-4o"

createAt
string<date-time>
required

UTC timestamp when the generation was created.

Example:

"2026-03-26T06:00:00.000Z"

generationTime
integer
required

Total generation time in milliseconds.

Example:

3200

latency
integer
required

Time to first token or initial response latency in milliseconds.

Example:

500

usage
object
required
streamed
boolean
required

Whether the response was streamed.

Example:

true

finishReason
string
required

Completion finish reason, e.g. stop.

Example:

"stop"