POST /v1/chat/completions
Web search lives at the top level of the request body in web_search_options — not inside the tools array. The two are mutually exclusive: a request with both returns 400.
Request
Options
| Field | Values | Effect |
|---|---|---|
search_context_size | "low" / "medium" / "high" | Number of results fetched (5 / 10 / 20). Default medium. |
user_location | string or location object | Hint for region-relevant results |
Domain restrictions
OpenAI’s Chat Completions spec does not define a native per-request domain filter forweb_search_options. Domain restrictions come from one place:
Project-level allow/block via Policy Gateway. If your project has web_tools.allowed_domains or web_tools.blocked_domains set, the gateway enforces them server-side on every search made through this surface.
Configure them per project in the console under Project → Web tools. If you need per-request domain filters, use the Responses API or Anthropic Messages surfaces.