Reduce LLM costs in production
Practical ways to cut LLM API spend: per-model discounts, prompt caching billed correctly, lowest-cost routing, right-sized models and hard budgets per key.
Use Claude Code with a Tokely API key. Native Anthropic Messages endpoint, streaming, tools and prompt caching, billed per token from one balance with no subscription.
Set ANTHROPIC_BASE_URL=https://api.tokely.me and ANTHROPIC_AUTH_TOKEN to your Tokely key, then map Claude Code's model slots to enabled Claude models. Tokely serves the native /v1/messages endpoint with streaming, tool use and prompt caching, and bills each request per token from your prepaid balance.
export ANTHROPIC_BASE_URL=https://api.tokely.me
export ANTHROPIC_AUTH_TOKEN=sk-your-tokely-key
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-5-5
claudeBase URL https://api.tokely.me/v1. Create a key in the dashboard and keep it in an environment variable. Quickstart · Model IDs and endpoints
| Model | Tokely input / output | Tokely example | model developer example | Discount vs model developer |
|---|---|---|---|---|
| Claude Haiku 5.5Anthropic | $0.042353 / $0.211764Cache read: $0.042353 | $0.095294 | $0.225$0.1 / $0.5 per 1M | 57.6% off |
| Claude Sonnet 5Anthropic | $1.5 / $7.5Cache read: $0.15 | $3.375 | $4.5$2 / $10 per 1M | 25.0% off |
| Claude Sonnet 5.5Anthropic | $1.5 / $7.5Cache read: $0.075 | $3.375 | $4.5$2 / $10 per 1M | 25.0% off |
| Claude Sonnet 4.6Anthropic | $2.25 / $11.25Cache read: $0.225 | $5.0625 | $6.75$3 / $15 per 1M | 25.0% off |
| Claude Opus 5.5Anthropic | $3 / $15Cache read: $0.15 | $6.75 | $9$4 / $20 per 1M | 25.0% off |
| Claude Opus 4.6Anthropic | $3.75 / $18.75Cache read: $0.375 | $8.4375 | $11.25$5 / $25 per 1M | 25.0% off |
| Claude Opus 4.7Anthropic | $3.75 / $18.75Cache read: $0.375 | $8.4375 | $11.25$5 / $25 per 1M | 25.0% off |
| Claude Opus 4.8Anthropic | $3.75 / $18.75Cache read: $0.375 | $8.4375 | $11.25$5 / $25 per 1M | 25.0% off |
| Claude Opus 5Anthropic | $3.75 / $18.75Cache read: $0.375 | $8.4375 | $11.25$5 / $25 per 1M | 25.0% off |
| Claude Opus 4.5Anthropic | $3.75 / $18.75Cache read: $0.375 | $8.4375 | $11.25$5 / $25 per 1M | 25.0% off |
| Claude Fable 5Anthropic | $7.5 / $37.5Cache read: $0.75 | $16.875 | $22.5$10 / $50 per 1M | 25.0% off |
| Claude Fable 5.1Anthropic | $7.5 / $37.5Cache read: $0.1875 | $16.875 | $22.5$10 / $50 per 1M | 25.0% off |
Claude Code through an API key is billed by usage: input, output, cache reads and cache writes at the model's published rate. There is no subscription or weekly cap; you top up one USD balance and can set daily and monthly spending limits for the account or a single key.
Coding agents resend the same system prompt, tools and project context on every turn. Claude Code marks those prefixes with cache_control; Tokely passes it through and bills cache reads at the cache-read rate instead of the full input rate. Usage in each response shows cache reads and writes.
Claude Code uses separate model slots for its main and background work. Map Sonnet, Opus and Haiku slots to enabled Tokely IDs with ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL; Claude Haiku 5.5 keeps background calls inexpensive. Unmapped or disabled model IDs return a clear model_not_available error.
Anthropic server tools such as web search, the Files and Batch APIs and /v1/messages/count_tokens are not available. Images and PDFs must be sent inline. A Claude Pro or Max subscription is separate and does not fund API usage.
Every model on this page is available through one OpenAI-compatible endpoint and one balance, with routing modes, bounded fallback, spending limits and request logs.
A hosted LLM gateway with one OpenAI-compatible endpoint, account routing modes, bounded fallback, spending limits and request logs. Text, image, video and audio from one balance.
Keep the OpenAI SDK and call Claude, Gemini, GPT, Kimi, GLM and other supported models. Change the base URL, key and model ID.
Yes. Point ANTHROPIC_BASE_URL at https://api.tokely.me and use your Tokely key as ANTHROPIC_AUTH_TOKEN. Claude Code calls the native /v1/messages endpoint with streaming and tools.
You pay the published per-token rate of the model each request uses, including cache reads and writes. Long agent sessions depend mostly on context size and caching; the usage of each request is in your dashboard logs.
Yes. cache_control blocks are passed through, and cache reads and writes are billed at their own rates. Cached tokens are not charged again as regular input.
Yes. Set base_url to https://api.tokely.me and api_key to your Tokely key, then call messages.create with an enabled Claude model ID.
Check the model, compare the rate, and connect with a Tokely key.