The proxy URL pattern
Route your requests to Tokonomics by replacing the provider’s base URL with:{provider} with the appropriate slug and {path} with the same endpoint path you would have called directly on the provider.
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 tagsX-Feature-Name— feature label shorthandX-Tenant-ID— per-customer identifier
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:
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.