Code By AI vs OpenRouter: token prices and credit fees
This is a platform comparison for one representative model, claude-sonnet-5, not a model comparison. Code By AI charges catalog token rates from a prepaid wallet. OpenRouter routes the same model at its listed token rate but sells inference through credits, whose Standard purchase fee is separate from the per-token price. Both support native Anthropic Messages, with different base URLs and credentials. The “Official list” row is a vendor price reference, not a Code By AI charge.
Short answer
For claude-sonnet-5, Code By AI charges $0.50 input / $2.50 output per 1M tokens; OpenRouter’s verified base rate is $2.00 / $10.00, with a separate 5.5% Standard credit-purchase fee. The table does not multiply token rates by 1.055.
Token and monthly figures are arithmetic from the current catalog, not a forecast or a measured benchmark. The monthly example excludes cache writes, tools and actual usage differences.
Token prices on the same basis
All values are USD per 1M tokens. Code By AI prices already include the published multiplier. Vendor list prices are shown only when verified. The 5-minute and 1-hour cache writes apply only to Claude and use each platform’s own input rate.
| Platform | Input | Cache read | Cache write (5 min) | Cache write (1 hour) | Output |
|---|---|---|---|---|---|
| Code By AI | $0.50 | $0.05 | $0.625 | $1.00 | $2.50 |
| Official list | $2.00 | $0.20 | $2.50 | $4.00 | $10.00 |
| OpenRouter | $2.00 | $0.20 | $2.50 | $4.00 | $10.00 |
OpenRouter standard endpoint (verified): anthropic/claude-sonnet-5 · anthropic · anthropic/claude-sonnet-5-20260630 ·
OpenRouter cells show a number only when the exact provider model ID and rate basis were checked against this catalog row. Cells marked Not verified have no such evidence. Credit-purchase fees and other OpenRouter plans are separate and are never added to the per-token prices here. OpenRouter pricing and FAQ · FAQ
OpenRouter: Anthropic provider, Standard variant, 1M-token context, regular synchronous API. Verified base input, output and cache-read rates matched the catalog vendor fields and are recorded here. Fast, Batch, regional endpoints and credit fees are excluded. /pricing
Monthly arithmetic example
At 20M input and 2M output tokens per month, priced at catalog rates:
| Model | Official list / month | Code By AI / month |
|---|---|---|
| Claude Sonnet 5claude-sonnet-5 | $60.00 | $15.00 |
Which choice fits which work?
Rows restate catalog arithmetic and official guidance. They are not Code By AI benchmarks or measured speed and quality results.
| Kind of work | Starting point | Basis |
|---|---|---|
| One prepaid key and balance for Claude, GPT and Gemini | Code By AI | Catalog token rates are debited from this gateway’s prepaid wallet. |
| A multi-provider router with credits and its published purchase-fee conditions | OpenRouter | Its token rate and credit fee are separate; check the current pricing and checkout terms. |
| Pointing Claude Code at either gateway | Either, with the target gateway’s URL and key | Keep the Authorization: Bearer header. Change the base URL and key value to those of the target gateway; billing differs. |
How the integration differs
These are wire-level settings readers must configure, not capability claims.
| Model ID | Code By AI: claude-sonnet-5 · OpenRouter: anthropic/claude-sonnet-5 |
|---|---|
| Base URL | Code By AI: ANTHROPIC_BASE_URL=https://www.codebyai.net/api/agent · OpenRouter: ANTHROPIC_BASE_URL=https://openrouter.ai/api |
| Authentication | Code By AI: use `ANTHROPIC_AUTH_TOKEN=<Code By AI key>` for Claude Code (`Authorization: Bearer <key>`), or `x-api-key: <key>` for Messages API clients · OpenRouter: use `ANTHROPIC_AUTH_TOKEN=<OpenRouter key>` (`Authorization: Bearer <key>`) and set `ANTHROPIC_API_KEY=""` for Claude Code |
| Protocol | Both use native Anthropic Messages: `POST /v1/messages` relative to the base URL. For Claude Code, OpenRouter guarantees compatibility only with the Anthropic first-party provider; follow its guide. |
| Billing | Code By AI: prepaid wallet debited at catalog rates · OpenRouter: credits, with the Standard purchase fee shown separately |
FAQ
- Is the 5.5% fee a per-token markup?
- No. It is the Standard credit-purchase fee (minimum $0.80 for non-crypto payments; the FAQ lists 5% for crypto). It is not added to the per-token rate, and this page does not multiply token prices by 1.055. Other plans and conditions differ.
- Are the token rates identical?
- Compare the rows for claude-sonnet-5 above: OpenRouter uses the verified snapshot from 2026-11-19; Code By AI charges 1/4 of the live catalog list rate. Credit fees remain separate.
- Are the model IDs the same on both platforms?
- No. Use `claude-sonnet-5` on Code By AI and `anthropic/claude-sonnet-5` on OpenRouter.
- Is OpenRouter an official Anthropic product?
- No. OpenRouter is an independent third-party router, as is Code By AI. This page compares published prices and connection settings; it does not assert either platform’s data-retention or account terms.
Next step
Create a Code By AI account, top up the prepaid wallet and create an API key. Then call the model with the ID and endpoint above.
Code By AI is a third-party prepaid API gateway. It is not an official vendor product.