Documentation
Quickstart
Metronium is an OpenAI-compatible gateway. Migrating is two environment variables — model names, streaming, tool calls and vision behave exactly as they do today.
1. Get a key
Two ways in, and both end at the same place: an address with one or more active grants.
From a wallet, with no account
Your wallet signs a fixed message locally. The signature is the credential — there is no key-creation transaction, no checkout, and no signup page, which is what lets an agent start on its own.
// The message is deterministic. Raise the epoch to rotate. const epoch = 0; const sig = await wallet.signMessage({ message: `Metronium API key · chain 4663 · epoch ${epoch}`, }); const apiKey = `sk_mtr_${epoch}_${base64url(sig)}`;
From the dashboard
Pay by card, receive an sk_mtr_ key directly. The chain stays invisible — you still get enforced ceilings, you just never touch a wallet.
2. Point your client at us
# before OPENAI_BASE_URL=https://api.openai.com/v1 OPENAI_API_KEY=sk-… # after OPENAI_BASE_URL=https://api.metronium.xyz/v1 OPENAI_API_KEY=sk_mtr_…
3. Send a request
curl https://api.metronium.xyz/v1/chat/completions \ -H "Authorization: Bearer $METRONIUM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"anthropic/claude-sonnet-5","messages":[{"role":"user","content":"Plan the next task."}]}'
4. Let the agent budget itself
Every response carries what it cost and what is left, so an agent can decide when to stop without a second call.
X-Metron-Cost: 0.004120 X-Metron-Remaining: 41.882300 X-Metron-Request-Id: 8f2a… X-Metron-Overhead-Ms: 4
Need the full picture? GET /v1/key returns balance, grant policy and rate limits. See the API reference.
Model ids follow OpenRouter's format — provider/model. Call GET /v1/models for the current catalogue; it is fetched live from upstream rather than maintained by hand, so a model works here the day it ships there.
Requests are checked against the grant's policy before they leave the gateway. A model outside the allowlist, an expired grant, or an hourly rate cap that has been reached all return 402 or 403 — never a silent downgrade to a cheaper model.