Account Usage API
Use account endpoints when you want to reconcile spend, show usage inside your own product, or export saved Playground tests.
Usage and balance
GET /v1/account/usage returns your current credit balance, a usage summary for the query window, an account-level spend breakdown by product, and recent usage events for the account attached to the API key.
Query parameters
Response shape
summary.cache_hit_rate is the share of input tokens served from prompt cache across the query window (cache_read / input, 0 to 1, null when the window has no input tokens). Cached input bills at the model’s cache-read rate, so this is your effective input-cost discount signal. Filter by model to get a per-model rolling rate.
Usage events
Each usage event includes:
cost.amount is always the final debited amount. The metadata.list_cost / metadata.billed_cost pair is informational. When a discount is applied, cost.amount equals billed_cost. When no discount applies, neither field is set; just read cost.amount.
For subscription usage, cost.included and cost.partial are mutually exclusive. A partly covered request starts only when the available credit balance can cover its full pay-as-you-go remainder. If not, it returns 402 insufficient_credits and creates no usage charge or plan draw.
For GPU Cloud events, use source: "gpu_cloud" plus metadata.seconds and metadata.price_hourly for runtime reporting. The tokens object remains in the response for schema stability, but GPU runtime rows are not token-billed.
For Compose events, use source: "compose" to retrieve full-video production rows:
A Compose row uses endpoint: "/v1/videos/compose" and stores the production breakdown under metadata.compose:
Read cost.amount for the final debited amount. Use metadata.compose.legs when you want to show which model stages contributed.
Tool usage example
When you call a model that bills per-tool surcharges (Qwen, Perplexity, MiMo, Mistral) and the model invokes those tools, the response includes a normalized tool_usage map:
The cost.amount already includes the per-tool surcharges (here: 2 × $0.026 web_search + 1 × $0.0208 image_search + token cost). metadata.tool_usage is the raw invocation-count map; tool_breakdown adds the per-tool unit cost and subtotal so you can render a billing breakdown without fetching catalog pricing yourself.
Saved Playground chats
The public API exposes saved Playground conversations as read-only resources.
List your saved Playground conversations:
Retrieve a single conversation by ID, including its full message history:
Saving and deleting Playground chats still happens in the dashboard Playground.
