Skip to content

Instantly share code, notes, and snippets.

@thetafferboy
thetafferboy / openai-example.py
Created May 9, 2026 23:50
OpenAI Responses API example
"""
Inspecting the web searches performed by the OpenAI Responses API.
When you enable the `web_search` tool, the model decides whether to issue one or
more search queries. Each query is recorded as a `web_search_call` item in the
response output, with the action type and the actual queries the model ran.
Docs: https://developers.openai.com/api/docs/guides/tools-web-search
"""