Skip to content

Coding agents

A cheap LLM API for coding agents

A coding agent sends its whole context again on every step, so most of what you pay for is input it has already sent. Here the repeated part bills at $0.011 per million tokens instead of $0.45, on a model with a million tokens of context, tool calls, and a balance that tops itself up.

Checked 29 October 2026

per 1M cached tokens, on DeepSeek
$0.011
tokens of context
1M
a month in the worked example
$31.07
requests a minute per key
120

Why cached input decides the bill

Every step of an agent is a new call that starts with the same system prompt, the same tool schemas and the same conversation so far, plus a little that is new: a file it just read, a test result. By mid-task a call is tens of thousands of tokens, and nearly all of them were in the call before.

When a call starts the way a recent one did, the model reads that start from cache, and those tokens bill at the cached price. On DeepSeek that is $0.011 per million against $0.45 fresh, about 41 times less. Caching is automatic; each reply says how much was cached in usage.prompt_tokens_details.cached_tokens.

  • Keep the start stable: system prompt and tools first, history next, the new message last. Agents already work this way.
  • An agent that compacts or rewrites its history starts a fresh cache; the next call pays full price once.
  • A cache lasts a few minutes and needs a start of about 1,000 tokens or more. Send prompt_cache_key per task to keep its calls on a server that has it cached.

A month of agent work, priced

One developer, an agent running about 4 hours a working day at roughly 100 calls an hour, for 22 days: 8,800 calls. Each call sends 50,000 tokens and gets 700 back. 46,000 of the 50,000 (92%) repeat the previous call and come from cache. On DeepSeek V4.1 Flash Uncensored:

PartTokensPer 1MCost
New input4,000$0.454,000 × $0.45 ÷ 1M = $0.0018
Cached input46,000$0.01146,000 × $0.011 ÷ 1M = $0.000506
Output700$1.75700 × $1.75 ÷ 1M = $0.00122
One call50,700$0.00353
A month (8,800 calls)$31.07

The cached input is 92% of the tokens and 14% of the cost. With no cache hits at all, the same month would be $208.78, 6.7 times as much.

Same month onOne callA month
DeepSeek V4.1 Flash Uncensored, cached as above$0.00353$31.07
DeepSeek V4.1 Flash Uncensored, nothing cached$0.02$208.78
GLM 5.3 Flash Uncensored, cached as above$0.0031$27.24

Thinking is billed as output. DeepSeek thinks only when you set reasoning_effort; GLM always thinks briefly, which adds output tokens this leaves out. GLM also holds 128K tokens of context, against DeepSeek’s million.

Your numbers will differ. Work them out with your own token sizes on Pricing, and check a real run: every reply carries its cost in usage.nokeep_credits, and the console shows spend by day.

Built for long agent runs

  • A million tokens of context on deepseek-v4.1-flash-uncensored, and replies up to 131,072 tokens, so a large repo map or a long session fits without trimming.
  • Tool calls in the OpenAI format on both models, with tool_choice and parallel_tool_calls on DeepSeek. See Tool calls.
  • No refusals mid-task. Both models have their refusals removed, so a security fix, an exploit test or a scraper doesn’t stop the run.
  • Auto top-up. Turn it on in the console and a call that finds the balance short charges your saved card once and goes through, instead of a 402 that stops the agent. It runs at most three times and $100 in any 24 hours, and isn’t available yet for cards issued in India.
  • No daily cap unless you set one. A new key is bounded by your credits alone; add a cap per key in the console if you want one. 120 requests a minute per key.

Set up your agent

Every agent below speaks the OpenAI format. Point it at https://nokeep.ai/v1, paste your key, and pick deepseek-v4.1-flash-uncensored. Where a guide exists, it shows the exact settings screen:

Anything else that takes a custom OpenAI-compatible endpoint works the same way. See the OpenAI-compatible API page for what is and isn’t supported.

Questions

What is the cheapest model here for a coding agent?

On a cache-heavy agent the two come out close: $31.07 on DeepSeek and $27.24 on GLM in the example above. DeepSeek is usually the better pick for agents, with a million tokens of context and no forced thinking.

How do I know the cache is working?

Read usage.prompt_tokens_details.cached_tokens on each reply. On a long agent run most of usage.prompt_tokens should show up there after the first call.

Will my agent stop when the credits run out?

Not with auto top-up on: a call that finds the balance short charges your saved card and is answered. With it off, calls stop with a 402 until you top up.

Is there a minimum spend or a subscription?

No subscription. Credits start at $5, 1,000 credits are $1, and they never expire. Credits are non-refundable.

Is my code kept?

No. We keep one row of counts per call for billing, never the prompt or the reply, and neither model host stores them. See the private LLM API page.