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:
When you exceed your rate limit, the API returns a
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:
Endpoints Summary
UsageEvent Schema
Every metered LLM call produces aUsageEvent record. You’ll encounter this object in the /analytics/events endpoint response.
string
Unique UUID identifier for the event. Example:
"3f6a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c"string
The model name as reported by the provider. Example:
"gpt-4o"string
The provider slug. Example:
"openai"integer
Number of input (prompt) tokens consumed by the request.
integer
Number of output (completion) tokens generated by the model.
integer
Number of tokens served from the provider’s prompt cache (read). Billed at a reduced rate where supported.
integer
Number of tokens written to the provider’s prompt cache. Billed at a premium where supported.
number
Total cost of the request in USD, calculated to 8 decimal places. Example:
0.00342100integer
End-to-end request latency in milliseconds, from the time Tokonomics received your request to the time the provider response was fully received.
object
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"}string
ISO 8601 datetime when the event was recorded. Example:
"2026-06-10T14:32:01.000Z"