Usage API

Usage statistics and logs

GET /v1/usage

Returns API usage logs.

Query Parameters

per_page integer optional

Records per page. Default: 20, maximum 100.

page integer optional

Page number (starting at 1). Default: 1

limit integer optional

Same as per_page (alias).

offset integer optional

The number of records to skip; used when page is not given. Default: 0

start_date string (YYYY-MM-DD) optional

Records from this date on (inclusive, 00:00 Turkey time).

end_date string (YYYY-MM-DD) optional

Records up to this date (inclusive, 23:59 Turkey time).

model string optional

Only records of this model ID (e.g. openai/text-embedding-3-small).

status string optional

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

GET /v1/usage/summary

Returns aggregate usage statistics. Period: ?period=7d, 30d (default), 90d or all.

JSON Response
{
  "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

GET /v1/usage/models

Returns per-model usage statistics.

Other Usage Endpoints

GET /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>).

GET /v1/usage/daily

Returns daily usage statistics.

GET /v1/usage/hourly

Returns hourly usage statistics for the last 24 hours.

GET /v1/usage/rate-limit

Returns your per-minute and per-day request limit status (see Rate Limits).

Want help finding the right model?