Skip to content

fix(pricing): add supports_web_search for OpenAI gpt-5.1/5.2/5.3 chat models#22934

Merged
krrishdholakia merged 1 commit intoBerriAI:mainfrom
yudelevi:fix/openai-gpt5-supports-web-search
Mar 6, 2026
Merged

fix(pricing): add supports_web_search for OpenAI gpt-5.1/5.2/5.3 chat models#22934
krrishdholakia merged 1 commit intoBerriAI:mainfrom
yudelevi:fix/openai-gpt5-supports-web-search

Conversation

@yudelevi
Copy link
Contributor

@yudelevi yudelevi commented Mar 5, 2026

Relevant issues

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory — N/A, JSON-only data fix
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

OpenAI gpt-5.1, gpt-5.2, and gpt-5.3 chat models all support the web_search_options parameter (docs), but the model cost registry was missing the supports_web_search flag. Only gpt-5.2-pro had it set correctly.

Models updated (OpenAI provider only):

  • gpt-5.1, gpt-5.1-2025-11-13, gpt-5.1-chat-latest
  • gpt-5.2, gpt-5.2-2025-12-11, gpt-5.2-chat-latest
  • gpt-5.3-chat-latest

OpenAI gpt-5.1, gpt-5.2, and gpt-5.3 chat models all support the
`web_search_options` parameter, but the model cost registry was missing
the `supports_web_search` flag. Only `gpt-5.2-pro` had it set.

Models updated:
- gpt-5.1, gpt-5.1-2025-11-13, gpt-5.1-chat-latest
- gpt-5.2, gpt-5.2-2025-12-11, gpt-5.2-chat-latest
- gpt-5.3-chat-latest
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Mar 5, 2026 10:43pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 5, 2026

Greptile Summary

This PR is a targeted data-only fix that adds "supports_web_search": true to seven OpenAI gpt-5.1, gpt-5.2, and gpt-5.3 chat-mode model entries in model_prices_and_context_window.json. This is the correct approach per the project's convention of keeping capability flags in the registry rather than hardcoding them, and the change is non-breaking.

  • All 7 targeted models (gpt-5.1, gpt-5.1-2025-11-13, gpt-5.1-chat-latest, gpt-5.2, gpt-5.2-2025-12-11, gpt-5.2-chat-latest, gpt-5.3-chat-latest) have been correctly updated.
  • JSON syntax and property ordering is consistent with the surrounding entries.
  • The two gpt-5.4 model entries (gpt-5.4 and gpt-5.4-2026-03-05) also list /v1/chat/completions in their supported_endpoints but are not updated — they carry mode: "responses" which aligns with the PR's stated scope of "chat models", though it may be worth confirming whether web_search_options is supported there too.

Confidence Score: 4/5

  • This PR is safe to merge — it is a JSON-only data fix with no logic changes and no breaking impact.
  • The change is isolated to a single data file, adds a capability flag to models that already existed in the registry, follows the established pattern used by gpt-5.2-pro, and is non-breaking. Score is 4 rather than 5 only because gpt-5.4/gpt-5.4-2026-03-05 may also need the flag and weren't addressed, leaving a small potential gap.
  • No files require special attention; the single changed file (model_prices_and_context_window.json) is straightforward.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds supports_web_search: true to 7 OpenAI gpt-5.1/5.2/5.3 chat-mode models; note that gpt-5.4 and gpt-5.4-2026-03-05 (which also list /v1/chat/completions in supported_endpoints) are not updated

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[model_prices_and_context_window.json] --> B[gpt-5.1]
    A --> C[gpt-5.1-2025-11-13]
    A --> D[gpt-5.1-chat-latest]
    A --> E[gpt-5.2]
    A --> F[gpt-5.2-2025-12-11]
    A --> G[gpt-5.2-chat-latest]
    A --> H[gpt-5.3-chat-latest]
    A --> I[gpt-5.2-pro / gpt-5.2-pro-2025-12-11]
    A --> J[gpt-5.4 / gpt-5.4-2026-03-05]

    B -- "supports_web_search: true ✅ ADDED" --> K[web_search_options supported]
    C -- "supports_web_search: true ✅ ADDED" --> K
    D -- "supports_web_search: true ✅ ADDED" --> K
    E -- "supports_web_search: true ✅ ADDED" --> K
    F -- "supports_web_search: true ✅ ADDED" --> K
    G -- "supports_web_search: true ✅ ADDED" --> K
    H -- "supports_web_search: true ✅ ADDED" --> K
    I -- "supports_web_search: true ✅ Already set" --> K
    J -- "supports_web_search: ❓ Not updated" --> L[Flag potentially missing]
Loading

Comments Outside Diff (1)

  1. model_prices_and_context_window.json, line 20863 (link)

    gpt-5.4 / gpt-5.4-2026-03-05 may be missing supports_web_search

    Both gpt-5.4 (line 20863) and gpt-5.4-2026-03-05 (line 20899) end their property lists without supports_web_search, even though both declare /v1/chat/completions in their supported_endpoints. If these models support web_search_options via the chat completions path (consistent with gpt-5.1/5.2/5.3 receiving the flag here), they would need the same addition.

    This PR is intentionally scoped to "chat mode" models (mode: "chat"), and both gpt-5.4 entries carry mode: "responses" — so the omission may be deliberate. It is worth confirming whether web_search_options is also available for these two models when called via /v1/chat/completions, and if so, adding the flag in a follow-up.

Last reviewed commit: 9bbe15f

@krrishdholakia krrishdholakia merged commit 8b2dd4f into BerriAI:main Mar 6, 2026
28 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants