HridaSpro Docs

Api Reference

Get Generation

Look up the settled result of a past request by its request id — provider, model, tokens, cost, and timing.

API console
GET/v1/generation/gen-xxxxxxxx
Bash
curl https://spro.hridaai.com/v1/generation/20261018-abc123 \  -H "Authorization: Bearer spro-xxxxxxxxxxxxxxxx"
JSON
{  "generation_id": "20261018-abc123",  "request_id": "20261018-abc123",  "provider": "openai",  "model": "openai/gpt-oss-120b",  "input_tokens": 12,  "output_tokens": 48,  "total_tokens": 60,  "total_cost": 0.00003,  "currency": "USD",  "latency_ms": 812,  "execution_time_ms": 790,  "ttft_ms": 230,  "finish_reason": "stop",  "created_at": "2026-10-18T10:00:02Z"}

GET https://spro.hridaai.com/v1/generation/{generation_id}

Returns the settled result for one past request. Use the id you got back in the x-spro-request-id response header. The result matches the usage log for that call, so you can reconcile billing or latency from your own code without opening the dashboard.

Only generations owned by the API key's account are returned. An id from another account returns 404, the same as an unknown id.

Path parameters

NameTypeDescription
generation_idstringThe request id of the call to look up, from the x-spro-request-id header.

Response fields

FieldTypeDescription
generation_idstringSame as request_id.
request_idstringThe request id of the original call.
providerstring or nullThe provider that served the call.
modelstring or nullThe canonical model slug that served the call.
input_tokensintegerPrompt tokens billed for the call.
output_tokensintegerCompletion tokens billed for the call.
total_tokensintegerinput_tokens + output_tokens.
total_costnumberBilled cost for the call, in currency.
currencystringAlways USD.
latency_msinteger or nullTotal time from request to final byte.
execution_time_msinteger or nullTime spent on the provider call.
ttft_msinteger or nullTime to first token. Null when it wasn't recorded.
finish_reasonstring or nullWhy generation stopped, such as stop or length.
created_atstringISO timestamp when the call was recorded.

Errors

StatusCodeWhen
401Invalid CredentialsThe bearer token is missing, malformed, or invalid. See Error Codes.
404generation_not_foundNo generation with that id exists for your account.

Behavior

  • Settled results only: the lookup reads the final usage record. A call that is still running is not returned yet.
  • Latest match wins: if a request id appears more than once, the most recent record is returned.
  • Scoped to your account: results from other accounts are never returned, even when the id is correct.