Skip to 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.

Authentication

x-api-keystring
API Key authentication via header

Query parameters

startTimedatetimeRequired

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

endTimedatetimeRequired

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

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

Response

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.

Errors

400
Bad Request Error
401
Unauthorized Error
503
Service Unavailable Error