Export usage and costs
Use List Generation Costs to load what your generations cost over a time range, for example a daily pull into a data warehouse. It returns one item per finished generation, up to 500 per call, so a day with 8,000 generations is 16 requests.
For the cost of a single generation, use Get Generation Costs. Both endpoints return the same cost object.
Request a time range
Send startTime and endTime as UTC ISO 8601 date-times. The range filters on when a generation finished. startTime is inclusive and endTime is exclusive.
An API key lists every generation in its organization, whichever key or Studio member created it.
Read every page
The response is { "items": [...], "nextCursor": "..." }. Request the next page with the same startTime and endTime plus cursor, until nextCursor is null. Items are ordered oldest first.
Keep startTime and endTime unchanged while you page. A cursor continues from one generation in the range, so changing the range between pages can skip items. A cursor that is not a generation in the requested range returns 400, so it can’t be mistaken for the end of the data.
What each item contains
Amounts are decimal strings with five decimal places. Parse them as decimals, not floats. A generation with dubbing or generated speech has one component for each part.
Build a daily pull
- Use back-to-back ranges. A generation appears in exactly one range, the one in which it finished. Ranges such as one per UTC day never overlap and never skip a generation.
- Wait 10 minutes after the range ends. Costs are normally recorded within about 10 minutes of completion. Before that an item can have
availability: "pending". Read the range again later to pick up amounts recorded since. - Key your rows on
generationId. Reading a range again returns the same generations, so an upsert keeps your table correct. - Treat
nullas unknown, not zero.totalCostUsdisnullunless every part of the cost is known.knownSubtotalUsdis the known portion. See availability. - Only finished generations are listed. A generation still in progress appears in the range in which it finishes.
Availability
availability says how much of an item’s cost is known. Each component’s status and reason say why an amount is missing.
A pending component usually gets its amount within about 10 minutes, but an item is not guaranteed to become complete. partial and unavailable items can stay that way.
On credit plans, amounts are the credits’ face value of $0.01 each, which can differ from the cash price paid for those credits. Amounts exclude tax, subscription fees, refunds, account credits, and external provider charges.
Handle errors
Every request is a read, so any page is safe to retry.

