Skip to main content
Give an OpenAI model live web search. The model asks for a search, your code calls Stophy, and the model answers from the results.

The search tool

Save this as stophy.ts. When the model calls it, it returns the top 5 web results as JSON.
stophy.ts

Give it to an OpenAI model

Set OPENAI_API_KEY in your environment, and STOPHY_API_KEY to go past the free limits. Pass the search as a function tool to the Responses API. While the model keeps calling it, run the search and send the result back.