Skip to content
StackShip
Our pickReviewed

Cheapest LLM API for building apps

The OpenAI API is our pick: gpt-6-luna is the best cheap current-gen model at $0.10/$0.50 per 1M tokens. gpt-5-nano is the absolute floor at $0.05/$0.40.

Editorial picks

#1 pickVerified

OpenAI API

gpt-6-luna is a current-generation model at $0.10 per 1M input ($0.01 cached) and $0.50 per 1M output, at the same rate for prompts up to 272K tokens. If you need the absolute floor, gpt-5-nano is $0.05 / $0.40. For most apps luna is the better default, because it is OpenAI's current generation while nano belongs to the older GPT-5 family. Move up to gpt-6.1-sol ($2 / $10) only for the features that need it.

Alternative 1Verified

Anthropic API

Claude Haiku 5.5 matches gpt-6-luna at $0.10 / $0.50 per 1M tokens for prompts up to 100K tokens, but rises to $0.50 / $2.50 above that. A good fit if your app already uses Claude for harder tasks.

Alternative 2Verified

OpenRouter

One key and one bill for models from many providers, charged at each provider's list price. You pay a 5.5% fee when you buy credits, and free models are there for prototyping.

Free tierUsage-basedVisit OpenRouter ↗
Free pickVerified

Google Gemini API

A free tier on Gemini Flash and Flash-Lite models for prototyping. On paid usage, gemini-2.5-flash-lite is $0.10 per 1M input and $0.40 per 1M output tokens.

Free tierUsage-basedVisit Google Gemini API ↗

Editorial picks are never paid for. How we make money.

How we picked

  • Price per million input and output tokens
  • Good enough for everyday app features
  • No surprise surcharges on normal prompt sizes
  • Easy to switch models later

Prices are checked against each vendor's official pricing page. Our methodology.

When to switch

  • Your app sends the same long prompt again and again

    → Move to DeepSeek API. DeepSeek's cache-hit input is $0.006 per 1M tokens at peak and $0.003 off-peak.

FAQ

What do 1,000 chats cost?

Assume each chat sends 1,000 input tokens and gets 500 output tokens back, so 1,000 chats = 1M input + 0.5M output tokens. gpt-6-luna: 1 x $0.10 + 0.5 x $0.50 = $0.35. Claude Haiku 5.5: 1 x $0.10 + 0.5 x $0.50 = $0.35. gemini-2.5-flash-lite: 1 x $0.10 + 0.5 x $0.40 = $0.30. gpt-5-nano: 1 x $0.05 + 0.5 x $0.40 = $0.25. DeepSeek Flash: 1 x $0.30 + 0.5 x $1.20 = $0.90 at peak, $0.45 off-peak. For comparison, Claude Sonnet 5.5 or gpt-6.1-sol: 1 x $2 + 0.5 x $10 = $7.00. Standard list prices, before caching, batch discounts or OpenRouter's credit fee.

Is DeepSeek the cheapest LLM API?

Not on fresh prompts. DeepSeek Flash (served by V4.1 Flash) is $0.30 per 1M input and $1.20 per 1M output at peak, and half that off-peak, which is more than gpt-6-luna or Claude Haiku 5.5. It gets very cheap when your prompts repeat: cache-hit input is $0.006 per 1M at peak and $0.003 off-peak. Peak hours are 01:00-04:00 and 06:00-10:00 UTC on weekdays.

Is there a free LLM API?

The Gemini API has a free tier on its Flash and Flash-Lite models. OpenRouter has free models capped at 20 requests per minute and 50 per day, rising to 1,000 per day once you've bought at least $10 of credits. For no API bill at all, run open models on your own machine with Ollama.

When should I use OpenRouter instead of going direct?

When you want to try or switch between models from several providers with one key and one bill. OpenRouter charges the provider's list price and takes a 5.5% fee when you buy credits. If you've settled on one model, going direct to that provider skips the fee.

Do cheap models cost more with long prompts?

Some do. Claude Haiku 5.5 rises from $0.10 / $0.50 to $0.50 / $2.50 per 1M tokens for prompts over 100K tokens. OpenAI's gpt-6-luna rises to $0.20 / $0.75 above 272K tokens. Keep prompts short and you stay on the low rate.

How can I cut the bill further?

Use the batch APIs for work that doesn't need an instant answer: Anthropic and OpenAI both list batch at half price (gpt-6-luna is $0.05 / $0.25 in batch). Cache repeated prompts: cached input is $0.01 per 1M on both gpt-6-luna and Claude Haiku 5.5. Then use the stack cost calculator to see what your AI usage adds to your monthly bill.