Skip to main content
GET
Retrieve one request's usage

Authorizations

Authorization
string
header
required

A workspace API key in an Authorization: Bearer header. A missing header, a scheme other than Bearer, a key of the wrong shape, and a key we reject are all 401.

Path Parameters

id
string
required

The request id: the value the x-hopscotch-request-id header carried on the response being asked about.

Response

The recorded request: when it started, the model that served it, how it ended, every token count a charge can turn on, and the charge with its currency and rate revision.

One request, as the key that made it can read it back.

object
enum<string>
required
Available options:
usage.request
request_id
string
required

The id the x-hopscotch-request-id header carried on the response this record is about.

occurred_at
string<date-time>
required

When the request started, in RFC 3339.

model
string
required

The full provider/model id the request was served under, the same string GET /v1/models publishes.

Example:

"openai/gpt-4o-mini"

outcome
string
required

How the request ended, from a closed set of words. A request that was answered is served.

Example:

"served"

streamed
boolean
required
usage
object
required

Every count a charge can turn on. Null means the provider did not report that count. 0 means it reported none. They are not the same fact.

served_on_own_key
boolean
required

True when the request ran on your own provider key, which is why nothing was charged. Read this rather than inferring it from a zero charge.

paid_from_allowance
boolean
required

True when an included allowance paid for the request, in which case charge is absent.

latency_ms
integer
required

Total time the caller waited, in milliseconds.

note
string
required

A fixed sentence saying no prompt and no response body was stored.

charge
object

What the request cost, with what you need to check it against the rates GET /v1/models publishes. Present only when your workspace balance paid for the request, so it is absent when paid_from_allowance is true.