How OpenRouter's Credit and Billing Model Works
OpenRouter bills most gateway usage through USD-denominated credits: you deposit funds, inference burns credits at pass-through provider rates, and a fee applies when you buy credits (not as a hidden markup on each token).
BYOK is a parallel path: your provider is charged for tokens, while OpenRouter may take a percentage fee after a free monthly request allowance.
All dollar thresholds, percentages, and free-tier numbers below are verify at build against current OpenRouter FAQ and pricing pages.
Summary
- Credits are prepaid balance for OpenRouter-routed inference; purchase fees fund the platform while listed model prices track providers.
- Insight: Agent loops multiply tokens. Misunderstanding 402 errors, key limits, and BYOK fees turns demos into surprise bills or silent outages.
- Key Concepts: credits, pass-through pricing, purchase fee, per-key limits, 402 vs 429, BYOK fee threshold, activity ledger.
- When to Use: Any production or paid prototype on OpenRouter shared capacity; plan BYOK when you already hold large provider commits.
- Limitations/Trade-offs: Purchase fees, possible credit expiry windows, free-model caps, and dual accounting when mixing BYOK with credits.
- Related Topics: free models, BYOK, spend limits, cost routing, direct vs gateway.
Foundations
Credits
Credits are deposits in USD terms on your OpenRouter account.
When a paid request completes, OpenRouter calculates cost from the provider's token (or request/image/reasoning) pricing and deducts that amount from your balance.
Docs state no markup on underlying provider inference prices; the business model centers on fees when purchasing credits (and BYOK fees after free requests).
Buying credits
Typical flow:
- Add credits in the dashboard (card, crypto, and other methods as offered).
- Pay a platform fee on the purchase (commonly cited around 5.5% for card/Stripe-style payments with a minimum fee component, and about 5% for crypto - verify at build).
- Spend the credited balance on models over time.
- Optionally enable auto top-up when balance drops below a threshold.
Refunds, when available, are time-bounded (FAQ has described unused-credit refund windows measured in hours, with fees non-refundable - verify at build). Crypto purchases may be non-refundable.
Terms may allow expiry of unused credits after a long idle period (e.g. on the order of one year - verify at build).
What you pay per request
| Cost component | Paid via credits | Notes |
|---|---|---|
| Prompt tokens | Yes | Per model list price |
| Completion tokens | Yes | Often different $/M from prompts |
| Reasoning / internal tokens | Sometimes | Model-specific |
| Image / request fees | Sometimes | Shown on model pages |
| Credit purchase fee | At top-up | Not per token |
| BYOK % fee | From credits after free quota | Provider still bills you |
Always read the model card: agent workloads with large tool observations spike prompt tokens fastest.
Mechanics & Interactions
Account balance vs API key limits
Two layers can stop spend:
- Account credits - balance must cover the request (negative balance can block even free models).
- Per-key credit limits - optional caps on a single API key (
limit,limit_remaining, reset policy via key APIs).
Agents in staging should use keys with low ceilings so a runaway loop cannot drain the org balance.
Inspecting balance programmatically
import os
import httpx
r = httpx.get(
"https://openrouter.ai/api/v1/key",
headers={"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}"},
timeout=30.0,
)
r.raise_for_status()
print(r.json()) # usage, limit_remaining, is_free_tier, etc.Use this in boot checks or cron, not on every token, unless you accept the extra call volume.
Failure codes agents must map
| Code | Meaning | Operator action |
|---|---|---|
| 402 | Payment required - insufficient credits or key cap | Add credits / raise key limit |
| 429 | Rate limited (platform free caps or upstream) | Backoff; change model; buy credit threshold for free tier |
| 401 | Bad or disabled key | Rotate secrets |
Do not treat 402 as "retry forever." Surface a budget stop condition in the agent.
BYOK interaction with credits
With Bring Your Own Key:
- Upstream inference charges land on your provider bill.
- OpenRouter documents no BYOK fee for the first large monthly request quota (commonly 1M requests/month - verify at build), then about 5% of what that model/provider would cost on OpenRouter, taken from your OpenRouter credits.
So BYOK still needs a small credit balance once you exceed the free request threshold, even if providers are paid elsewhere.
Free models and credits
Free :free variants do not burn inference credits the same way paid models do, but:
- Platform request caps apply (see free-models page).
- Purchasing at least a documented credit threshold (commonly 10 credits lifetime - verify at build) raises free daily limits.
- Negative balance can still block usage.
Activity and chargebacks
The Activity view (and exports/APIs) break down usage by model, provider, and API key.
Finance teams should reconcile:
- Credit purchases (gross + fee)
- Inference burn
- BYOK fee lines after threshold
- Per-key limit resets
Advanced Considerations & Applications
Budgeting multi-turn agents
Estimate cost per successful task, not cost per call.
A single support agent run might be 8 model calls with growing context. Instrument:
- Tokens in / out per turn
- Tool observation size (often the real cost driver)
- Model slug mix (router vs specialist)
Organizational patterns
| Pattern | Billing setup | Risk control |
|---|---|---|
| Startup single account | Shared credits, env-specific keys | Tight staging key limits |
| Agency multi-client | Separate keys or workspaces per client | Per-key caps = client budgets |
| Enterprise | Credits + BYOK for strategic providers | Privacy filters + procurement review |
| Eval lab | Dedicated key, auto top-up off | Hard monthly cap |
Trade-offs
| Approach | Strength | Weakness | Best fit |
|---|---|---|---|
| Credits only | Simple, full catalog | Purchase fee; balance ops | Most agent teams |
| BYOK heavy | Uses cloud commits; high control | Dual bills; fee after free requests | High volume on few providers |
| Direct only | Possible enterprise discounts | No unified long-tail models | Single-vendor products |
| Hybrid | Flexibility | Accounting complexity | Mature multi-model platforms |
Common Misconceptions
- "OpenRouter adds 5% on every token." Public docs emphasize fees on credit purchase (and BYOK after free requests), with pass-through inference pricing - confirm live docs.
- "Free models never need credits." Higher free rate limits and non-negative balance policies still couple free use to the credit system.
- "One API key cannot be budget-limited." Per-key limits exist specifically for this.
- "BYOK is always free on OpenRouter." Only up to the documented monthly request threshold.
- "Auto top-up removes the need for alerts." It prevents downtime but can mask runaway agents. Keep anomaly alerts.
FAQs
How does OpenRouter make money if inference is pass-through?
Primarily via fees when you buy credits and via BYOK fees after free request allowances. Confirm current policy at build.
Do prompt and completion tokens cost the same?
Usually no. Model pages list separate rates. Agent traces should store both.
What currency are credits in?
USD-denominated pricing on the site and API.
Can unused credits be refunded?
Policies are time-limited and method-dependent. Check the live FAQ and Credits page; do not assume open-ended refunds.
Do credits expire?
Terms have reserved rights to expire unused credits after a period such as one year - verify current terms.
Why did I get 402 on a free model?
Often negative balance, key limits, or account state issues. Add credits or inspect key limits via GET /api/v1/key.
How do I cap a single agent's spend?
Issue a dedicated API key with a credit limit and optional reset interval; enforce max turns in the agent loop as a second brake.
Are taxes included?
Payment processors may add taxes depending on location. Check checkout and invoices.
Does streaming cost more than non-streaming?
Billing is usage-based on tokens (and other metered units), not on streaming itself. Failed mid-stream calls may still consume partial usage depending on provider accounting.
How is BYOK 5% calculated?
Docs describe it as a percentage of what the same model/provider would cost on OpenRouter, deducted from OpenRouter credits after the free monthly request count.
Can I pay only with a cloud commit and zero OpenRouter credits?
Only while BYOK stays within free request thresholds and you do not need credit-funded models. Beyond that, keep credits available for fees and non-BYOK routes.
Where do I see historical spend?
Activity dashboard filtered by key/model/provider; export as needed for finance.
Should agents call the credits API every turn?
No. Sample periodically or on 402. Cache remaining limit in your control plane.
How do purchase fees affect unit economics?
If you buy credits in large chunks, the fee amortizes across many tokens. Tiny top-ups maximize fee drag - batch purchases when cash flow allows.
Related
- Free Models on OpenRouter: What's Available and Their Limits - zero-cost tier caps
- Bring Your Own Key (BYOK) - provider-billed path
- OpenRouter vs Calling Provider APIs Directly - cost trade-offs
- Setting Spend Limits and Usage Caps per API Key - key-level controls
- Monitoring OpenRouter Spend and Usage in Real Time - ops follow-on
Stack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.