Usage Summary
Get aggregate credit usage summary broken down by operation type and model for a configurable time period.
GET
/v1/credits/usageResponse
Response fields
statsarrayArray of usage stat rows grouped by operation_type and model.
stats[].operation_typestringOperation category (e.g. extraction, matching, document_ai_ocr).
stats[].modelstringModel used for this operation.
stats[].call_countintegerNumber of calls.
stats[].total_input_tokensintegerTotal input tokens consumed.
stats[].total_output_tokensintegerTotal output tokens produced.
stats[].total_cache_read_tokensintegerTotal cache-read tokens (prompt cache hits).
stats[].total_cost_usdnumberEstimated total cost in USD.
period_daysintegerThe period covered by this summary in days.
Response
{
"stats": [
{
"operation_type": "extraction",
"model": "claude-sonnet",
"call_count": 1842,
"total_input_tokens": 7896420,
"total_output_tokens": 1127040,
"total_cache_read_tokens": 0,
"total_cost_usd": 40.57
},
{
"operation_type": "document_ai_ocr",
"model": "mistral-ocr",
"call_count": 920,
"total_input_tokens": 0,
"total_output_tokens": 0,
"total_cache_read_tokens": 0,
"total_cost_usd": 8.28
}
],
"period_days": 30
}Errors
Error responses
401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.