AI agents · OpenClaw · self-hosting · automation

Quick Answer

Cheapest Frontier AI API July 2026: Cost Per Task

Published:

The Short Answer

DeepSeek V4 Flash is the cheapest frontier-class API in late July 2026 at $0.14/$0.28 per MTok (off-peak) — roughly $0.017 per typical task. Among closed models, GPT-5.6 Luna ($1/$6), Gemini 3.6 Flash ($1.50/$7.50), and Grok 4.5 ($2/$6) are the value leaders.

Ranked by Cost Per Task

Task = 30K input + 5K output tokens. Formula: 30×(in/1000) + 5×(out/1000) in cents.

ModelIn/Out ($/MTok)Cost per taskType
DeepSeek V4 Flash$0.14 / $0.28~$0.0056*open
DeepSeek V4 Pro$0.435 / $0.87~$0.017*open
GPT-5.6 Luna$1 / $6~$0.06closed
Gemini 3.6 Flash$1.50 / $7.50~$0.083closed
Grok 4.5$2 / $6~$0.09closed
Gemini 3.5 Flash-Lite$0.30 / $2.50~$0.021closed

*DeepSeek applies a 2x surcharge during peak UTC windows (~01–04 & 06–10 UTC), so budget double at peak.

The Cheapest by Category

  • Absolute cheapest (open) → DeepSeek V4 Flash. MIT-licensed, single-80GB-GPU self-host option, and the lowest per-token API rate of any frontier-class model.
  • Cheapest closed → GPT-5.6 Luna at $1/$6, or Gemini 3.5 Flash-Lite at $0.30/$2.50 for very high-volume, simpler tasks.
  • Cheapest with a huge context → DeepSeek V4 (1M tokens) or Gemini 3.6 Flash, both cheap enough to feed large documents without pain.

Watch the Fine Print

  • Peak pricing: DeepSeek’s headline rate is off-peak only; the peak 2x can flip your ranking if your traffic clusters in UTC mornings.
  • Retirements: Gemini 2.5 Flash-Lite is cheaper still but retires October 16, 2026 — don’t build new integrations on it.
  • Token counts vary: newer tokenizers can inflate effective token counts. Benchmark on your prompts, not the sticker price.

The Real Lever: Routing

Even the cheapest single model isn’t the cheapest architecture. Route: send the easy 80% of requests to DeepSeek V4 Flash or Gemini 3.6 Flash, and escalate only hard requests to a frontier model. Most teams cut spend 5-10x versus running everything on a flagship.

Sources