Server-Side Tools
Server-Side Tools
Server-side tools run inside Mixlayer. Add one to a request and the model can call it as needed; Mixlayer executes the call and returns the result to the model automatically. Your application does not need to implement the tool-call loop.
Web search
The web_search tool searches the public web using Exa. It is available over the OpenAI compatible Responses and Chat Completions endpoints.
Responses
Chat Completions
The model decides whether to search and may search more than once. You are charged for each search it performs, not merely for enabling the tool.
Options
Each domain list accepts at most 100 unique bare domain names such as example.com. Do not include a scheme, path, port, query, fragment, or wildcard. Domains are normalized to lowercase and a trailing dot is removed.
Location
Use an approximate location with any combination of country, city, region, and timezone. country must be a two-letter country code. timezone must be an IANA-style name such as America/Los_Angeles.
Responses uses a flat location object:
Chat Completions nests the location fields under approximate:
Results and sources
For Responses, each completed search adds a web_search_call output item:
Pass include: ["web_search_call.action.sources"] to include action.sources; otherwise the source list is omitted. The search call item itself is always returned when a search runs.
For Chat Completions, sources are returned in choices[0].message.sources. Streaming responses send them in a choices[0].delta.sources chunk. Each source has url and title fields.
Both APIs report the number of searches in usage.server_tool_use.web_search_requests.
Responses streaming and WebSocket
Responses streaming emits these events for each search:
The same request options, output items, and lifecycle events work over the Responses WebSocket transport. Put the web search tool in each response.create message where it should be available.
Pricing
Model input and output tokens are billed separately at the selected model’s rates. For example, one search returning 25 results incurs one search-request unit and 15 additional-result units, plus model token usage.
Combining tools
Web search can be used alongside your own function tools. web_search is reserved for the built-in tool, so custom functions cannot use that name. A request may include the built-in tool only once.