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 plus recent usage events for the account attached to the API key.
You can filter by from, to, before, model, status, and source. Set source=playground for Playground activity or source=api for direct API requests.
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.
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). Use tool_usage to break down which tools contributed.
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.
