Blog
LLM APIs Compared, Mechanism by Mechanism
Where the big LLM APIs behave differently for a developer, one mechanism at a time: structured output, caching, token counting, limits, batching and retries.
Moving a feature from one LLM API to another rarely fails on the big things. It fails on a keyword a schema does not accept, a cache entry that expires sooner than expected, or a token count that differs from the bill you assumed. The notes here compare how OpenAI, Anthropic and Google Gemini handle one mechanism at a time, so a developer can see where the same-looking feature differs before writing code around it.
Everything is read from the vendors' own documentation, fetched on the date shown under each page's Sources, and every vendor is described by the same yardstick. The pages contain no prices, no model rankings and no benchmark scores. APIs change quickly, so check the live documentation before you depend on a limit or a default, and treat these pages as a map of what each vendor said on the day it was read.
Output and tools
2026-11-20
tool_choice auto vs any vs required: How Claude, OpenAI and Gemini Force or Forbid Tool Calls
In the tool_choice auto vs any debate the names differ per vendor but the four settings match: let the model decide, require a call, force one named tool, or forbid tools. Claude says auto, any, tool and none, OpenAI says auto, required, a forced function and none, Gemini says AUTO, ANY, NONE and VALIDATED. Forcing has side effects on Claude.
Read2026-11-20
Structured Outputs JSON Schema: What OpenAI, Claude and Gemini Accept, Ignore or Reject
Structured outputs JSON Schema support is a subset on all three APIs, and the subsets differ. Claude rejects unsupported keywords with a 400 error, Gemini accepts several length and uniqueness keywords and ignores them, and OpenAI lists what it does not yet support and requires every field to be required. A schema moved between vendors needs a check.
Read2026-11-20
finish_reason, stop_reason and finishReason: What Each Value Means and What Your Code Should Do
A finish_reason value is the only place an LLM API tells you why generation ended, and the three vendors name it differently: OpenAI finish_reason, Claude stop_reason, Gemini finishReason. Branch your handler on the situation, not the vendor word: cut off, tool wanted, refused, filtered, or clean end. Each API signals those situations with different values.
ReadTokens and limits
2026-11-20
Reasoning Tokens vs Output Tokens: How OpenAI, Claude and Gemini Count Hidden Thinking
Reasoning tokens vs output tokens is a bookkeeping question with a practical bite: on OpenAI, Claude and Gemini the hidden thinking is billed like output and also uses up the max-token cap, so a small cap can return an empty answer you still pay for. Where the thinking count appears in usage differs on each API.
Read2026-11-20
Prompt Caching TTL: How Long OpenAI, Claude and Gemini Keep Your Prefix
The prompt caching TTL differs by API. Claude keeps an entry 5 minutes and extends it on every read, OpenAI's newest models keep one at least 30 minutes, and Gemini's explicit caches last 1 hour unless you set another TTL. A miss usually comes from a changed prefix or a prompt below the minimum size, not from the clock alone.
ReadBatching and reliability
2026-11-20
OpenAI Python SDK Retry Defaults, Compared With the Anthropic and Google Gen AI SDKs
The OpenAI Python SDK retries certain errors twice by default with exponential backoff, and requests time out after 10 minutes. The Anthropic SDK uses the same two numbers. The Google Gen AI SDK counts attempts including the first request, uses milliseconds for timeouts and documents a default of 5 attempts. Copying one config to another changes the request count.
Read2026-11-20
OpenAI Batch API Limits Compared With Claude and Gemini: Sizes, Windows and How Long Results Last
OpenAI Batch API limits are 50,000 requests and a 200 MB input file per batch. Claude allows 100,000 requests or 256 MB, whichever comes first, and Gemini accepts an input file of up to 2 GB. The windows differ as well: OpenAI and Claude expire a batch after 24 hours, Gemini after 48, and results are kept for 29 or 30 days on two of the three.
ReadNext step
Have a project in mind?
Tell me about it. A discovery call within 48 hours.