Get Generation
curl --request GET \
--url https://api.shuyou.ai/v1/generation \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.shuyou.ai/v1/generation"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.shuyou.ai/v1/generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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"
}Task Management
Get Generation
Query generation usage and billing metadata by generation ID.
GET
/
v1
/
generation
Get Generation
curl --request GET \
--url https://api.shuyou.ai/v1/generation \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.shuyou.ai/v1/generation"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.shuyou.ai/v1/generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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: Bearer YOUR_API_KEY
Query Parameters
Generation ID returned from inference or async jobs.
Response
Generation detail
API route or protocol identifier for the generation.
Example:
"chat.completions"
Unique generation ID.
Example:
"gen_01abc123def456"
Model slug used for the request.
Example:
"openai/gpt-4o"
UTC timestamp when the generation was created.
Example:
"2026-03-26T06:00:00.000Z"
Total generation time in milliseconds.
Example:
3200
Time to first token or initial response latency in milliseconds.
Example:
500
Show child attributes
Show child attributes
Whether the response was streamed.
Example:
true
Completion finish reason, e.g. stop.
Example:
"stop"