API AI Guide 2026: Compare AI API Prices and Free Tiers

On this page

Short answer

An AI API (or "api ai", as many people type it) is a paid or free web endpoint that lets your own app send text, images or audio to a hosted model such as GPT, Gemini or Claude and get the answer back as data. You pay per use, mostly per million tokens, so a small project can cost cents while a careless one can cost hundreds of dollars. This guide compares the main text, image and video APIs on price, free tiers and switching cost, with every number checked against the vendor's own page on 25 October 2026.

Illustration of a dark code card sending arrows to an AI node, which feeds a bar chart of usage costs
Concept illustration: your code calls a model through an API and you pay for the tokens it uses.Image: Illustration by Newly Stack (not AI generated).

A quick word on how we work. Newly Stack does not sell API access and no vendor paid to appear here. Prices below come from official pricing pages, the same data that feeds our AI model leaderboard. Where we have not tested something ourselves, we say so.

What an AI API actually is (and what it is not)

An API (application programming interface) is a door one program uses to talk to another. With an AI API, your code sends a request such as "summarise this support ticket" plus a model name, and the provider runs the model on its servers and returns the result. You never download or host the model.

The model behind a text API is usually a large language model; if that term is new, start with what an LLM is. Text models are billed in tokens, small chunks of text (roughly a short word or part of a word). Every request has input tokens (your prompt, instructions and any documents) and output tokens (the answer). Output almost always costs more. On the OpenAI pricing page, GPT-6.1 Sol lists $2 per 1M input tokens and $10 per 1M output tokens, a 5x gap.

Two common confusions are worth clearing up early:

  • A chat subscription is not API access. ChatGPT, Gemini and Claude apps are consumer products. Their APIs are billed separately on developer pricing pages, so a Plus or Pro plan does not cover your app's calls.
  • "Open API AI" usually means OpenAI's API, not open-source models. Open-weight models exist (more on them below), but they are a different thing from the OpenAI platform.

If you only want to use AI yourself rather than build with it, an app is simpler. Our guide on how to use AI day to day covers that side.

AI API prices compared: the main text models

Here is what the major providers list per 1M tokens on their standard tiers. These are short-context prices; several vendors charge more once a prompt passes a size threshold, noted in the right column.

Model (vendor)Input / 1MOutput / 1MCached input / 1MNotes
GPT-6 Astra (OpenAI)$10.00$50.00$1.00Flagship; higher price over 272K input tokens
GPT-6.1 Sol (OpenAI)$2.00$10.00$0.10Mid tier
GPT-6 Luna (OpenAI)$0.10$0.50$0.01Low cost
Gemini 4 Argon (Google)$2.00$10.00$0.10Rises to $4 / $20 on 1 Dec 2026; no free tier
Gemini 3.8 Flash (Google)$0.75$3.75$0.075Free tier available; rises to $1.50 / $7.50 on 1 Jan 2027
Gemini 3.5 Flash-Lite (Google)$0.30$2.50$0.03Free tier available
Claude Opus 5.5 (Anthropic)$4.00$20.00$0.20Upper tier; Claude Fable 5.1 sits above it at $10 / $50
Claude Sonnet 5.5 (Anthropic)$2.00$10.00$0.10Mid tier
Claude Haiku 5.5 (Anthropic)$0.10$0.50$0.01Up to 100K-token prompts; $0.50 / $2.50 above
DeepSeek V4 Pro$1.32$3.96$0.044Peak rate; off-peak is half
DeepSeek V4.1 Flash$0.30$1.20$0.006Peak rate; off-peak is half
Mistral Medium 3.5$1.50$7.50$0.15
Mistral Small 4$0.15$0.60$0.015

Sources: OpenAI, Google, Anthropic, DeepSeek, Mistral, all checked 25 October 2026. Google also charges a separate hourly fee for storing a context cache.

The discounts most people miss

Batch processing (sending jobs that can wait instead of needing an instant answer) cuts the bill in half at three vendors. Anthropic states a "50 percent discount on both input and output tokens" for its Batch API, Google lists "Batch API (50% cost reduction)" on paid tiers, and OpenAI's batch table shows exactly half the standard rates for the GPT-6 family. DeepSeek goes a different way: off-peak hours cost half the peak rate. Its page defines peak as 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday, so every weekend hour is off-peak.

In our view, batch is the most underused lever in AI API budgets. Overnight jobs like tagging a product catalogue or summarising last week's tickets rarely need a reply in two seconds.

Bar chart of API list prices per 1M tokens for 17 models, from GPT-6 Astra (highest output price) to Claude Haiku 5.5 (lowest)
API list prices per 1M tokens for the text models in this guide, as recorded on 2026-10-25. Chart by Newly Stack. Prices change; the live table with sources is on our model leaderboard.Source: each provider's official pricing page, stored with its link and check date in the Newly Stack database.

Free AI APIs: what is actually free in 2026

"Free AI API" is one of the most searched variations of this topic, and the honest answer is: free exists, but it comes with strings.

Google Gemini API free tier. Google's pricing page marks Gemini 3.8 Flash, Gemini 3.5 Flash-Lite, several older Flash models and the open Gemma 4 family as "Free of charge" on the free tier. The flagship Gemini 4 Argon is "not available on the Free tier." The bigger catch is in the same table: for free tier usage, the row "Used to improve our products" says Yes, while on the paid tier it says No. Do not send customer data through a free key. Limits are counted per project in requests per minute, tokens per minute and requests per day, and the daily quota resets at midnight Pacific time, according to the rate limits page.

Screenshot of the Gemini Developer API pricing page showing three tiers: Free with free input and output tokens and content used to improve Google's products, Paid with Batch API at 50% cost reduction and content not used to improve products, and Enterprise
Google's own tier summary: the Free tier lists "Content used to improve our products", the Paid tier says content is not used. That single line is the reason to keep customer data off a free key.Screenshot of ai.google.dev/gemini-api/docs/pricing by Newly Stack, taken 2026-11-11.

OpenRouter free models. OpenRouter is a router: one account and one API key reach many vendors' models. When we pulled its public model list on 25 October 2026, it returned 467 models, 17 of them free variants ending in :free, including a Gemma 4 model. The limits page caps free models at 20 requests per minute and 50 per day if you have bought fewer than 10 credits, rising to 1,000 per day after that.

Screenshot of the OpenRouter rate limits documentation: free model variants ending in :free allow 20 requests per minute and 50 requests per day with less than 10 credits purchased, or 1000 per day with at least 10 credits
OpenRouter's free-model caps depend on how many credits you have ever bought, not on which free model you call.Screenshot of openrouter.ai/docs/api/reference/limits by Newly Stack, taken 2026-11-11.

Starter credits. Some media APIs give a small trial balance instead. Stability AI's pricing page lists 25 free credits for new accounts, worth $0.25 at its rate of $0.01 per credit.

So what is the best free AI API? For text prototyping, Gemini's free tier offers the most capable free models we found on an official page, as long as your data is not sensitive. OpenRouter's free list is better for trying many models quickly, but the free line-up rotates. Check it again before you rely on any one of them. For a wider look beyond developer APIs, see our list of free AI tools.

What a real workload costs: a worked example

Per-token prices are hard to feel. So here is one concrete workload: a support chatbot handling 10,000 conversations a month, each using about 1,500 input tokens and 500 output tokens. That is 15M input and 5M output tokens a month. The formula is simple: input tokens times input price, plus output tokens times output price.

ModelMonthly cost at list price
GPT-6 Luna$4.00
Claude Haiku 5.5$4.00
Mistral Small 4$5.25
DeepSeek V4.1 Flash (off-peak / peak)$5.25 / $10.50
Llama 4 Maverick via OpenRouterabout $6.08
Gemini 3.5 Flash-Lite$17.00
Gemini 3.8 Flash$30.00
DeepSeek V4 Pro (peak)$39.60
Grok 4.7 or Qwen3.8 Max via OpenRouter$60.00
GPT-6.1 Sol, Claude Sonnet 5.5 or Gemini 4 Argon$80.00
Claude Opus 5.5$160.00
GPT-6 Astra$400.00

Calculated by Newly Stack from the list prices above and the OpenRouter model list, before caching or batch discounts.

DeepSeek and Qwen both come from Chinese labs. Our guide to the best Chinese LLM models shows which of their models you can also download and run on your own servers.

The spread is 100x for the same traffic. That is the main lesson: model choice matters far more than vendor choice. Our opinion: it is easy to start on a flagship because the demo looked great, then never test whether a low-cost model would have done the job just as well.

Two things push real bills above this table. First, reasoning models "think" before they answer, and Google's pricing page labels its output column "including thinking tokens", so a hard question can use far more output than the visible reply. Second, long system prompts get resent on every call. Prompt caching helps here: Anthropic lists cache hits on Opus 5.5 and Sonnet 5.5 at 5% of the base input price.

Image and video generator APIs

Media APIs are priced per image or per second, not only per token, which makes them easier to estimate.

Image generator AI APIs. OpenAI's pricing page lists gpt-image-2, and the newer gpt-image-2.5 variants, at $8 per 1M image input tokens and $30 per 1M image output tokens, with half that on Batch. Google sells its image models through the Gemini API. Gemini 3.1 Flash Lite Image has no free tier and costs $30 per 1M image output tokens, which Google's page converts to $0.0336 per 1K image. Black Forest Labs (the FLUX models) says "No subscriptions, no seat fees. Only pay for what you generate", and its pricing page listed FLUX 3 Image at $0.048 per image at 1K resolution when we checked. Stability AI charges per image in credits: Stable Image Core is 3 credits ($0.03) and Stable Image Ultra is 8 credits ($0.08).

AI video generator APIs. Video is where costs climb fastest, because you pay for every second. Hedra's pricing page lists API video generation "from 1.13¢ / second" and avatar and lip-sync "from 2.5¢ / second", billed from a prepaid balance. Several other video tools in our directory, such as Runway, Kling and Pika, list a developer API, but their API rates sit on separate developer pages that change often, so check each tool's page before you budget.

If you are comparing creative tools rather than building, our pages on AI for image generation and AI for video generation rank the apps instead of the APIs.

Open-source AI APIs and OpenAI-compatible endpoints

"Open source AI APIs" usually refers to open-weight models: the vendor publishes the model files, so anyone can host them. Meta's Llama and Google's Gemma are the best-known families, and our explainer on open-source AI covers what the licences allow. You can run them yourself, or call them through a host. Through OpenRouter, Llama 4 Maverick listed $0.1875 per 1M input and $0.6525 per 1M output tokens on 25 October 2026, with a context window of 524,288 tokens.

The bigger practical win is compatibility. Many providers now accept the same request format as OpenAI's SDK:

  • Google says "Gemini models are accessible using the OpenAI libraries" through a base URL at generativelanguage.googleapis.com/v1beta/openai/ (docs).
  • DeepSeek lists an OpenAI-format base URL, https://api.deepseek.com, and an Anthropic-format one.
  • OpenRouter says you can use "the OpenAI SDK pointed at OpenRouter as a drop-in replacement" (quickstart).
Screenshot of the Gemini API OpenAI compatibility page with a Python example that creates an OpenAI client using a Gemini API key and the base URL generativelanguage.googleapis.com/v1beta/openai/
Google's compatibility page: the OpenAI Python client works with Gemini once the API key and base URL are swapped.Screenshot of ai.google.dev/gemini-api/docs/openai by Newly Stack, taken 2026-11-11.

In practice that means a switch is often three changes: base URL, API key and model name. We would still not call it free. Tool calling, caching rules, image input and error formats differ between vendors, and the same prompt can behave differently on another model. Keep a small test set of your own real prompts and rerun it before every switch.

Screenshot of the DeepSeek API Models and Pricing page with a model details table listing the OpenAI format base URL https://api.deepseek.com and the Anthropic format base URL https://api.deepseek.com/anthropic
DeepSeek publishes two base URLs, one in OpenAI format and one in Anthropic format, so either SDK can point at it.Screenshot of api-docs.deepseek.com/quick_start/pricing by Newly Stack, taken 2026-11-11.

One caution on routers: they add a middle layer between you and the model vendor, and the host that serves your request can set its own limits. That is why our leaderboard keeps models reached through a router out of its speed rankings.

How to choose the best AI API for your project

There is no single best AI API. There is a best one for your task, budget and users. This is the order we suggest:

  1. Write down the task in one sentence. "Classify tickets into 8 categories" needs a cheap, fast model. "Draft legal summaries" needs a stronger one. Our pages on AI for coding and AI for automation show which tools fit common jobs.
  2. Start with the cheapest model that might work, then move up only if your test set fails. Going the other way rarely happens in practice.
  3. Check the data terms. Free tiers can use your content for training; paid tiers usually do not. Read the row, not the marketing page.
  4. Estimate with your real token counts, using the formula above, and add headroom for reasoning output.
  5. Test the language your users speak. Price tables say nothing about quality in Bahasa Indonesia, Spanish or anything else.

That last point is why we built NS-ID, our Bahasa Indonesia benchmark. It runs a fixed suite of tasks (summaries, formal writing, translation, local knowledge and instruction following) against models we can reach by API, reruns monthly, and publishes the method. Paid listings on Newly Stack never change scores. If Indonesian users matter to you, check the latest NS-ID run on our benchmarks page before you commit. For a head-to-head on the most common choices, see ChatGPT vs Gemini or how ChatGPT and Claude differ, and for a wider view of vendors from China such as DeepSeek and Qwen, read our guide to Chinese AI models.

Frequently asked questions

What is an AI API?

An AI API is a web endpoint that lets your own software send a prompt, image or audio file to a hosted AI model and get the result back as data. You pay per use, usually per million tokens for text models or per image or second of video for media models, instead of paying for a chat subscription.

Is there a free AI API?

Yes, with limits. On 25 October 2026 Google's Gemini API pricing page listed a free tier for models such as Gemini 3.8 Flash and Gemini 3.5 Flash-Lite, and OpenRouter listed 17 free model variants capped at 20 requests per minute and 50 requests per day for accounts that bought fewer than 10 credits. Google notes that free tier content is used to improve its products, so avoid sending private data there.

What is the cheapest AI API for text?

Among the models we track, GPT-6 Luna and Claude Haiku 5.5 both list $0.10 per 1M input tokens and $0.50 per 1M output tokens (Haiku at that rate only for prompts up to 100,000 tokens). Mistral Small 4 and DeepSeek V4.1 Flash during off-peak hours are close behind. Always check the vendor page, because prices change.

Is the ChatGPT subscription the same as the OpenAI API?

No. The ChatGPT app is a consumer subscription, while the OpenAI API is billed separately per token on the OpenAI developer pricing page. Paying for one does not give you usage of the other.

Can I switch AI API providers without rewriting my code?

Often, yes. Gemini, DeepSeek and OpenRouter all document an OpenAI-compatible endpoint, so in many cases you change the base URL, the API key and the model name. Features like tool calling, caching and image input still differ, so test before switching in production.

Which AI API is best for Bahasa Indonesia?

Price tables do not answer that. Newly Stack runs its own Bahasa Indonesia benchmark (NS-ID) against models it can reach through official APIs and publishes the method and scores on the benchmark page. Check the latest run there before choosing a model for Indonesian users.

Does the Gemini API free tier use my data?

According to Google's pricing page, content sent on the free tier is used to improve Google's products, while content on the paid tier is not. If your requests contain customer data or anything confidential, use a paid key, not a free one.

How many requests do OpenRouter free models allow?

OpenRouter's limits page caps free model variants (IDs ending in :free) at 20 requests per minute. The daily cap is 50 requests if you have bought fewer than 10 credits in total, and 1,000 requests per day once you have bought at least 10 credits.

Sources

Pages we read for this article, with the date we accessed each one.

  1. OpenAI API pricingaccessed October 25, 2026
  2. Gemini Developer API pricingaccessed October 25, 2026
  3. Gemini API rate limitsaccessed October 25, 2026
  4. Gemini API OpenAI compatibilityaccessed October 25, 2026
  5. Anthropic Claude pricingaccessed October 25, 2026
  6. DeepSeek API models and pricingaccessed October 25, 2026
  7. Mistral AI pricingaccessed October 25, 2026
  8. OpenRouter models list (API)accessed October 25, 2026
  9. OpenRouter API rate limitsaccessed October 25, 2026
  10. OpenRouter quickstartaccessed October 25, 2026
  11. Black Forest Labs pricingaccessed October 25, 2026
  12. Stability AI platform pricingaccessed October 25, 2026
  13. Hedra pricingaccessed October 25, 2026