Base URL
All API requests are made to:Authentication
Authenticate every request by passing your Tokonomics API key as a Bearer token in theAuthorization header. All keys are prefixed with mk_ followed by 48 hex characters.
Rate Limits
Every API response includes the following rate-limit headers:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum number of requests allowed per minute for your plan |
X-RateLimit-Remaining | Number of requests remaining in the current one-minute window |
429 Too Many Requests response. The response also includes a Retry-After header indicating how many seconds to wait before retrying.
Error Responses
All errors return a JSON body witherror and message fields:
| Status | Meaning |
|---|---|
401 | Invalid or missing API key |
429 | Rate limit exceeded or monthly budget cap reached |
502 | Upstream provider error |
Endpoints Summary
| Method | Path | Description |
|---|---|---|
POST | /proxy/{provider}/{path} | Proxy an LLM API call |
GET | /analytics/summary | Current month spend summary |
GET | /analytics/daily | Daily spend breakdown |
GET | /analytics/by-tag | Spend grouped by tag |
GET | /analytics/events | Paginated raw usage events |
GET | /health | Health check (no auth required) |
UsageEvent Schema
Every metered LLM call produces aUsageEvent record. You’ll encounter this object in the /analytics/events endpoint response.
Unique UUID identifier for the event. Example:
"3f6a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c"The model name as reported by the provider. Example:
"gpt-4o"The provider slug. Example:
"openai"Number of input (prompt) tokens consumed by the request.
Number of output (completion) tokens generated by the model.
Number of tokens served from the provider’s prompt cache (read). Billed at a reduced rate where supported.
Number of tokens written to the provider’s prompt cache. Billed at a premium where supported.
Total cost of the request in USD, calculated to 8 decimal places. Example:
0.00342100End-to-end request latency in milliseconds, from the time Tokonomics received your request to the time the provider response was fully received.
Key-value pairs of custom tags attached to the request via the
X-Metering-Tags header. Values are always strings. Example: {"team": "growth", "feature": "summarizer"}ISO 8601 datetime when the event was recorded. Example:
"2026-06-10T14:32:01.000Z"