Skip to content

Cheapest AI Coding API in 2026: DeepSeek, GLM, Kimi, MiniMax

The cheapest AI coding APIs in 2026 compared: DeepSeek, GLM, Kimi, MiniMax, MiMo, and OpenRouter routes. Pricing links, pay-per-token vs plans, and how to pick.

MGMCSA Guru Team July 21, 2026 7 min read
The cheapest AI coding APIs of 2026 compared side by side

If you’re optimizing purely for cost, 2026 is a great year — a cluster of capable models compete to be the cheapest way to drive a coding agent. But “cheapest” splits three ways: lowest pay-per-token rate, lowest flat plan, and best price once context/caching are included. This compares the main options with the actual rates you need before spending money.

For setup, follow the per-model guides linked throughout. For the billing-model decision, see coding plans vs pay-per-token.

The price snapshot below was checked against official provider pages on June 9, 2026.

The contenders

Cheapest coding API snapshot

DeepSeek V4 Flash $0.0028 hit / $0.14 miss / $0.28 output per 1M; 1M context; Anthropic endpoint
Xiaomi MiMo V2.5 $0.0028 hit / $0.14 miss / $0.28 output per 1M overseas PAYG
Z.AI GLM GLM-4.7-Flash and GLM-4.5-Flash listed free; FlashX $0.07 input / $0.01 cached / $0.40 output
Alibaba Qwen Flash qwen3.5-flash International $0.10 input / $0.40 output per 1M up to 1M tokens
MiniMax M3 $0.30 input / $1.20 output / $0.06 cache read per 1M up to 512K
Kimi K2.5 / K2.6 K2.5 is $0.10 hit / $0.60 miss / $3.00 output; K2.6 is $0.16 / $0.95 / $4.00
OpenRouter Free or cheap routed models; convenient but availability changes

Pricing links

Where to verify the cheapest routes

7 providers

#1 PAYG baseline

DeepSeek

deepseek-v4-flash is $0.0028 cache-hit input, $0.14 cache-miss input, and $0.28 output per 1M tokens. deepseek-v4-pro is $0.003625 / $0.435 / $0.87, with 1M context and an Anthropic-format endpoint.

Why it is on the list: It is the cleanest cheap direct route for Claude Code-style tools because the Anthropic endpoint avoids an extra proxy.

#2 Plan + PAYG

Z.AI GLM

GLM-4.7-Flash and GLM-4.5-Flash are listed free. GLM-4.7-FlashX is $0.07 input, $0.01 cached input, and $0.40 output per 1M. GLM-5.1 is $1.40 / $0.26 / $4.40.

Why it is on the list: It is on the list because it combines free/very cheap Flash rows with the GLM Coding Plan for heavier coding-tool use.

#3 Qwen + plan

Alibaba Qwen

qwen3.5-flash International is $0.10 input and $0.40 output per 1M up to 1M tokens. The Coding Plan Pro is $50/month with 6,000 requests per 5 hours, 45,000/week, and 90,000/month.

Why it is on the list: It belongs because Qwen Flash is cheap as API usage, while the coding plan is a serious flat-rate route for heavy Qwen-Coder workflows.

#4 Agent models

MiniMax

MiniMax-M3 standard PAYG is $0.30 input, $1.20 output, and $0.06 cache read per 1M tokens up to 512K input. Token Plan tiers are $20, $50, and $120/month.

Why it is on the list: It fits agent-heavy workflows where MiniMax is already the model you prefer and a token plan may beat pure metered usage.

#5 Kimi variants

Kimi / Moonshot

kimi-k2.5 is $0.10 cache-hit input, $0.60 cache-miss input, and $3.00 output per 1M. kimi-k2.6 is $0.16 / $0.95 / $4.00, with a 262,144-token context window.

Why it is on the list: It is not the cheapest baseline, but it is a strong reasoning PAYG option when harder agent tasks justify the higher output rate.

#6 Long context

Xiaomi MiMo

mimo-v2.5 overseas PAYG is $0.0028 cache-hit input, $0.14 cache-miss input, and $0.28 output per 1M. mimo-v2.5-pro is $0.0036 / $0.435 / $0.87.

Why it is on the list: It now sits in the same ultra-low price band as DeepSeek Flash while also offering token-plan discounts for heavier usage.

#7 Free / routed

OpenRouter

Free and ultra-cheap routed models, with availability and rate-limit caveats.

Why it is on the list: It is the easiest place to find no-cash backup models or cheap routes while you compare direct providers.

Cheapest pay-per-token

For pure pay-per-token cost, DeepSeek V4 Flash and Xiaomi MiMo V2.5 are the lowest rows in this snapshot: $0.0028 cache-hit input, $0.14 cache-miss input, and $0.28 output per 1M tokens. DeepSeek has the simpler Claude Code path because it publishes an Anthropic-compatible base URL. MiMo is equally low on the listed overseas PAYG rates and also has an Anthropic API page for tool integrations.

For hosted free or nearly free rows, Z.AI is the next stop: GLM-4.7-Flash and GLM-4.5-Flash are listed free, and GLM-4.7-FlashX is $0.07 input / $0.01 cached input / $0.40 output per 1M. For Qwen, Alibaba’s qwen3.5-flash International row is $0.10 input / $0.40 output per 1M up to 1M tokens.

Cheapest flat-rate

For heavy daily use, a flat or quota plan can beat metered tokens. GLM’s Coding Plan starts at $18/month and is the cheapest subscription entry here. Alibaba’s Coding Plan Pro is $50/month with 6,000 requests per 5 hours, 45,000 per week, and 90,000 per month. MiniMax Token Plan gives another quota route at $20 / $50 / $120 per month.

That makes the order simple: use PAYG while your usage is light, move to GLM when you want the lowest flat plan, and compare Alibaba or MiniMax when you are making heavy daily agent calls. See GLM Coding Plan setup and Alibaba Coding Plan vs pay-per-token.

Cheapest for big context

If you feed large chunks of a repo into the model, watch four details, not just the headline rate: context length, cache-hit price, output price, and whether a token plan resets or throttles. DeepSeek lists 1M context plus very low cache-hit pricing. Kimi lists 262,144-token context on K2.5 and K2.6, but higher output prices. MiMo’s V2.5 PAYG rates match DeepSeek’s low price band, while its token-plan page advertises off-peak and renewal discounts.

The levers that cut any bill

Whatever you pick, these keep costs at the floor:

  • Default cheap, escalate rarely — use the cheapest model for everyday work; reserve a stronger one for hard tasks.
  • Exploit cache discounts — agent sessions resend context; cache hits cut that automatically.
  • Use off-peak windows — MiMo advertises 20% off off-peak token-plan calls, and Z.AI charges advanced GLM models differently in peak and off-peak windows.
  • Keep prompts focused — output tokens cost more than input; concise requests cost less.
  • Route by taskClaude Code Router sends background work to the cheapest model and hard work to a stronger one.

The bottom line

  • Lowest cost, light use: Start with DeepSeek V4 Flash or MiMo V2.5 PAYG.
  • Lowest cost, free hosted rows: Check Z.AI’s GLM Flash rows and OpenRouter’s free-model filter.
  • Lowest cost, heavy use: Compare GLM Coding Plan, Alibaba Coding Plan, and MiniMax Token Plan.
  • Lowest cost, big context: Compare DeepSeek cache/context, Kimi variant pricing, Qwen context pricing, and MiMo token-plan math.
  • Lowest cost, free/backup: Check OpenRouter’s free-model filter.

A safe default for most people: DeepSeek pay-per-token, switching to a plan only once usage is consistently heavy enough to justify it.

Getting the cheapest setup

  • Estimate your monthly token volume
  • Light/bursty → DeepSeek or MiMo PAYG first
  • Heavy/daily → compare GLM, Alibaba, and MiniMax plans
  • Big context → compare cache/context/plan math, not just headline rate
  • Open the official pricing page before buying credits or subscribing

Wrapping up

The cheapest AI coding API in 2026 depends on how you pay. DeepSeek V4 Flash and MiMo V2.5 are the lowest PAYG baselines in this snapshot; Z.AI has free and very cheap Flash rows; GLM and Alibaba are the first coding-plan routes to compare; MiniMax and Kimi can make sense depending on agent workload, context, caching, and output volume. Across all of them, defaulting to a cheap model, exploiting discounts, and routing by task keep your bill at the floor.

For the decision framework, see coding plans vs pay-per-token; for the model head-to-head, MiniMax vs DeepSeek vs GLM.

Frequently asked questions

What's the cheapest AI coding API in 2026?

DeepSeek V4 Flash and Xiaomi MiMo V2.5 are the lowest pay-per-token baselines in this snapshot at $0.14 cache-miss input and $0.28 output per 1M tokens, with tiny cache-hit input rates. Z.AI also lists free GLM Flash rows and very cheap FlashX pricing. For flat-rate heavy use, compare GLM's Coding Plan and Alibaba's $50 Coding Plan.

Is pay-per-token or a coding plan cheaper?

Pay-per-token is cheaper for light or bursty use; a flat coding plan is cheaper for heavy daily use. The crossover is roughly where your monthly token spend would exceed the plan price. Estimate from a real week of usage.

Do cheaper models mean worse code?

Not dramatically. The top cheap models handle most everyday coding well; the gap to frontier models shows mainly on the hardest reasoning and longest context. For typical work, the cost saving far outweighs the small quality difference.

Which is cheapest for big-context work?

Do not assume the cheapest general model is cheapest for big context. Compare the provider's current context length, cache-hit price, long-context rules, and token-plan rules. DeepSeek, Kimi, MiMo, and Qwen all publish different structures, so verify the live page before a big-repo workflow.

How do I keep costs lowest whatever I pick?

Default to a cheap model and escalate only hard tasks, exploit cache-hit discounts and off-peak windows, keep prompts focused to limit output tokens, and route background work to the cheapest model with a tool like Claude Code Router.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.