---
title: "APIs and pricing"
type: "topic"
url: "https://aifordevs.org/topics/apis"
markdown: "https://aifordevs.org/topics/apis.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/topics/apis"
---

# APIs and pricing

The surface you actually code against. Price per million tokens, rate limits, structured outputs, tool calling, and the SDKs that wrap them.

## Articles

- [Claude API pricing: caching, batch, and real bills](https://aifordevs.org/articles/claude-api-pricing.md): Claude API pricing for every current model as of November 8, 2026, with cache break-even math, batch stacking, tool fees, and a tested cost calculator. (2026-11-08)
- [Gemini API pricing: free tier, caching, and real bills](https://aifordevs.org/articles/gemini-api-pricing.md): Gemini API pricing for every current model as of November 8, 2026: free versus paid, cache storage math, batch, grounding, thinking, and a tested calculator. (2026-11-08)
- [KV cache explained: what it stores and what it costs](https://aifordevs.org/articles/kv-cache-explained.md): A KV cache holds attention keys and values during LLM decode. Size one from config.json, see what concurrency costs, and how prompt caching reuses it. (2026-11-08)

## Glossary terms

- [AI gateway](https://aifordevs.org/glossary/ai-gateway.md): An AI gateway is a proxy between your application and one or more model providers that gives you one API for many models. It also adds routing, fallbacks, caching, rate limits, cost tracking, and logging in one place.
- [Batch API](https://aifordevs.org/glossary/batch-api.md): A batch API is an asynchronous endpoint that takes many model requests at once, processes them within a time window, and bills them at a discount. You give up immediate responses in exchange for a lower price.
- [Constrained decoding](https://aifordevs.org/glossary/constrained-decoding.md): Constrained decoding is generation in which tokens that would break a grammar or schema are masked at each step before sampling. The output follows the grammar by construction, unless generation stops early.
- [Prompt caching](https://aifordevs.org/glossary/prompt-caching.md): Prompt caching is a hosted API feature that reuses the processed state of a repeated prompt prefix, such as a long system prompt or a document, across calls. Providers that offer it bill cached input tokens at a discount and return the first token sooner.
- [Structured outputs](https://aifordevs.org/glossary/structured-outputs.md): Structured outputs is an API feature that constrains a model's output to match a JSON Schema you supply, so successful responses parse against your schema. It is usually implemented with constrained decoding, which masks tokens that would break the schema.
- [Token](https://aifordevs.org/glossary/token.md): A token is the unit of text a model takes in and generates: a word, part of a word, a symbol, or a byte sequence, depending on the tokenizer. Context limits, speed, and API prices are all counted in tokens.
- [Tool calling](https://aifordevs.org/glossary/tool-calling.md): Tool calling is a model returning a structured request to run a function you defined, with arguments, instead of plain text. Your code runs the function and sends the result back, which is how an agent loop reaches systems outside the model.

## Platforms

- [OpenAI API](https://aifordevs.org/platforms/openai-api.md): GPT and reasoning models with the Responses API, tool calling, structured outputs, and realtime audio.
- [Claude API](https://aifordevs.org/platforms/anthropic-api.md): Claude models through the Messages API, with tool use, prompt caching, and batch processing.
- [Gemini API](https://aifordevs.org/platforms/gemini-api.md): Gemini models for text, image, audio, and video input, available through Google AI Studio and Vertex AI.
- [Mistral AI](https://aifordevs.org/platforms/mistral.md): Hosted API for Mistral's models, several of which are also released as open weights.
- [DeepSeek API](https://aifordevs.org/platforms/deepseek-api.md): OpenAI-compatible API for DeepSeek's chat and reasoning models, which are also published as open weights.
- [xAI API](https://aifordevs.org/platforms/xai-api.md): Grok models through an API that is compatible with the OpenAI and Anthropic SDKs.
- [Amazon Bedrock](https://aifordevs.org/platforms/amazon-bedrock.md): Managed access to models from several labs inside your AWS account, with IAM, VPC, and guardrails.
- [Vertex AI](https://aifordevs.org/platforms/vertex-ai.md): Google Cloud's platform for Gemini and third-party models, with tuning, evaluation, and agent tooling.
- [Bifrost](https://aifordevs.org/platforms/bifrost.md): Open-source AI gateway written in Go, with one API for many providers plus failover, caching, and governance.
- [LiteLLM](https://aifordevs.org/platforms/litellm.md): Python SDK and proxy server that call many providers through the OpenAI format.
- [Cloudflare AI Gateway](https://aifordevs.org/platforms/cloudflare-ai-gateway.md): Managed gateway on Cloudflare's network with caching, rate limiting, retries, and analytics.
