Ir para a navegação

List Generation Costs

List the recorded cost of every generation that finished in a time range. Each item is the Get Generation Costs object plus createdAt, finishedAt, model and apiKey.

The range filters on finishedAt (startTime inclusive, endTime exclusive), oldest first, so back-to-back ranges never overlap. Page with cursor until nextCursor is null, keeping the same range.

Costs are usually recorded within 10 minutes of completion. totalCostUsd is null while any part is pending or unavailable. See Export usage and costs.

Autenticação

x-api-keystring
Autenticação de chave de API via cabeçalho

Parâmetros de consulta

startTimedatetimeObrigatório

Start of the range, inclusive. UTC ISO 8601 date-time, such as 2026-11-12T00:00:00Z.

endTimedatetimeObrigatório

End of the range, exclusive. UTC ISO 8601 date-time. Must be after startTime.

limitintegerOpcional
Items per page, 1 to 500. Defaults to 100.
cursorstringOpcional
The nextCursor from the previous page. Send it with the same startTime and endTime.

Resposta

This endpoint returns an object.
itemslist of objects
nextCursorstring or null

Pass as cursor with the same startTime and endTime to get the next page. Null on the last page.

Erros

400
Bad Request Error
401
Unauthorized Error
503
Service Unavailable Error