Skip to content

OpenAI model behaviour

How OpenAI's models and API actually behave at the edges: context and output limits, caching thresholds, streaming event shapes, and the parameters whose documented meaning differs from the obvious reading.

The OpenAI API is easy to start with and surprising to operate. Most of the surprises are not bugs; they are documented behaviours whose obvious reading is wrong. max_tokens is not a length target, it is a guillotine. seed does not buy determinism, it buys an attempt at it. A context window is not a budget for your prompt, it is a budget your prompt shares with an answer — and, on the reasoning models, with thinking you are billed for and never see.

These pages take one such edge each and explain the mechanism behind it, with the figure sourced to OpenAI’s own reference and dated where it is expected to move. They are written for the moment you are staring at a truncated JSON object, a bill that is four times the length of the answer, or a streaming chunk with a field you did not expect — and want to know why, not just what to type instead.

GPT-4o's Context Window: What 128K Actually Buys You

The documented 128,000-token window, what share of it your prompt can really use, and how many pages of English that works out to when you show the ratio.

8 min read

GPT-4o's Max Output Tokens, and What Happens When You Hit It

The documented per-response cap on GPT-4o, why max_completion_tokens replaced max_tokens, and exactly what a response truncated mid-JSON looks like.

8 min read

o1's Context Window and the Reasoning Tokens Eating Into It

How o1's 200,000-token window is divided between prompt, invisible reasoning and visible answer, and why a large max_completion_tokens is a requirement rather than a precaution.

9 min read

The Developer Role in the OpenAI API, and How It Differs From System

Why OpenAI renamed the system role to developer for its reasoning models, what the instruction hierarchy means by it, and what actually changes in your request payload.

8 min read

OpenAI's Stop Parameter: Four Sequences, Then What

The documented four-sequence cap on stop, the error envelope a fifth produces, and why the stop string never appears in the text you get back.

8 min read

The Shape of a Parallel Tool Call Response in the OpenAI API

The tool_calls array a model returns when it wants several functions at once, annotated field by field, plus the message sequence you must send back.

9 min read

Strict Mode in OpenAI Function Calling: What It Rejects

The JSON Schema subset strict mode enforces, the three schema shapes it rejects outright, and what the guarantee does and does not cover.

9 min read

The Shape of an OpenAI Streaming Chunk, Delta by Delta

A complete SSE stream read in order, showing where role, content, finish_reason and usage each appear and what a correct accumulator has to handle.

9 min read

The Seed Parameter and What “Mostly Deterministic” Means

Why OpenAI describes seeded sampling as best-effort, what system_fingerprint is for, and the three sources of non-determinism a seed cannot remove.

8 min read

GPT-4o Image Input: Resolution, Tiling and the Token Cost Before You Send

OpenAI's documented resizing and tiling rules for image input, applied to three real image sizes with the arithmetic shown at each step.

9 min read

Audio Input in the GPT-4o Realtime API

The audio formats the Realtime API accepts, how audio is appended to and committed from the input buffer, and which events mark a turn.

9 min read

Reasoning Tokens: Why o1 Bills for Text You Never See

Where reasoning tokens appear in the usage object, how they are priced, and a worked invoice showing why the bill can be ten times the length of the answer.

9 min read

Does o1 Support a System Message? What the Docs Actually Say

Why an o-series request rejects a system role, which snapshots accept the developer role instead, and how to rewrite the message without losing the instruction.

8 min read

OpenAI's Model Deprecation and Shutdown Schedule

What OpenAI's deprecations page actually commits to, the difference between a deprecated model and a shut-down one, and what each state does to a live request.

8 min read

Pinning a Dated OpenAI Model Snapshot Instead of an Alias

How to find out which dated snapshot an alias resolves to, swap it into your requests, and verify the pin held.

9 min read

cl100k_base and o200k_base: Why GPT-4o's Token Counts Changed

What changed between the two tiktoken encodings, why the same string costs a different number of tokens on GPT-4o than on GPT-4, and which of your numbers were computed with the wrong one.

8 min read

How Many Images Fit in a Single GPT-4o Request

The binding constraint on images per request is the context window and the documented per-image token cost, and this page does the arithmetic for both detail settings.

8 min read

logprobs and top_logprobs in the OpenAI API: Which Models Return Them

How the two parameters interact, the exact shape of the logprobs object that comes back, which model families expose it, and how to turn a log probability into a usable confidence number.

8 min read

Structured Outputs in GPT-4o: Strict JSON Schema End to End

A normal JSON Schema next to the strict-mode version of the same schema, with each required transformation explained and the two failure modes that survive strict mode.

9 min read

GPT-4o-mini's Context Window and Output Cap

The documented context window and maximum output tokens, why they are two different limits, and what a full-window request costs at the published rates.

8 min read

Automatic Prompt Caching in the OpenAI API: The 1,024-Token Floor

The documented minimum prefix length, the 128-token increments above it, and a request that qualifies for caching next to one that does not.

8 min read

GPT-4 Turbo's Knowledge Cutoff Date, and What It Means in Practice

The documented cutoff for each GPT-4 Turbo snapshot, why the model's knowledge thins out well before that date, and the three questions the cutoff does not answer.

8 min read

The Moderation Endpoint and Why the Model Still Refuses on Its Own

Moderation is a separate classifier you call yourself; the chat model's refusal comes from its own training. Neither one knows the other's verdict.

8 min read

Temperature and top_p Together in the OpenAI API: What Changing Both Does

Why OpenAI's reference tells you to alter one or the other, worked through on a five-token distribution where changing temperature silently changes what top_p removes.

9 min read

The n Parameter: Multiple Completions in One OpenAI Request

What the choices array looks like when n is greater than one, how the bill splits between a prompt charged once and completions charged n times, and where n is not available.

8 min read

finish_reason Values in the OpenAI API and What Each One Means

Every documented value of finish_reason on a chat completion, the condition that produces it, and what your code has to do differently for each.

9 min read

frequency_penalty and presence_penalty in the OpenAI API: What Each One Changes

The two penalty formulas from OpenAI's reference, applied to a token that has already appeared eight times, so you can see what a value of 0.5 does in probability terms.

9 min read

system_fingerprint in the OpenAI API and What It's For

The field exists to tell you when the backend behind a model name changed, which is the missing half of what the seed parameter promises.

8 min read

Does o1-mini Support Function Calling?

No, and the 400 you get names the parameter — here is the error, the rest of the capability gap it belongs to, and the four ways round it.

8 min read

response_format json_schema: How OpenAI's Structured Output Type Works

A complete request built from scratch, the strict-mode subset of JSON Schema the API will accept, and the two response fields that are not your parsed object.

10 min read

The Streaming Event Shape of the OpenAI Realtime API

The envelope every Realtime event shares, the client events you send, the server event families you receive, and the ordering that a session walkthrough makes concrete.

10 min read

How OpenAI Counts Tokens in a Multi-Turn Conversation With Tool Results

The per-message overhead OpenAI publishes, applied across a five-request conversation with a tool call, showing why one 120-token tool result gets billed four times.

10 min read

GPT-4.1's Context Window and Why It Differs From GPT-4o's

The documented context and output limits for GPT-4.1 set beside GPT-4o's from the same source, and the three limits that stop you using the larger one.

9 min read

OpenAI's max_tokens Default and Why Omitting It Truncates Output

Truncated output with no max_tokens set has three different causes depending on the endpoint and the model, and only one of them is the classic default of 16.

9 min read

Other topics