Skip to main content
Tokonomics sits between your application and any LLM provider as a transparent proxy. You change one URL in your existing code, and every request flows through Tokonomics on its way to the provider. Tokonomics records token counts, calculates costs, and forwards the response back to your app — all without buffering your data or altering the provider’s output.

The proxy URL pattern

Route your requests to Tokonomics by replacing the provider’s base URL with:
https://tokonomics.ca/proxy/{provider}/{path}
Substitute {provider} with the appropriate slug and {path} with the same endpoint path you would have called directly on the provider.
ProviderSlugUpstream path example
OpenAIopenaichat/completions
Anthropicanthropicmessages
DeepSeekdeepseekchat/completions
Google Geminigeminiv1beta/models/gemini-pro:generateContent
Mistralmistralchat/completions
xAIxaichat/completions
Coherecoherechat
Groqgroqchat/completions
Together AItogetherchat/completions
For example, an OpenAI chat completion request that previously targeted https://api.openai.com/v1/chat/completions becomes https://tokonomics.ca/proxy/openai/chat/completions.

Request pass-through

Tokonomics forwards your request body to the upstream provider exactly as you send it — no transformation, no reordering, no re-encoding. The only modification Tokonomics makes before forwarding is stripping the three metering headers it recognises:
  • X-Metering-Tags — cost attribution tags
  • X-Feature-Name — feature label shorthand
  • X-Tenant-ID — per-customer identifier
These headers are consumed by Tokonomics for cost tracking and never reach the provider. Every other header, including your Authorization header, passes through unchanged.

Streaming

Tokonomics supports streaming responses out of the box. When you set "stream": true in your request body, Tokonomics pipes each server-sent event directly back to your client as it arrives from the provider — there is no buffering or batching. The additional latency introduced by the proxy hop is under 1ms, so your users experience the same time-to-first-token as a direct provider call. Token counts are extracted from the final [DONE] chunk or the usage field in the stream, depending on the provider’s streaming format.

Response headers

Every response Tokonomics returns includes the following additional headers alongside the provider’s own headers:
HeaderDescription
X-Metering-LatencyRound-trip latency to the upstream provider in milliseconds
X-RateLimit-LimitRequests allowed per minute for your Tokonomics API key
X-RateLimit-RemainingRequests remaining in the current rate-limit window
You can log X-Metering-Latency in your own observability stack to track provider performance over time independently of Tokonomics analytics.
Your provider API key is attached to the request and sent directly to the provider over TLS. Tokonomics never stores your prompt content, completion text, or provider credentials — only token counts, costs, and the metadata you attach via metering headers.
Ready to send your first proxied request? See the provider-specific quick-start guides: