Cost-effective AI models: LLM API pricing comparison
Cost-effective here means the list price per million input and output tokens, weighed against context length, open weights, and what you need the model to do — not a single “best” score.
This table uses each vendor’s published API rates. DeepSeek peak prices for deepseek-flash are $0.30 input and $1.20 output per 1M tokens (cache-hit input $0.006); off-peak is half.
Smaller open models on inference hosts can list lower per-token prices than frontier APIs; DeepSeek’s case is strong capability per dollar, 1M context on Flash, and off-peak discounts — not the lowest token price in the market.
Official sources
What “cost-effective” means here
We compare published list prices per million tokens (input, output, and cache-hit input when the vendor publishes it) against context length and whether weights are open. This is an unofficial directory; verify numbers on the linked pricing pages before you budget.
API price comparison table
USD unless noted as CNY (¥). Rows without a cache column value mean the provider did not list a cache-hit input price on the cited page.
| Model | In / M | Out / M | Cache in / M | Context | Open weights | Source |
|---|---|---|---|---|---|---|
DeepSeek-V4.1-Flash (API: deepseek-flash) Peak cache-miss input; off-peak is half. | $0.30 | $1.20 | $0.006 | 1M | Yes | DeepSeek Models & Pricing |
DeepSeek-V4-Pro-0813 (API: deepseek-v4-pro) Peak cache-miss input; off-peak is half. | $1.32 | $3.96 | $0.044 | 1M | Yes | DeepSeek Models & Pricing |
gpt-4.1-mini Standard tier. | $0.40 | $1.60 | $0.10 | 1M | No | OpenAI API pricing |
o3 Standard tier. | $2.00 | $8.00 | $0.50 | 200K | No | OpenAI o3 model page |
Claude Sonnet 5.5 | $2.00 | $10.0 | $0.10 | 1M | No | Anthropic API pricing |
Claude Haiku 5.5 (prompts up to 100K tokens) Higher input/output rates apply above 100K prompt tokens. | $0.10 | $0.50 | $0.010 | 1M | No | Anthropic API pricing |
gemini-3.8-flash Paid tier, standard; listed through 31 Dec 2026 on the pricing page. | $0.75 | $3.75 | $0.075 | 1M | No | Gemini API pricing |
qwen3.8-flash (Singapore, international) Context cache billed separately; see Alibaba Context Cache doc. | $0.15 | $0.47 | — | 1M | Yes | Model Studio billing |
Mistral Small 4 | $0.15 | $0.60 | $0.015 | 1M | Yes | Mistral API pricing |
Codestral | $0.30 | $0.90 | $0.030 | 256K | No | Mistral API pricing |
GLM-5.3 | ¥8.00 | ¥28.0 | ¥2.00 | 1M | No | Zhipu API pricing |
kimi-k3 | ¥20.0 | ¥100.0 | ¥2.00 | 1M | No | Kimi API pricing |
kimi-k2.7-code | ¥6.50 | ¥27.0 | ¥1.30 | 256K | No | Kimi API pricing |
openai/gpt-oss-20b | $0.075 | $0.30 | — | 131K | Yes | Groq supported models |
Meta-Llama-3.1-8B-Instruct-Turbo Hosted open weights; per DeepInfra list price. | $0.020 | $0.040 | — | 128K | Yes | DeepInfra pricing |
By use case (list price only)
Coding and agents
Models tagged for coding on this page include DeepSeek-V4.1-Flash (API: deepseek-flash); gpt-4.1-mini; Claude Sonnet 5.5; Claude Haiku 5.5 (prompts up to 100K tokens); gemini-3.8-flash; Mistral Small 4; Codestral; kimi-k2.7-code; openai/gpt-oss-20b; Meta-Llama-3.1-8B-Instruct-Turbo. Lower output $/M on the table can reduce spend for high-volume codegen, but tool-use quality is not priced in tokens — run your own evals.
One-million-token context
Rows with 1M context include DeepSeek-V4.1-Flash (API: deepseek-flash); DeepSeek-V4-Pro-0813 (API: deepseek-v4-pro); Claude Sonnet 5.5; gemini-3.8-flash; qwen3.8-flash (Singapore, international); GLM-5.3; kimi-k3. Long-context requests bill for all input tokens; a cheap $/M rate still adds up over hundreds of thousands of tokens.
Reasoning-heavy workloads
Reasoning-oriented list prices on this page include DeepSeek-V4-Pro-0813 (API: deepseek-v4-pro); o3; Claude Sonnet 5.5; GLM-5.3; kimi-k3. Thinking or chain-of-thought output can exceed simple chat token counts; check each vendor’s billing notes for thinking tokens.
Worked example (USD rows)
Assume 1,000 API calls, each with 2,000 input tokens and 500 output tokens, using cache-miss input rates from the table (no caching).
| Model | Est. total (USD) |
|---|---|
| DeepSeek-V4.1-Flash (API: deepseek-flash) | $1.20 |
| DeepSeek-V4-Pro-0813 (API: deepseek-v4-pro) | $4.62 |
| gpt-4.1-mini | $1.60 |
| o3 | $8.00 |
| Claude Sonnet 5.5 | $9.00 |
| Claude Haiku 5.5 (prompts up to 100K tokens) | $0.45 |
Where DeepSeek fits
DeepSeek is not always the lowest per-token API on the market — hosted small open models such as Meta-Llama-3.1-8B-Instruct-Turbo on DeepInfra publish lower list rates in our table. DeepSeek's documented advantages are comparatively low peak prices for a frontier-class Flash line, 50% off-peak billing, and deepseek-flash with 1M context on the official pricing page. We do not claim DeepSeek is the "cheapest" or "best" overall without your own benchmarks.
FAQ
It is the balance of list price per million tokens (input, output, and cache hits where published), context window, and whether the model fits your task.
This unofficial guide does not score quality. Compare official prices first, then run your own evals for coding, long context, or reasoning workloads.
Not always. Hosted small open-weight models can publish lower per-token rates than frontier APIs.
List prices vary by provider; coding-oriented rows in our table include DeepSeek Flash, Mistral Codestral, OpenAI gpt-4.1-mini, and Kimi K2.7 Code.
Whenever you ship or at least monthly — vendors change list prices on their pricing pages.