Usage API
Usage statistics and logs
/v1/usage
Returns API usage logs.
Query Parameters
Records per page. Default: 20, maximum 100.
Page number (starting at 1). Default: 1
Same as per_page (alias).
The number of records to skip; used when page is not given. Default: 0
Records from this date on (inclusive, 00:00 Turkey time).
Records up to this date (inclusive, 23:59 Turkey time).
Only records of this model ID (e.g. openai/text-embedding-3-small).
Only records with this status: success, error or timeout.
The response has the form {"success": true, "data": [...], "pagination": {"total", "per_page", "current_page", "total_pages", "has_more"}}; newest records first. Each record has cost (USD, 6 decimals) and cost_tl (TRY deducted from the balance).
Usage Summary
/v1/usage/summary
Returns aggregate usage statistics. Period: ?period=7d, 30d (default), 90d or all.
{
"success": true,
"data": {
"period": "30d",
"total_requests": 1250,
"successful_requests": 1230,
"failed_requests": 20,
"total_tokens": {
"input": 312000,
"output": 146000,
"total": 458000
},
"total_cost": 45.800000,
"average_response_time_ms": 1250.45,
"currency": "USD"
}
}
Per-Model Usage
/v1/usage/models
Returns per-model usage statistics.
Other Usage Endpoints
/v1/usage/{request_id}
Returns the usage record of a single request (request_id = the id of the response; for Responses use req_<id> instead of resp_<id>).
/v1/usage/daily
Returns daily usage statistics.
/v1/usage/hourly
Returns hourly usage statistics for the last 24 hours.
/v1/usage/rate-limit
Returns your per-minute and per-day request limit status (see Rate Limits).