OpenAI's Strict Mode and Claude's Strict Tool Use Aren't the Same Guarantee
OpenAI's strict function-calling mode and Claude's strict tool use both constrain a model's token sampling so tool arguments match your JSON Schema, but the schema subsets, model gating, and interaction quirks differ enough that porting a schema between them without checking the current docs will break something.
AI-assisted editorial: researched and drafted with AI using the primary sources linked below. Check the cited evidence and any stated test scope. Illustrative examples are not measured product results. Editorial policy.
Key takeaways
- Both providers now enforce schema shape at the decoding layer, not just at validation time, but 'strict' means a different supported JSON Schema subset on each.
- Claude's strict tool use has documented complexity limits that combine across every strict tool in one request, and it rejects strict on the computer-use and browser-use toolsets outright.
- Before turning strict mode on in production, test your exact schema against the provider's current limitations page and its refusal/incompatibility behavior, not a six-month-old blog post.
The short answer
Both OpenAI and Claude now offer a mode where the model's token sampling is restricted so it cannot emit output that violates your JSON Schema. Function calling remains similar on OpenAI's side, but with the new parameter strict: true, the schema you provide for a function is strictly followed, and Structured Outputs can be enabled the same way for a response format. On Claude's side, the same enforcement runs through two separate controls that share one engine: output_config.format for Claude's own reply, and strict: true on a tool definition for its arguments, both using the same grammar pipeline that compiles your schema and caches it for 24 hours.
That shared idea — constrain generation, don't validate after the fact — is where the similarity ends. The two providers support different slices of JSON Schema, gate the feature on different model versions, and fail in different ways when a schema or a combination of features isn't supported. If you're porting a tool schema from one provider to the other, or testing both before picking a default model for a bot, treat 'strict' as a label, not a spec.
Sources: Introduction to Structured Outputs, Structured outputs - Claude Platform Docs.
How OpenAI's strict mode behaves
On OpenAI's API, Structured Outputs can be enabled by setting strict: true in an API call with either a defined response format or function definitions, and OpenAI recommends always using Structured Outputs instead of JSON mode when possible. That recommendation comes with a model floor: Structured Outputs with response_format is only supported with the gpt-4o-mini, gpt-4o-mini-2024-07-18, and gpt-4o-2024-08-06 model snapshots and later — an older model will not honor the schema the same way even if you pass one. The current guide's own code samples now run against OpenAI's current flagship line, which tells you the schema mechanics haven't changed even as the model names have.
A second behavior worth building for: when Structured Outputs are used with user-generated input, the model may occasionally refuse to fulfill the request for safety reasons, and the API surfaces that as a separate refusal field rather than forcing malformed JSON into your schema. Your parsing code has to check for that field before it tries to deserialize the response, or a refusal will look like a parse failure instead of what it actually is.
Sources: Introduction to Structured Outputs, Structured model outputs.
How Claude's strict tool use behaves
On Claude's API, setting strict: true is a top-level property in your tool definition, alongside name, description, and input_schema. With it on, the input field in the tool_use block strictly follows your input_schema and the tool name is always valid. There's a hard carve-out: the computer use and browser use toolset entries don't accept strict: true, and a request that sets it on either entry is rejected outright — a detail that matters if your bot mixes a custom booking tool with Anthropic's own computer-use toolset in one request.
Claude also documents request-wide complexity limits that apply to the combined total across all strict schemas in a single call, not per tool — for example, if you have four strict tools with six optional parameters each, you'll reach a 24-parameter limit even though no single tool looks complex on its own. There's a separate quirk worth testing for directly: with an enum constraint, the output might contain a value like 'Conversation Topic 3' with different capitalization than what's in your enum, and the response completes normally with no error and no special stop_reason — so your code needs to compare enum values case-insensitively rather than trusting an exact string match. Two more interactions to check before you rely on strict mode: citations require interleaving citation blocks with text, which conflicts with strict JSON schema constraints and returns a 400 error if combined with output_config.format, and message prefilling is incompatible with JSON outputs mode entirely. Claude does let you combine tool_choice: {"type": "any"} with strict tool use to guarantee both that one of your tools will be called and that its input strictly follows your schema — useful when you need a forced, schema-valid call rather than an optional one.
Sources: Strict tool use - Claude Platform Docs, Structured outputs - Claude Platform Docs, How to implement tool use - Claude API Docs.
Illustrative example: a seat-booking tool
Say you're defining a book_flight tool with a required destination string, a required departure date, and an optional passengers field constrained to an enum of 1 through 10. This is illustrative, not a BotBento test result. On OpenAI, you'd set strict: true on the function definition and need to check that your target model snapshot is on the supported list before assuming the schema will be honored rather than silently ignored; you'd also need a branch in your handler that checks the refusal field before attempting to parse arguments, because a refusal arrives as a separate field rather than as malformed JSON. On Claude, you'd set strict: true as a top-level property next to name, description, and input_schema, exactly as in Anthropic's own search_flights example, and pair it with tool_choice: {"type": "any"} if you need a call guaranteed on every turn rather than only when Claude decides to use the tool. If this same booking tool sat inside a request that also used Claude's computer-use toolset, you'd have to drop strict from that request entirely, since the toolset rejects it.
Neither failure mode is exotic, but neither is visible from a cursory read of either vendor's homepage. The practical takeaway from running this schema through both docs side by side: the enforcement mechanism (constrained token sampling) is the same philosophy, but the edges where it breaks — model gating on one side, toolset and complexity interactions on the other — are specific to each vendor's current documentation page, not a shared standard.
Sources: Strict tool use - Claude Platform Docs, Structured model outputs.
What to check before you flip the switch
The decision isn't which vendor's strict mode is 'better' — there's no public, equal-condition benchmark comparing schema coverage between the two, and claiming one is categorically stronger would be guessing. The decision that's actually available to you today is narrower: read the current limitations page for the specific model and feature combination you're about to ship, write a small test schema that exercises your actual edge cases (optional fields, enums, nested objects), and run it against the live API before you wire strict mode into a routine that runs unattended.
- Pull the provider's current JSON Schema limitations page for the exact model you're targeting — not a blog post from last year — before writing your schema.
- On OpenAI, confirm your model snapshot is on the supported list for the feature you're using (response_format vs. function strict mode), and add a refusal-field check ahead of your JSON parser.
- On Claude, if a request mixes a custom strict tool with the computer-use or browser-use toolset, strict mode will be rejected on that request; split the calls instead.
- On Claude, if you're relying on enum values for routing logic, compare case-insensitively — a capitalization mismatch can pass through with no error and no special stop_reason.
- Test the specific combination you plan to ship (strict + forced tool_choice, strict + citations, strict + prefilling) against the current docs' incompatibility list, since several of these interactions return a hard error rather than a graceful fallback.
Primary sources
Sources checked 2026-11-06. Standards and product documentation can change; follow the linked version when implementing.
- Structured model outputs — OpenAI
- Introduction to Structured Outputs — OpenAI
- Structured outputs - Claude Platform Docs — Anthropic
- Strict tool use - Claude Platform Docs — Anthropic
- How to implement tool use - Claude API Docs — Anthropic
BotBento is in development. Suggest a correction.