Request headers (Tokonomics-specific)
The following headers are consumed by Tokonomics and stripped before the request is forwarded upstream. Use them to attach tagging context that appears in your analytics dashboard and cost reports.A JSON object of custom key-value pairs you want attached to this request’s cost record. Tags appear in your analytics dashboard and can be used to filter and group spend.
A shorthand single-feature label for this request. Tokonomics stores this as the
feature tag key in your cost record. Use it as a quick alternative to a full X-Metering-Tags object when you only need to track one dimension.Your end customer’s tenant identifier. Tokonomics records this against the request so you can break down LLM costs per customer in your analytics dashboard — useful for SaaS products where you want to understand per-tenant spend.
Response headers (added by Tokonomics)
Tokonomics injects the following headers onto every proxied response before returning it to your application.The round-trip latency (in milliseconds) measured between Tokonomics and the upstream provider for this request. This reflects network and provider processing time only — it does not include time between your application and the Tokonomics proxy.Example:
342msThe total number of requests your API key is allowed to make per minute under your current plan.Example:
60The number of requests remaining in the current one-minute rate-limit window for your API key. This value resets every minute.Example:
47Pass-through headers
All headers not listed above are forwarded to the upstream provider unchanged. This includes, but is not limited to:Authorization(your provider API key)Content-Typeanthropic-versionanthropic-beta- Any other provider-specific headers your request requires
Rate limiting
When you exceed your plan’s per-minute request limit or hit a hard spending cap, Tokonomics returns an HTTP429 Too Many Requests response instead of forwarding the request to the upstream provider.
The 429 response includes a Retry-After header that tells you exactly how many seconds to wait before retrying:
429 responses by reading the Retry-After value and pausing before retrying the request. Most HTTP client libraries support this natively via retry middleware.