Documentation Index
Fetch the complete documentation index at: https://metrion.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Metrion account (sign up at metrion.dev)
- An API key from at least one AI provider (Anthropic, OpenAI, Gemini, Mistral, or Grok)
Get your Metrion token
After signing up, Metrion redirects you to the Integrate page. Your Metrion token is displayed at the top of the page:Copy it — you’ll use it as the
api_key / apiKey in your SDK. Keep it confidential.Add your provider API key
On the Integrate page, select a provider from the dropdown and paste your provider API key. Metrion stores it encrypted. Once saved, the code block below unlocks automatically.Two authentication modes are available:
Most users should use stored mode — it’s simpler and requires only one credential in your code.
| Mode | How it works |
|---|---|
| Stored mode (default) | You store your provider key in Metrion. Use your sk-metrion-xxx token as the only credential in your SDK. |
| Pass-through mode | You manage your own provider key. Pass it directly as the bearer/api-key credential, and add x-metrion-token: sk-metrion-xxx as a separate header so Metrion can identify your account. |
Point your SDK at Metrion
Change two values in your existing SDK setup: the For Gemini, Mistral, and Grok, use the OpenAI SDK with the corresponding base URL:
base_url / baseURL and the api_key / apiKey. Everything else stays the same.Anthropic proxy endpoint: https://www.metrion.dev/api/proxyOpenAI-compatible proxy endpoint: https://www.metrion.dev/api/proxy/openai/v1| Provider | Base URL |
|---|---|
| Gemini | https://www.metrion.dev/api/proxy/gemini/v1 |
| Mistral | https://www.metrion.dev/api/proxy/mistral/v1 |
| Grok | https://www.metrion.dev/api/proxy/grok/v1 |
Make a request and check your dashboard
Run your code. Within a few seconds, the Integrate page detects your first request and confirms it was tracked. Then head to your Dashboard to see cost, tokens, and latency for that request.From this point on, every request your app makes through Metrion is recorded automatically — no further setup required.
Optional: track multiple users or bots
Add thex-metrion-user header to any request to attribute it to a specific user, agent, or service. The value appears in the Sources tab of your dashboard and in your logs.
Streaming is fully supported. Pass
stream: true in your request body as you normally would. Metrion captures token counts from the final SSE chunk and logs them once the stream completes.