Get a generation's cost
GET/v1/projects/:project_id/generations/:generation_id/usage
What this one generation cost, and the tokens it was charged on — the billing-grade receipt the runtime froze at write time, per model line item.
This is the per-generation grain that GET /v1/projects/{project_id}/usage cannot express: that meter buckets a whole project by model, agent, run, day or meter type, and a run can hold more than one generation. Use this to price a single turn, and the project meter to roll spend up.
cost_usd is null when nothing was priced — never that the work was free. Only naturali-managed providers are priced; a BYOK generation runs on your own provider account, so it carries no LLM cost here (its tokens are still reported).
A generation belonging to another project responds 404, not 403.
Request
Responses
- 200
- 401
- 404
- 502
The generation's usage receipt.
Missing or invalid credentials.
The resource does not exist (existence is not leaked).
The upstream runtime could not complete the operation.