Path Parameters
The LLM provider slug identifying which upstream API to route the request to. Must be one of:
| Slug | Provider |
|---|---|
openai | OpenAI |
anthropic | Anthropic |
deepseek | DeepSeek |
gemini | Google Gemini |
mistral | Mistral AI |
xai | xAI (Grok) |
cohere | Cohere |
groq | Groq |
together | Together AI |
The upstream API path to forward the request to. This is the provider-native path — for example,
chat/completions for OpenAI or messages for Anthropic.Examples:- OpenAI:
chat/completions - Anthropic:
messages - Gemini:
models/gemini-2.0-flash:generateContent
Request Headers
Your Tokonomics API key in Bearer token format.
Must be
application/json.A JSON-encoded object of custom key-value tags to attach to the usage event. Use this to attribute spend to teams, features, or any other dimension you want to query in analytics.
Shorthand for tagging a single feature name. Sets the
feature tag on the usage event. Equivalent to passing {"feature": "your-feature"} in X-Metering-Tags.A customer tenant identifier to attach to the usage event. Sets the
tenant_id tag, enabling per-tenant spend breakdowns in analytics.Request Body
Pass the provider’s native request body unchanged as a JSON object. Tokonomics forwards your request body to the upstream provider without modification.You do not need to include your upstream provider API key in the request body. Tokonomics injects it server-side using the credentials you configured in your dashboard.
Response
Tokonomics streams the provider’s response directly back to you. The response body and status code are the provider’s native response — no transformation is applied. The following additional headers are injected by Tokonomics:| Header | Description |
|---|---|
X-Metering-Latency | Total round-trip latency as a string, e.g. "342ms" |
X-RateLimit-Limit | Your plan’s request-per-minute limit |
X-RateLimit-Remaining | Remaining requests in the current one-minute window |
Error Responses
| Status | Meaning |
|---|---|
401 | Invalid or missing Tokonomics API key |
429 | Rate limit exceeded or monthly budget cap reached — check the Retry-After header |
502 | The upstream provider returned an error or was unreachable |
429 is returned due to budget cap, your requests will be blocked until the budget resets at the start of the next calendar month or you increase your budget in the dashboard.