Read the caller's usage summary
Returns the per-day quota state, the per-category breakdown, the hourly buckets the chart renders, and the most recent events the events table shows. One round trip; the dashboard calls it once on page load.
Returns the per-day quota state, the per-category breakdown, the hourly buckets the chart renders, and the most recent events the events table shows. One round trip; the dashboard calls it once on page load.
Authorization
bearerAuth A bearer token. The Account routes accept a Privy access token; the MCP transport accepts an sk- API key issued by POST /account/api-keys.
In: header
Query Parameters
Inclusive lower bound of the window. Defaults to the start of the current UTC day when omitted.
date-timeExclusive upper bound of the window. Defaults to the current time when omitted.
date-timeBucket granularity. Defaults to hour.
"hour"Value in
- "hour"
- "day"
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/usage"{ "window": { "from": "2019-08-24T14:15:22Z", "to": "2019-08-24T14:15:22Z", "groupBy": "hour" }, "quota": { "dailyLimit": 0, "dailyUsed": 0, "perMinuteLimit": 0, "perMinuteUsed": 0, "resetsAt": "2019-08-24T14:15:22Z" }, "breakdown": { "inference": { "requests": 0, "promptTokens": 0, "completionTokens": 0, "reasoningTokens": 0, "errors": 0, "byModel": { "property1": { "requests": 0, "promptTokens": 0, "completionTokens": 0 }, "property2": { "requests": 0, "promptTokens": 0, "completionTokens": 0 } } }, "tools": { "requests": 0, "errors": 0, "byName": { "property1": { "requests": 0, "errors": 0 }, "property2": { "requests": 0, "errors": 0 } } } }, "buckets": [ { "key": "string", "inference": { "requests": 0, "promptTokens": 0, "completionTokens": 0, "reasoningTokens": 0, "errors": 0 }, "tools": { "requests": 0, "errors": 0 } } ], "events": [ { "at": "2019-08-24T14:15:22Z", "category": "inference", "model": "string", "toolName": "string", "promptTokens": 0, "completionTokens": 0, "reasoningTokens": 0, "status": 0, "errorCode": "string", "durationMs": 0, "threadId": "string", "apiKeyId": "string" } ]}Create a chat completion (OpenAI-compatible) POST
OpenAI-compatible chat completion endpoint. Accepts the same body shape as OpenAI's `POST /v1/chat/completions` and returns the same response shape, either a JSON `ChatCompletion` (when `stream: false`, the default) or a `text/event-stream` of `ChatCompletionChunk` objects (when `stream: true`). The bearer token is either a Privy access token (the dashboard) or an `sk-` API key (services). Threads are persisted via a custom header — see the Inference module docs for the full list of non-OpenAI headers. When the upstream provider fails, a `stream: false` call returns 502 with the provider's message, and a streamed call ends with a chunk that carries an `error` object (`{ message }`) before `data: [DONE]`. A streamed call never ends without either a `finish_reason` or that error chunk. For a client-side tool loop, send every earlier `tool_calls` entry together with its `role: "tool"` result: an unmatched tool call is a request the upstream cannot serve.
List the caller's threads GET
Returns every thread the authenticated caller owns, newest activity first.