/v1/chat/completions(OpenAI-styletoolsandtool_calls)/v1/responses(Responses-stylefunction_calloutput items)/v1/messages(Anthropic-styletool_useblocks)
Request
Response
Built-in server tools
The gateway currently exposes these built-in server tools:gateway:datetimephaseo:web_searchphaseo:web_fetchphaseo:advisorphaseo:image_generationphaseo:apply_patch
parameters.timezonesis optional and can request up to 5 valid IANA timezones in one call.- The result contains a
timezonesarray with ISO datetime plus the resolved timezone for each requested zone. - Usage includes
usage.server_tool_use.datetime_requests. - Prefer
tool_choice: "auto"so the model can decide when to call it.
Web search example
- The model supplies the search query when it calls the tool.
engine: "auto"resolves to managed Exa search.engine: "exa",engine: "parallel",engine: "firecrawl", andengine: "tinyfish"run managed gateway search when the matching provider key is configured.- TinyFish Search supports localized, paginated ranked results and is free on its published plans; use
languageandpagein the tool parameters when needed. engine: "native"onphaseo:web_searchis converted to the provider-native web search tool for the request surface, such as OpenAIweb_search_previewor Anthropicweb_search_20250305.max_resultscaps each search call;max_total_resultscaps cumulative results across the server-tool loop.- Managed search supports
allowed_domains/excluded_domains,search_context_size, andmax_characterswhere the selected engine exposes matching controls. - Usage includes
usage.server_tool_use.web_search_requests,usage.server_tool_use.web_search_results, andusage.server_tool_use.web_search_extra_results. - Pricing can bill managed Exa search with
server_tool_web_search_requestsandserver_tool_web_search_extra_resultsmeters.
Web fetch example
- The model supplies the target
urlwhen it calls the tool. - Only HTTP(S) URLs and text-like content types are supported.
engine: "auto"uses native fetch on the Anthropic Messages surface, otherwise Exa whenEXA_API_KEYis configured, otherwise direct gateway HTTP fetch.engine: "direct"uses direct gateway HTTP fetch.engine: "exa"uses Exa content extraction whenEXA_API_KEYis configured.engine: "parallel"uses Parallel Extract whenPARALLEL_API_KEYis configured.engine: "firecrawl"uses Firecrawl Scrape whenFIRECRAWL_API_KEYis configured.engine: "native"on the Anthropic Messages surface is converted to Anthropic’s nativeweb_fetch_20260209tool. Other request surfaces should useengine: "direct"or a managed extraction engine.max_content_tokensis accepted as a token-style bounded fetch size alias whenmax_charsis omitted.allowed_domainsandblocked_domainsconstrain which URLs can be fetched.- HTML content is reduced to bounded plain text before being injected back into the model loop.
- Usage includes
usage.server_tool_use.web_fetch_requests. - Pricing can bill managed fetch with the
server_tool_web_fetch_requestsmeter. Provider-native fetch/search usage is priced withnative_web_fetch_requestsandnative_web_search_requests; model price cards can override the built-in provider defaults.
Advisor example
- Advisor is gateway-managed and works across supported text models. The calling model receives an
phaseo_advisortool, or a named variant such asphaseo_advisor_reviewer, and the gateway executes the Advisor request. parameters.nameis optional. Use unique names to expose multiple advisors; names may contain letters, numbers, spaces, underscores, and dashes.parameters.modelpins the Advisor model. If omitted, the tool call can providemodel; otherwise the gateway falls back to the outer request model.parameters.forward_transcriptdefaults tofalse. Set it totruewhen the Advisor should receive the current conversation transcript.- The model normally supplies the Advisor
promptwhen it calls the tool. Whenforward_transcriptistrue, the gateway can execute a transcript-only Advisor call if no prompt is supplied.max_tokensis accepted as a legacy alias formax_completion_tokens. - Usage includes
usage.server_tool_use.advisor_requests.
Image generation example
- The model supplies the image
promptwhen it calls the tool.descriptionis also accepted as a prompt alias. parameters.modelpins the image model. If omitted, the tool call can providemodel; otherwise Phaseo uses the default image model.- The tool result contains either
imageUrlor base64 image data, depending on the provider response. - Usage includes
usage.server_tool_use.image_generation_requests; image-model token usage is merged into the parent request.
Apply patch example
phaseo:apply_patchis supported on the Responses API.- Phaseo validates patch operations and returns them in the tool result. Your client decides whether to apply or reject the patch.
- Supported operation types are
create_file,update_file, anddelete_file. - Usage includes
usage.server_tool_use.apply_patch_requests.
Streaming behavior
Tool-calling requests can also usestream: true.
For gateway-managed server tools, the gateway may:
- materialize the upstream tool-call turn
- execute the server tool
- continue the model loop
- re-emit a synthetic stream back to the client