Best AI model API for apps and agents
Updated · What changed: Added GPT-6.1 Terra (Oct 26, 2026) at $1 in and $5 out, half the price of GPT-6.1 Sol, with a note on when it fits. Routing recommendation unchanged.
By The AI Loadout editors · How we pick
For most apps, start with a mid-priced model such as Claude Sonnet 5.5 or GPT-6.1 Sol at $2 in and $10 out per million tokens, then route easy calls to a cheap model like GPT-6 Luna or Claude Haiku 5.5 at $0.10 in and $0.50 out. Reach for GPT-6 Astra or Claude Fable 5.1 ($10 in, $50 out) only for the hardest reasoning. Open-weight APIs such as DeepSeek V4 Pro, GLM-5.3 and Qwen3.8 Max cost far less for strong coding.
| Slot | Pick |
|---|---|
| Tool | Agent Project Manager pack |
| Model | Claude Sonnet 5.5 |
| Skill | Prompt caching |
| Persona | The API Router |
Free, no signup needed.
Prices in one table: use the AI Price Index & calculator for current figures and source links.
The loadout (why each pick)
Tool: Agent Project Manager pack
Scores each task and routes it to the cheapest model tier that can handle it, so you do not pay frontier prices for easy calls. The tier file lists the models on this page with editable prices.
Model: Claude Sonnet 5.5
A strong default at $2 in and $10 out per million tokens with a 1M-token context window, per Anthropic docs.
Agent skills
- Prompt caching: Every provider here discounts repeated prompt prefixes, often by 90%. Put long system prompts and documents first so they cache.
Bot persona: The API Router
A short system prompt keeps cheap models on task.
Comparison table
| Option | Best for | Model(s) | Price | Free plan | Last checked |
|---|---|---|---|---|---|
| GPT-6 Astra | Hardest reasoning and computer use | OpenAI, 1.05M context | $10 in / $50 out | No | |
| Claude Fable 5.1 | Long-horizon agents | Anthropic, 1M context | $10 in / $50 out | No | |
| GPT-6.1 Terra | Computer use, forms, images and drawings at half the price of GPT-6.1 Sol | OpenAI, 1.05M context | $1 in / $5 out | No | |
| GPT-6 Luna | Cheap extraction and classification | OpenAI, 1.05M context | $0.10 in / $0.50 out | No | |
| Gemini 3.8 Flash | Fast multimodal calls, free tier | Google, 1M context | $0.75 in / $3.75 out (intro) | Yes | |
| Grok 4.7 | Low output price with web and X search | xAI, 500K context | $2 in / $6 out | No | |
| Muse Spark 1.3 | Agentic workflows with audio and video input | Meta, 1M context | $1.25 in / $4.25 out | No | |
| Muse Spark Open | Open weights you can self-host or rent from many hosts | Meta, 1M context | $1.25 in / $4.25 out (Ollama Cloud) | No | |
| Reflection Beam 1.0 | Apache 2.0 open weights for coding agents, cheap on shared hosts | Reflection, 1M context | From $0.25 in / $1.00 out (OpenRouter); free on Ollama Cloud for a limited time | Yes | |
| Elorian Glimpse | Image and video reasoning at a low price | Elorian, 262K context | $0.60 in / $3.00 out | No | |
| Perplexity Decider v1.2 | Classification, routing and yes/no checks that return probabilities | Perplexity, 27B, Apache 2.0 weights | $0.02 in / output free (4B Flash: $0.01 in) | No | |
| Mercury 3 | Fastest replies for agents, voice and chat support | Inception, diffusion LLM, 1M context | $0.10 in / $0.35 out (launch, then $0.20 / $0.70) | No | |
| MiniMax M3.1 Flash | Cheap coding and computer-use agents | MiniMax, 1M context | $0.15 in / $0.60 out | No | |
| Cloudflare Clairic | Typed values from invoices, forms and screenshots | Cloudflare Workers AI, preview | $0.10 in / output free | No | |
| Claude Opus 5.5 fast mode | Up to 2.5x faster output for time-sensitive agents | Anthropic, 1M context | $8 in / $40 out | No | |
| Mistral Large 4 | EU provider, open weights (since Oct 29) | Mistral, 1M context | $0.70 in / $2.10 out | No | |
| DeepSeek V4 Pro | Cheapest strong reasoning, off-peak | DeepSeek, 1M context | $1.32 in / $3.96 out peak, half off-peak | No | |
| Hy4 | Cheap long agent jobs and office work, weights promised soon | Tencent, 1M context | $0.834 in / $2.501 out list, half price on TokenHub through Dec 31 | No | |
| Ripple-65B Preview | Open-weight coding agents, Apache 2.0, up to 1M context | Ricursive, 65B dense | $0.20 in / $0.60 out (OpenRouter) | No | |
| GPT-6 Cyber | Authorized cybersecurity research through Daybreak Red | OpenAI, restricted access | Not published | No | |
| LongCat-2.5 | Cheap long-horizon coding agents with image input | Meituan, 1M context | $0.30 in / $1.20 out (limited-time discount) | No | |
| DeepSeek V4.1 Flash | Low-cost coding agents with vision | DeepSeek, 1M context | $0.30 in / $1.20 out peak, half off-peak | No | |
| Qwen3.8 Max | Engineering-scale coding and vision | Alibaba, 1M context | $2 in / $6 out | No | |
| Kimi K3.1 Pro | Long coding sessions, 3D and game work, open weights on Hugging Face | Moonshot, 1M context | $2 in / $10 out (Highspeed $4 / $20) | No | |
| Kimi K3 | Long-horizon coding, open weights | Moonshot, 1M context | $3 in / $15 out | No | |
| GLM-5.3 | Repository-scale coding agents | Z.ai, 1M context | $1.40 in / $4.40 out | No | |
| Amazon Nova Premier | Teams billing through AWS | Amazon Bedrock | $2.50 in / $12.50 out | No | |
| Cohere Command A+ | Enterprise RAG and translation, self-hostable | Cohere, 128K context | Free on Cohere API (rate limited) | Yes |
Prices come from the linked vendor or source page and can change. Check the vendor before you buy.
Copy this setup
Paste this persona into your tool's custom instructions or project instructions:
You are a precise assistant inside an app. Follow the output format exactly. If the input is missing information you need, return a short error explaining what is missing instead of guessing. Do not add commentary outside the requested format. No em dashes.- Write 20 real test prompts from your app before choosing.
- Run them on one cheap, one mid and one frontier model from the table.
- Use the cheapest model that passes for each task type, and cache long prompts.
- Re-check prices monthly; several of the prices below are launch or intro prices.
Alternatives by situation
- Tight budget: GPT-6 Luna or Claude Haiku 5.5 at $0.10 in and $0.50 out, or DeepSeek V4.1 Flash at $0.15 in off-peak. For agent work, MiniMax M3.1 Flash (Oct 19, 2026) costs $0.15 in and $0.60 out with a 1M-token context, and its weights are now on Hugging Face under a license that is free for non-commercial use.
- Cheap coding agent with vision: LongCat-2.5 from Meituan (Nov 1, 2026) costs $0.30 in and $1.20 out per million tokens at a limited-time discount, with a 1M-token context and image input. Meituan's own runs put it at 64.6% on DeepSWE v1.1 and 38.5 on Terminal Bench v4.0, between Claude Opus 4.8 and Opus 5 on most of its charts. It has OpenAI and Anthropic compatible endpoints, so Claude Code and Codex can point at it. You top up a prepaid balance first. Test it on your own tasks before routing real work there.
- Open-weight coding agent: Kimi K3.1 Pro (Oct 23, 2026) costs $2 in and $10 out, less than Kimi K3, and Moonshot reports 65.7% on Terminal-Bench 4.0, close to its 66.4% figure for Claude Opus 5.5. It speaks the OpenAI and Anthropic API formats, so Codex and Claude Code can point at it. Weights shipped on Hugging Face on Nov 4, 2026 (moonshotai/Kimi-K3.1-Pro) under the Kimi K3.1 Pro License, and Ollama lists a cloud tag (ollama run kimi-k3.1-pro:cloud). Test it on your own tasks before switching.
- Computer use and forms: GPT-6.1 Terra (Oct 26, 2026) costs $1 in and $5 out per million tokens, half of GPT-6.1 Sol, and OpenAI built it for screen work, reading images and technical drawings, and filling forms, such as typing invoice details into accounting software. OpenAI says it matches GPT-6 Astra on its Agents' Last Exam computer-use test at a tenth of the per-token price, and reports 50.3% on Terminal-Bench 4.0 at max effort. OpenAI itself says Sol and Astra are still better for the hardest coding. Prompts over 272K input tokens cost 2x input and 1.5x output, and tool calls need the Responses API.
- Hardest tasks: GPT-6 Astra or Claude Fable 5.1. Both cost $10 in and $50 out, so route only the hard calls there.
- Authorized cybersecurity: OpenAI introduced GPT-6 Cyber on Nov 5, 2026. It is initially available through the API and Codex to a select group of approved Daybreak Red customers for authorized vulnerability research, exploit validation and patch development. OpenAI reports its own benchmark results, including 48.5% on ExploitGym versus 32.1% for GPT-5.6 Cyber, so treat those as vendor figures.
- Open weights and a cheap API: Mistral Large 4 got open weights on Oct 29, 2026 and its API price fell to $0.70 in and $2.10 out per million tokens ($0.07 for cached input). The license is a modified MIT that allows commercial use, except reselling the model as a hosted API needs a separate license. Mistral reports 41% on Terminal-Bench 4.0, its own figure, so test it on your prompts. Reasoning is always on (low, medium or high).
- Data residency: Mistral for an EU provider, Amazon Nova or models on Bedrock to stay inside AWS, or self-host an open-weight model such as Command A+ or GLM-5.3.
- Images and video: Elorian Glimpse, released Oct 16, 2026, reasons over images and video at $0.60 in and $3 out per million tokens. Test it against Gemini 3.8 Flash for counting, chart reading and video captions.
- Classification and routing: Perplexity Decider v1.2 (Oct 16, 2026) answers choice, yes/no and score questions with probabilities instead of text, at $0.02 per million input tokens and no output charge. Several questions about the same input cost about the same as one. Test it against GPT-6 Luna on your own labeled examples.
- Web search for agents: DeepSeek opened its in-house Search and Fetch APIs to all API users on Oct 17, 2026. Each costs $0.75 per 1,000 successful requests, and failed or empty requests are free. Search returns ranked results with summaries written for a model to read; Fetch returns a page as Markdown. Server-side search calls made when you use the DeepSeek API through DeepSeek Harness, Claude Code or Codex are free until Nov 1, 2026 (Beijing time).
- Pulling fields out of documents: Cloudflare Clairic (preview on Workers AI since Oct 19, 2026) takes text or up to four images plus a list of typed fields and returns one value per field, or null when the input does not say, each with a confidence score. $0.10 per million input tokens and no output charge. Cloudflare says long chains of math are not reliable yet, so extract the numbers with Clairic and do the arithmetic in your code.
- Need speed: Claude Opus 5.5 fast mode is generally available as of Oct 15, 2026. Set speed to fast for up to 2.5x higher output tokens per second at $8 in and $40 out per million tokens, twice the standard Opus 5.5 price. For a much cheaper fast model, Inception released Mercury 3 on Oct 19: a diffusion LLM that it clocks at 1,068 tokens per second, at $0.10 in and $0.35 out during its launch sale.
- Long agent sessions on Claude: Message threads went into public beta on the Claude Messages API on Nov 2, 2026 (beta header message-threads-2026-08-12). Add thread: {type: 'create'} to the first request, then send only the new messages with thread: {type: 'continue', previous_message_id} after that. Anthropic says median time to first token drops about 35% on 500K to 1M token requests. It does not cut cost: token usage, prices and rate limits stay the same, so keep prompt caching on. A thread expires 5 minutes after its last request, so keep your own copy of the conversation and resend it when you get a 404.
- Questions about audio: Hume launched its Audio Decision API on Nov 2, 2026. You send an audio file plus plain-language questions (yes/no, choice, score or time span, like Does the caller sound frustrated?) and get probabilities back, without a transcript step. It costs $0.47 per million input tokens (audio, questions and context; answers are free), with 1M trial tokens once you get access. Access is through a waitlist for now.
- Cheap long agent jobs: Tencent released Hy4 on Nov 4, 2026, the full version of Hy4 Preview at the same list price: $0.834 in and $2.501 out per million tokens, with TokenHub charging half of that through Dec 31, 2026. OpenRouter lists it as tencent/hy4 at $0.417 in and $1.25 out with a 1M-token context. New in this version: image input and computer use. Tencent says the weights come in the coming days, so treat the open weights part as a promise until they are posted. The benchmark wins Tencent shows are its own runs, so test it on your 20 prompts before you route traffic to it.
- Open-weight coding agent, Apache 2.0: Ricursive released Ripple-65B Preview on Nov 4, 2026: a 65B dense model trained on 12T tokens with up to a 1M-token context, Apache 2.0 weights on Hugging Face (ricursiveAI/Ripple-65B-Preview). Ricursive reports 80.52 on TerminalBench 2.1 (its own number). It is on Hugging Face, Together, GMI Cloud and OpenRouter as ricursiveai/ripple-65b-preview at $0.20 in and $0.60 out per million tokens with a 1M context. Test it on your 20 prompts before you route traffic to it.
- Zero API cost: Run an open-weight model on your own hardware. See how to run AI locally.
- Web search for your agent: Expand launched Expand Search on Oct 30, 2026, a web search API for agents at $1.50 per 1,000 searches, and failed or empty searches are not charged. It returns ranked URLs with titles and excerpts through an API, a TypeScript SDK, a CLI and an MCP server. The free plan includes 10,000 credits, roughly 6,600 searches. Expand's own benchmarks put it level with Exa and Brave at a lower price per query, so treat those numbers as vendor data.
What changed
- : Added GPT-6 Cyber (OpenAI, Nov 5, 2026) to the comparison table and an authorized cybersecurity situation. Routing recommendation unchanged.
- : Noted Kimi K3.1 Pro weights are live on Hugging Face (Nov 4, 2026) with an Ollama cloud tag, and added Ripple-65B Preview (Ricursive, Apache 2.0, $0.20 in / $0.60 out on OpenRouter) to the table. Routing recommendation unchanged.
- : Added Hy4 (Tencent, Nov 4, 2026, $0.834 in and $2.501 out list, half price on TokenHub through Dec 31) to the table with a situation note. Routing recommendation unchanged.
- : Added situations on Claude message threads (beta, Nov 2, 2026) for faster long agent sessions, and the Hume Audio Decision API for questions about audio. Routing recommendation unchanged.
- : Added LongCat-2.5 (Meituan, Nov 1, 2026) at a limited-time $0.30 in and $1.20 out to the table, with a situation note. Routing recommendation unchanged.
- : Added a situation on Expand Search, a $1.50 per 1,000 web search API for agents (Oct 30, 2026). Routing recommendation unchanged.
- : Mistral Large 4 got open weights on Oct 29, 2026 and a permanent API price of $0.70 in and $2.10 out. Updated the table row, the sale FAQ and added an open weights note. Routing recommendation unchanged.
- : Added GPT-6.1 Terra (OpenAI, released Oct 26, 2026, $1 in and $5 out) to the comparison table with a computer use and forms note. Routing recommendation unchanged.
- : Added Kimi K3.1 Pro (Moonshot, released Oct 23, 2026, $2 in and $10 out) to the comparison table with an open-weight coding agent note, and noted that MiniMax M3.1 Flash weights are on Hugging Face under the MiniMax Community License. Routing recommendation unchanged.
- : Added Mercury 3 (Inception, $0.10 in and $0.35 out at launch), MiniMax M3.1 Flash ($0.15 in, $0.60 out) and Cloudflare Clairic ($0.10 in, output free), all released Oct 19, 2026, plus a document extraction situation. Routing recommendation unchanged.
FAQ
What is the cheapest good AI API?
As of Oct 15, 2026, GPT-6 Luna and Claude Haiku 5.5 both list at $0.10 per million input tokens and $0.50 per million output tokens. Cohere lists Command A+ as free on its API with rate limits.
Which AI API is the most capable?
GPT-6 Astra from OpenAI and Claude Fable 5.1 from Anthropic are each lab's top model, both at $10 in and $50 out per million tokens.
Are open-weight model APIs good enough?
For coding and agents, often yes. DeepSeek V4 Pro, GLM-5.3, Qwen3.8 Max and Kimi K3 are strong and cost less than most closed frontier models. Meta released Muse Spark Open, its open-weight model with a 1M-token context window, on Oct 15, 2026, and Reflection released Beam under Apache 2.0 on Oct 16, with OpenRouter hosts starting at $0.25 in and $1 out.
Why do prices on this page say intro or sale?
Some labs launch at temporary prices. Gemini 3.8 Flash doubles on Jan 1, 2027. Mistral ended its Large 4 launch sale with a permanent cut instead: since Oct 29, 2026 it costs $0.70 in and $2.10 out per million tokens, about half the old list price.
Sources
- Claude docs: Message threads
- Claude: Make long-running agents faster with message threads
- Hume: Introducing the Audio Decision API (Nov 2, 2026)
- Hume docs: Audio Decisions billing
- LongCat: Introducing LongCat-2.5 (Nov 1, 2026)
- LongCat API pricing
- OpenAI API models
- OpenAI: GPT-6.1 Terra model page
- OpenAI: Introducing GPT-6.1 Terra (Oct 26, 2026)
- Anthropic models overview
- Gemini API pricing
- xAI: Grok 4.7
- DeepSeek API pricing
- Amazon Bedrock pricing
- Cohere pricing
- Claude docs: fast mode
- Claude Platform release notes (Oct 15, 2026)
- Meta: Introducing Muse Spark Open (Oct 15, 2026)
- Ollama: Muse Spark Open (cloud)
- Reflection: Beam is now available (Oct 16, 2026)
- OpenRouter: Beam 1.0 providers and prices
- Elorian: Introducing Glimpse (Oct 16, 2026)
- DeepSeek API change log (Oct 17, 2026)
- Perplexity API changelog: Decider v1.2
- Hugging Face: pplx-decider-v1.2 model card
- DeepSeek API docs: Search and Fetch
- Inception: Introducing Mercury 3 (Oct 19, 2026)
- Inception docs: models and prices
- Mistral: Large 4 open weights and new pricing (Oct 29, 2026)
- Hugging Face: Mistral Large 4 weights, GGUFs and license
- MiniMax: M3.1 Flash (Oct 19, 2026)
- Cloudflare changelog: Clairic on Workers AI (Oct 19, 2026)
- Kimi API Platform: K3.1 Pro pricing
- Kimi docs: K3.1 Pro quickstart
- Hugging Face: MiniMax M3.1 Flash weights and license
- Expand: Expand Search is here
- Expand pricing
- Tencent: Hy4 launch (Nov 4, 2026)
- Tencent Cloud TokenHub: Hy4 pricing
- OpenRouter: Tencent Hy4
- Hugging Face: moonshotai/Kimi-K3.1-Pro
- Ollama: kimi-k3.1-pro (cloud)
- Ricursive: Ripple-65B Preview
- Hugging Face: ricursiveAI/Ripple-65B-Preview
- OpenRouter: Ripple-65B Preview
- OpenAI: GPT-6 Cyber (Nov 5, 2026)
Disclosure: links marked "affiliate" may earn us a commission, and sponsored slots are always labeled. Neither affects our picks. Read our methodology.
Related setups
Related skills and personas
Agent skills and bot personas that pair well with choosing an AI model API for an app or agent.
Sentry Error Monitoring MCP Server
Retrieve real-time production exception stack traces, error frequency, and breadcrumbs.
NVIDIA SkillSpector
Free scanner that checks an agent skill or MCP server for prompt injection, data theft, risky code and supply-chain problems before you install it.
Linear Project Management MCP Server
Search project tickets, create issues, update cycle milestones, and link commits to Linear.
Technical Programmatic SEO Optimizer
JSON-LD schema generation, Open Graph tags, canonical URLs, and Core Web Vitals checks.
The Working-Backwards Founder
Start from the customer, write the launch announcement first, then build only what it promises.
The Pragmatic Staff Engineer
High standards, zero bloat, resilient architecture, and concise reasoning.