Skip to main content
Tokonomics requires no SDK, no new library, and no changes to your prompt logic. All you do is point your existing LLM client at a different base URL and add one authentication header. This guide walks you from zero to your first metered API call in five minutes.
1

Create your account

Go to tokonomics.ca/register and sign up for a free account. No credit card is required. Your free plan activates immediately and includes 100 tracked calls per month — enough to explore the dashboard and verify your integration before upgrading.
2

Get your API key

Once you’re logged in, open your dashboard and navigate to API Keys, then click Create key. Give the key a descriptive name (for example, production-backend or dev-local) so you can identify it later.Your new key has the format mk_ followed by 48 hexadecimal characters:
mk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6
Your API key is displayed in plaintext exactly once, at the moment of creation. Copy it to a password manager or secrets store immediately — you cannot retrieve the plaintext value again after you close the dialog.
3

Route requests through Tokonomics

Replace your LLM provider’s base URL with the corresponding Tokonomics proxy URL. The pattern is:
https://tokonomics.ca/proxy/{provider}/{path}
Where {provider} is the lowercase provider slug (e.g., openai, anthropic, gemini) and {path} is whatever path your SDK normally appends.

OpenAI

from openai import OpenAI

client = OpenAI(
    api_key="sk-your-openai-key",
    # No base_url set — defaults to https://api.openai.com/v1
)

Anthropic

import anthropic

client = anthropic.Anthropic(
    api_key="sk-ant-your-anthropic-key",
    # No base_url set — defaults to https://api.anthropic.com
)
4

Make your first call

Send a request directly with curl to confirm your key is working and the proxy is routing correctly:
curl https://tokonomics.ca/proxy/openai/chat/completions \
  -H "Authorization: Bearer mk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
You’ll receive the standard OpenAI response body unchanged. Check the response headers for metering metadata that Tokonomics adds on the way back:
HeaderDescription
X-Metering-LatencyTotal round-trip time in milliseconds from proxy ingress to provider response
A successful response confirms that your key is valid and that token usage has been recorded on your account.
5

Check your dashboard

Open tokonomics.ca and navigate to your dashboard. You’ll see the call you just made listed under Recent requests, along with the token count, USD cost, model, latency, and timestamp. Your cumulative spend and usage totals update in real time with every request.
Add the X-Metering-Tags header to any request to attribute cost to a specific team, feature, or user:
-H 'X-Metering-Tags: {"team":"growth","feature":"chatbot"}'
Tags are stored alongside every request record and let you slice your spend on any custom dimension in the dashboard or via the API. See Tag-based Attribution for the full tagging reference.
Ready to go deeper? Explore the API Reference for every supported endpoint, provider slug, and query parameter.