Skip to main content
POST /v1/chat/completions Web search lives at the top level of the request body in web_search_optionsnot inside the tools array. The two are mutually exclusive: a request with both returns 400.

Request

from openai import OpenAI

client = OpenAI(base_url="https://api.abliteration.ai/v1", api_key=os.environ["ABLIT_KEY"])

resp = client.chat.completions.create(
    model="abliterated-model",
    messages=[{"role": "user", "content": "Latest SEC filings for NVDA"}],
    extra_body={
        "web_search_options": {
            "search_context_size": "medium",
            "user_location": "us-east-1",
        }
    },
)

Options

FieldValuesEffect
search_context_size"low" / "medium" / "high"Number of results fetched (5 / 10 / 20). Default medium.
user_locationstring or location objectHint for region-relevant results

Domain restrictions

OpenAI’s Chat Completions spec does not define a native per-request domain filter for web_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.