Guide
Run Your Coding Agent on DeepSeek and Kimi: A Practical Guide
To lower what you spend on AI coding, keep the agent you already use (Claude Code, OpenCode, Cline) and point it at an open-weight model: DeepSeek V4.1 Flash for everyday volume, Kimi K3.1 for the hard tasks. You can pay the model makers per token, go through OpenRouter, buy a coding plan, or use a flat router like dl.new, and on all four routes caching decides your real bill more than the headline price does.
This guide covers each route honestly, what the two models are each good at, the caching math, and the exact setup for Claude Code, OpenCode and Cline. All prices were checked on official pages on 1 Dec 2026.
Full disclosure: we make dl.new.
The short answer
Frontier models from Anthropic and OpenAI are excellent, and many developers keep them for the hardest work. But a coding agent sends dozens of calls per task, and most of those calls are routine: read a file, edit a function, run the tests, read the output. Open-weight models handle that loop well. Here are the four ways to run them.
| Route | How you pay | Setup | Best for |
|---|---|---|---|
| dl.new (flat router) | $7, $20 or $60/mo, fixed weekly token allowance | One install line, then dl claude or dl opencode |
A known number every week, both models on one key |
| Model maker's API (DeepSeek, Moonshot) | Per token, prepaid balance | API key, base URL and model names per agent | Full control, one model, list rates at the source |
| OpenRouter | Per token, prepaid credits | One key, model IDs per agent | Trying many models from one account |
| Coding plans (Kimi membership, OpenCode Go, GLM Coding Plan) | Monthly, with 5-hour and/or weekly caps | Varies by plan | Staying inside one vendor's models or tools |
DeepSeek V4.1 Flash: what it's good at
DeepSeek released V4.1 Flash on 10 September 2026. It's a 552B-parameter mixture-of-experts model with a small active slice per token, a 1M-token context window and up to 384K output tokens. On DeepSeek's own API it's called deepseek-flash, and older Flash and V4-Pro names now route to it.
DeepSeek built it with agent workloads in mind. Its launch note says cache-hit charges "often account for a large share of agent costs", and the model's KV cache needs a quarter of the memory of the previous generation. In practice that makes it a strong default for:
- High-volume agent loops: edit, run tests, fix, repeat
- Writing and fixing tests, refactors, renames, boilerplate
- Reading large codebases, thanks to the 1M context
- Screenshots and diagrams, since it accepts images natively
Source: DeepSeek V4.1 Flash release note, DeepSeek pricing.
Kimi K3.1: what it's good at
Kimi K3.1 is Moonshot AI's coding and agent model, listed on Moonshot's platform as Kimi K3.1 Pro (API ID kimi-k3.1-pro). It has a 1M-token context window and always thinks before it answers. You can't turn thinking off, but you can set reasoning_effort to low, high or max (the default).
Moonshot reports 65.7% on Terminal-Bench 4.0 and 61.2% on its internal long-horizon coding benchmark, up from 55.95% for K3. Where that shows up in daily work:
- Debugging that needs a chain of hypotheses, not a single edit
- Planning a multi-file change before writing it
- Long-horizon tasks where the agent has to keep a goal in view for many steps
The trade-off is speed and output volume: always-on reasoning means more output tokens and longer waits per call. A common pattern is DeepSeek for the bulk of the work and Kimi when a task stalls.
Source: Kimi K3.1 Pro quickstart, Kimi API pricing.
How caching changes the real bill
A coding agent resends almost the same context on every call: system prompt, tool definitions, the files it already read, the conversation so far. Providers cache that repeated prefix and bill it at a fraction of the normal input rate. In coding-agent traffic, about 95% of input tokens are cache hits.
Here are the official list rates per 1M tokens (checked 1 Dec 2026):
| Model | Cached input | Fresh input | Output |
|---|---|---|---|
| DeepSeek V4.1 Flash (peak) | $0.006 | $0.30 | $1.20 |
| DeepSeek V4.1 Flash (off-peak) | $0.003 | $0.15 | $0.60 |
| Kimi K3.1 Pro | $0.20 | $2.00 | $10.00 |
DeepSeek's peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday. Off-peak is half price.
Now take 100M tokens of agent traffic, split 95% cached input, 4% fresh input and 1% output:
| Model | With caching | Without caching |
|---|---|---|
| DeepSeek V4.1 Flash (peak) | $2.97 | $30.90 |
| DeepSeek V4.1 Flash (off-peak) | $1.49 | $15.45 |
| Kimi K3.1 Pro | $37.00 | $208.00 |
Three things follow. First, caching cuts the bill by 5 to 10 times, so a setup that keeps your prefix stable matters more than the headline rate. Second, on DeepSeek, fresh input and output make up most of the cost, even though they're only 5% of tokens. Third, Kimi's always-on thinking pushes the output share up, so real Kimi sessions usually cost more than this example.
Practical habits that keep the cache warm: put project rules in a file the agent loads every time (CLAUDE.md, AGENTS.md), avoid editing the system prompt mid-session, and start a fresh session for a new task instead of dragging an old one along.
The four routes, in detail
1. The model maker's API
DeepSeek and Moonshot both sell per-token API access with a prepaid balance. DeepSeek also exposes an Anthropic-compatible endpoint, so Claude Code can talk to it directly. Moonshot needs a top-up of at least $1 to start, and your rate limits grow with your cumulative top-up.
Pick it if you want one model, full control and the list rate at the source.
Skip it if you don't want to manage two accounts, two balances and a set of environment variables per agent.
2. OpenRouter
OpenRouter puts many providers behind one key and one credit balance. Both models are listed (deepseek/deepseek-v4.1-flash and moonshotai/kimi-k3.1-pro), and prices vary by the provider that serves your request.
Pick it if you like trying many models from one account.
Skip it if you want a fixed monthly number rather than a balance that drains as you work.
3. Coding plans
Several vendors sell monthly plans for coding agents:
- Kimi membership: Plus $19, Pro $39, Max $99, Ultra $199 per month. All four include Kimi Code, with a rolling 5-hour limit and no weekly limit. Kimi only. (kimi.ai)
- OpenCode Go: $10/mo (Go Plus $40), a dollar allowance across many models, with 5-hour and weekly caps. (opencode.ai/docs/go)
- Z.ai GLM Coding Plan: from $18/mo, GLM models only, credits per 5 hours and per week. (docs.z.ai)
Pick one if you're happy inside one vendor's models or tools.
Skip them if you want DeepSeek and Kimi together on one key.
4. A flat router: dl.new
dl.new runs the coding agent you already use on DeepSeek V4.1 Flash and Kimi K3.1, for a flat monthly price with a weekly token allowance. There are no API keys to copy between tools and no config files to edit.
- Starter $7/mo: ~62M DeepSeek tokens/week (95.5% caching applied)
- Plus $20/mo: ~300M DeepSeek + ~1.5M Kimi tokens/week (95.5% caching applied)
- Max $60/mo: ~1B DeepSeek + ~4M Kimi tokens/week (95.5% caching applied)
Cached input counts 2% toward your allowance; fresh input and output count 100%. Each model has a hard weekly limit, and when Kimi runs out you keep going on DeepSeek automatically. There are no overage charges and no per-token bill. Requests are retried automatically if a provider has a problem.
To be straight about it: dl.new does not sell tokens below market rates. If you buy DeepSeek direct per token, heavy agent use costs about the same. What you get is a known number every week, both models on one key, and no setup, so you keep coding without watching a balance. Developers lean on it hard: 39 of them ran 100M+ tokens each in our first 4 weeks.
Different trade-offs. dl.new is for people who want a known number: a fixed weekly token allowance on DeepSeek and Kimi, a free tier with no card, plans from $7, and a one-line install that sets up your coding agent for you. OpenCode Go ($10/mo) runs a dollar budget across 25+ models, with 5-hour caps, and gives the most usage per dollar.
Setup: Claude Code, OpenCode and Cline
With dl.new (any agent)
curl -fsSL https://dl.new | sh
dl claude # or: dl opencode, dl codex, dl pi, dl t3
For Cline, Grok Build (formerly Cursor), Zed or any OpenAI SDK, run dl api-key (or open dl.new/keys) and paste the key. The base URLs are https://api.dl.new/v1 (OpenAI-style) and https://api.dl.new/anthropic (Anthropic-style).
Claude Code, direct to DeepSeek
From DeepSeek's Claude Code guide:
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=your-deepseek-api-key
export ANTHROPIC_MODEL="deepseek-flash[1m]"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-flash[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-flash[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
claude
Run /model inside the session to confirm, then check that requests show up in your DeepSeek dashboard. For Kimi in Claude Code, Kimi Code publishes an Anthropic-compatible base URL (https://api.kimi.ai/coding/) for members; set it as ANTHROPIC_BASE_URL with your Kimi Code key.
OpenCode
Run /connect, choose a provider and enter its credentials, then /models to pick a model. OpenRouter works with an OPENROUTER_API_KEY. For a provider OpenCode doesn't list, add a custom OpenAI-compatible provider in opencode.json with the vendor's base URL (Moonshot's is https://api.moonshot.ai/v1) and model ID.
Cline
Open Cline's settings, set API Provider to "OpenAI Compatible", then fill in Base URL, API Key and Model ID (for example https://api.moonshot.ai/v1 and kimi-k3.1-pro). The same three fields work for OpenRouter or a dl.new key.
Which route should you pick?
- You code all day and want a known number every week, both models, no setup: dl.new
- You want one model and full control at list rates: the model maker's API
- You want to sample many models from one balance: OpenRouter
- You want Kimi only, in Moonshot's own tools: a Kimi membership
- You want the most usage per dollar across many models: OpenCode Go
Frequently asked questions
Can I use DeepSeek or Kimi in Claude Code?
Yes. Claude Code reads its endpoint and model from environment variables, so you can point it at any Anthropic-compatible endpoint serving DeepSeek or Kimi. With dl.new you run dl claude and skip the variables.
Is DeepSeek V4.1 Flash good enough for coding agents?
For most agent work (tests, refactors, bug fixes, reading big codebases) it holds up well, and it has a 1M context window. Many developers keep a stronger model for the hardest, most ambiguous tasks.
When should I use Kimi K3.1 instead of DeepSeek?
Use Kimi for multi-step debugging, planning large changes and long-horizon tasks. It always reasons before answering, so it's slower and uses more output tokens per call.
How much does caching matter?
A lot. About 95% of coding-agent input is cached, and cached tokens are billed at a small fraction of the fresh rate. In our example, caching cuts 100M DeepSeek tokens from $30.90 to $2.97 at peak list rates.
Does dl.new cost less per token than buying DeepSeek directly?
No. Per token, it costs about the same. dl.new gives you a flat monthly price with a weekly allowance, both models on one key, and a one-line setup.
What happens when I hit my weekly limit on dl.new?
When your Kimi allowance runs out, requests continue on DeepSeek automatically. There are no overage charges, and allowances reset every week.
Conclusion
Running your agent on open models is one of the most direct ways to change what AI coding costs you. DeepSeek V4.1 Flash covers the high-volume loop, Kimi K3.1 handles the hard problems, and caching does most of the work on the bill. Pay per token if you want control. Use a flat plan if you want the same number every week.
If that's you, pick a plan, run curl -fsSL https://dl.new | sh, then dl claude.