Passer à la navigation

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.

Authentification

x-api-keystring
Authentification par clé API via en-tête

Paramètres de requête

startTimedatetimeRequis

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

endTimedatetimeRequis

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

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

Réponse

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.

Erreurs

400
Bad Request Error
401
Unauthorized Error
503
Service Unavailable Error