Look up a generation
Call Create chat completion first; replace gen_123 with X-Praxis-Generation-Id from the response headers.
GET
/model/v1/generation● SupportedRequest parameters
idstringrequired◐ Partially supportedquery: Generation ID from the X-Praxis-Generation-Id response header of the model request.
Use X-Praxis-Generation-Id from a /model response header; response-body ids and X-Request-Id return 404.
Returns
200
Platform errors (auth, rate limits, validation) and OCR errors use problem+json; other model call errors follow the endpoint's own format (OpenAI or Anthropic) — see error codes
Request
curl
# Call Create chat completion first; replace gen_123 with X-Praxis-Generation-Id from the response headers.
curl "https://api.deepraxis.com/model/v1/generation?id=gen_123" \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
# Call Create chat completion first; replace gen_123 with X-Praxis-Generation-Id from the response headers.
import requests
opts = dict(
base_url="https://api.deepraxis.com/model/v1",
api_key="$PRAXIS_API_KEY",
)
# 官方 SDK 没有这个端点;直接用 HTTP 调用,id 取自对话响应头 X-Praxis-Generation-Id
resp = requests.get(
f"{opts['base_url']}/generation",
params={"id": "gen_123"},
headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.json())TypeScript
// Call Create chat completion first; replace gen_123 with X-Praxis-Generation-Id from the response headers.
const opts = {
baseURL: "https://api.deepraxis.com/model/v1",
apiKey: "$PRAXIS_API_KEY",
};
// 官方 SDK 没有这个端点;直接用 HTTP 调用,id 取自对话响应头 X-Praxis-Generation-Id
const resp = await fetch(`${opts.baseURL}/generation?id=gen_123`, {
headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(await resp.json());Response 200
{
"id": "04cf3931-3eca-4e11-8f87-d18d2bb4fde4",
"model": "deepseek-flash",
"cost": 0.000075,
"usage": {
"prompt_tokens": 31,
"completion_tokens": 55,
"total_tokens": 86,
"cached_input_tokens": 0
},
"latency_ms": 3736,
"created": 1790305588
}Response
HTTP 200
Generation record
application/json
| Name | Type | Description |
|---|---|---|
| id | string | Generation id that was queried. |
| model | string | Model that served the generation. |
| cost | number | null | Cost charged for the generation in USD; null when not yet priced. |
| usage | object | Token usage of the generation. |
| usage.prompt_tokens | number | Number of prompt tokens. |
| usage.completion_tokens | number | Number of tokens in the completion. |
| usage.total_tokens | number | Prompt plus completion tokens. |
| usage.cached_input_tokens | number | Prompt tokens served from the prompt cache; null when not reported. |
| latency_ms | number | null | Latency of the generation in milliseconds; null when not recorded. |
| created | number | Unix time in seconds at which the generation was recorded. |