AI Gateway

Web search

Let a GPT model ground its answers in current search results
View as Markdown

The gpt-* models can search the web during a request and ground their answers in what they find. The search runs inside Amazon Bedrock, so there is no search API to wire up and no key to manage. The model decides on its own when a question needs current information.

The gpt-* models are served on both /v1/chat/completions and /v1/responses, but web search is available only on the Responses API. Call /v1/responses, add a web_search tool to the request, and set external_web_access to false.

response = client.responses.create(
model="gpt-5-6-luna",
input="What did AWS announce this month?",
tools=[{"type": "web_search", "external_web_access": False}],
)
print(response.output_text)

Set external_web_access to false. It defaults to true, which asks Bedrock to fetch live pages from the open internet. The gateway does not permit that, so a request that leaves the default gets a 403 on the fetch step: an answer still comes back grounded in search results, but with no page content behind it. With false, retrieval is served from Amazon’s own web index and cache, and your request data stays inside AWS.

Answers carry url_citation annotations giving the title and URL behind each cited passage. Keep them. Amazon’s terms require you to display the source citations to your end users.

Next steps