Get usage
GET/v1/usage
The requests, tokens and spend routed with the API key that makes this call, across all of your routers or one router, with a breakdown per model and, with granularity=day, per UTC day. It covers gateway requests and Proposal Mode decisions.
Usage is reported for the calling key only, never for other keys in your organization. To attribute spend to your own customers, give each customer its own API key and read this endpoint with that key.
spend_usdis what the models cost, at the prices your routers use. It doesn't include Emissary's routing fee.- A Proposal Mode decision counts as a request for the model the router proposed. Its tokens and spend count under the model your app reports it served, once you report its usage. A model can therefore show spend with 0 requests.
- Requests routed before Emissary recorded the API key on each request belong to no key, so they never appear here. The dashboard shows them under All API keys.
Request
Responses
- 200
- 400
- 401
- 403
- 404
The calling API key's usage over the window
since or until isn't a Unix timestamp, since is after until, the window is longer than 366 days, or granularity isn't day
Unauthorized error
The API key isn't valid or was deleted, or it was created before usage was recorded per key. Create a new key to read usage.
None of your routers has the name given in router