GET /v1/usage/{id} takes that id and
answers with the usage record the dashboard would show for it: the token
counts, what it cost, whether it was served, and how long it took. It reads the
same record the Activity screen reads, so the two never disagree, and it needs
only the API key, so a job can account for its own spend without anyone
signing in.
Read one request back
Take the id from thex-hopscotch-request-id header of the response you want
to look up, or from x-request-id, which carries the same value for the
OpenAI SDKs, and ask for it:
200
The fields
The fields a customer never sees stay fenced out: nothing about our cost, our
added latency, or how many attempts it took is in this record.
When a record is not found
One answer covers every miss. A request another key made, a request in a different workspace, and an id that never existed all get the same 404, so the endpoint cannot be used to probe for other people’s requests:404
Next
Usage and metering
What one record holds and the outcome vocabulary.
View activity
The same record on the dashboard, with filters.
Every response carries the same id on two headers:
x-hopscotch-request-id,
which is ours, and x-request-id, which is the one the official OpenAI SDKs
surface on their error objects. Every error envelope repeats it as
request_id. Quote it when you ask us about a request. Without it we are
guessing at which of your requests you mean.