Guide
Reduce coding-agent API costs
Most coding-agent spend is model tokens. Keep Codex, Claude Code, OpenCode, or your SDK, compare listed rates with public list prices, and put a cap on the wallet.
Create account Calculate savings
Same agent, lower listed cost
Price the current mix
Run the calculator with the model and tokens you already use.
Keep the client
Change the base URL and key instead of rewriting the agent.
Match the plan
Create a key on the plan that contains that model.
Cap the wallet
Add only the credit you want to spend. Requests stop at zero.
Why agents get expensive
A coding agent rereads the repo, calls tools, and often runs a high reasoning setting. Output tokens and cache writes add up faster than a single chat completion.
Seat pricing does not show that mix. A token cost calculator does. Start there before you change clients or rewrite prompts.
Keep the client you already have
Token Supply is OpenAI-compatible and Anthropic-compatible. Codex, Claude Code, OpenCode, Cursor, the OpenAI SDK, and the Anthropic SDK keep their normal setup. You change the endpoint and the key.
Codex · Claude Code · OpenCode · Cursor
Pick the model the job needs
A daily refactor on a flagship model is a different bill than classification or test repair on a cheaper model in the same catalog. Use the calculator to compare listed cost for the same token mix.
Set reasoning effort on purpose. Codex model_reasoning_effort, Claude Code --effort, and OpenCode variants all change output size and cost.
Prepaid is a cost control
Add credit before the first call. Usage debits the wallet. At zero balance new requests stop, so a runaway agent cannot keep charging a monthly invoice.
Watch the same run in Usage, then decide whether to add credit, switch models, or leave the client on Token Supply.
Details
- Do I need a new agent?
- No. Compatible clients generally need a new base URL and Token Supply key.
- How much can I save?
- It depends on model, token mix, cache usage, and the current listed rate. Use the calculator.
- What happens at zero balance?
- New requests stop. Usage is not allowed without available wallet credit.
Related
- AI API token cost calculator — Compare listed Token Supply rates with public list prices.
- Track AI API token usage — Prepaid wallet, usage dashboard, and per-key spend.
- Codex custom endpoint — config.toml, auth.json, and the Responses API.
- Claude Code custom endpoint — ANTHROPIC_BASE_URL, auth token, and settings.json.
- OpenAI SDK custom base URL — Point the OpenAI client at Token Supply.