AI Gateway Usage

GET /ai/usage/top-models

Changed on

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Query parameters

fromstring

ISO 8601 start time (defaults to 24h ago)

tostring

ISO 8601 end time (defaults to now)

limitinteger

Max results (defaults to 10)

project_idinteger

Filter by project ID (deployment-token usage; instance administrators only)

Response

Top models by request count

avg_latency_msnumber double required
estimated_cost_microcentsinteger required

Sum of the recorded cost of the model's requests in the window, in microcents (1e-6 USD). Clients show this rather than recomputing from list prices, which cannot see cache prices or long-context rates. It includes requests made with a caller-supplied provider key, so it is not the figure a project's budget is measured against (that is ProjectUsage::operator_cost_microcents).

input_tokensinteger required
modelstring required
output_tokensinteger required
providerstring required
request_countinteger required
total_tokensinteger required

Changes

    • info

      added the required property items/estimated_cost_microcents to the response with the status

    • breaking

      removed the required property extensions from the response with the status

    • breaking

      removed the required property extensions from the response with the status

    1 more change in this revision