AI Gateway Usage

GET /ai/usage/recent

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

limitinteger

Page size (defaults to 20, max 50)

offsetinteger

Number of results to skip for pagination (defaults to 0)

providerstring

Filter by provider name

modelstring

Filter by model name

project_idinteger

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

statusinteger

Filter by HTTP status code (exact match)

cost_gteinteger

Cost greater-than-or-equal, in microcents

cost_gtinteger

Cost strictly greater-than, in microcents

cost_lteinteger

Cost less-than-or-equal, in microcents

cost_ltinteger

Cost strictly less-than, in microcents

tokens_gteinteger

Total tokens greater-than-or-equal

tokens_gtinteger

Total tokens strictly greater-than

tokens_lteinteger

Total tokens less-than-or-equal

tokens_ltinteger

Total tokens strictly less-than

Response

Page of recent usage log entries

totalinteger required

Total number of entries matching the filter (across all pages).

Changes

    • info

      added the required property entries/items/unpriced 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