Skip to content

Tools, Reasoning & Web Search ​

Tool calling ​

Tool calls work across protocols: an OpenAI client can call tools served by an Anthropic upstream and vice versa.

AspectBehavior
Tool typesfunction, custom (grammar/format), and built-in web_search/web_search_preview definitions
tool_choiceauto / none / required, {"type":"function","name":…}, Responses-style allowed_tools (collapses to its mode and filters the tool list), and the typed object forms: hosted tools ({"type":"web_search_preview"}, file_search, code_interpreter, image_generation, computer use), mcp, custom, shell, apply_patch. A native Responses upstream receives the choice unchanged; other providers have no equivalent hosted tools, so the choice becomes auto
Parallel callsSupported; parallel_tool_calls: false disables parallel tool use
Unknown tool typesAccepted during validation, dropped when building the upstream request
ResultsSend tool messages (Chat) / tool_result blocks (Anthropic) / function_call_output items (Responses) as usual
Custom tool callsReturned re-wrapped as type: "function" with arguments = {"content": <input>}

The proxy preserves protocol-specific extras such as tool strict flags, grammars, and thought signatures where the upstream supports them.

Reasoning ​

Thinking controls are accepted in every dialect and normalized:

ClientInputs
OpenAI Chatreasoning_effort (none…max), thinking (bool or {type, budget_tokens, effort, display}), or a Responses-shaped reasoning: {effort} / output_config: {effort}
Anthropicthinking: {"type":"enabled","budget_tokens":N} or an effort form
Responsesreasoning: {effort, mode, context, summary}

Provider-specific details:

  • Cross-protocol reasoning_effort translates to thinking: {"type": "adaptive"} plus output_config.effort on Anthropic targets (and thinking: {"type": "disabled"} for none), without proxy-side budget_tokens validation, temperature/top_p suppression, or forced tool_choice rewriting; upstream rejects invalid combinations for a given model.
  • Outbound on OpenAI Chat, explicit effort or disabled/budget_tokens emits reasoning_effort (alongside any provider-specific thinking keys such as clear_thinking); OpenRouter and NanoGPT fold it into a reasoning object, and bare thinking configurations pass as thinking.

How reasoning comes back:

ProtocolField
Chat Completionsreasoning_content (never reasoning), plus reasoning_signature; redacted blocks → reasoning_content: "[redacted]" + reasoning_is_redacted: true + encrypted_content: <opaque data>; interleaved turns also carry reasoning_segments
Anthropicthinking blocks with signature, and redacted_thinking blocks
ResponsesReasoning output items plus response.reasoning_summary_text.delta events while streaming; token counts in output_tokens_details.reasoning_tokens

Round-tripping multi-turn reasoning: pass back what you received. On Chat Completions input the proxy reads reasoning_content or the OpenRouter/NanoGPT reasoning spelling (reasoning_content wins when both are present), plus reasoning_signature, reasoning_is_redacted, encrypted_content, and reasoning_segments.

Prompt-prefix stability ​

Starting with GPT-6.2, the Responses API drops reasoning items when the prefix of a conversation changes mid-conversation: an earlier developer message or tool call is edited, the model is downgraded, or the end user changes. It also places top-level instructions after input for prefix matching. Put reusable instructions in a developer message as the first item of input, and keep top-level instructions for guidance that applies to this request only.

What the proxy does with a continuation:

  • A native Responses upstream receives the client's body unchanged. That includes previous_response_id when the proxy has no stored copy to replay.
  • When the proxy replays a stored response, it sends the prior input, then the prior output (reasoning items included), then the new turn, in that order. instructions is sent as the first item of input, not as a top-level field. The prefix is kept; item ids from the original response are not.
  • Editing an earlier turn still counts as a prefix edit. If you rewind or rewrite history, the model loses its earlier reasoning and token usage goes up.

Mixed-provider reasoning payloads

encrypted_content is overloaded: it carries an Anthropic thinking signature when the proxy bridged one for round-trip, and a native OpenAI encrypted-reasoning blob otherwise. A blob parsed directly from an OpenAI upstream is never replayed to Anthropic as a signature, but a blob that reached your client and came back has no origin marker and may be rejected if replayed to Anthropic. Keep provider-specific reasoning within one provider where possible.

The proxy can answer web_search tool calls itself, so every model becomes web-aware through your own search provider.

Enable ​

  1. Settings → General → Web Search: turn on interception and configure a search provider:
    • SearXNG: url required; optional API key or basic auth; engines list; timeout (default 30 s); max_results (default 10, max 10). Queries over 4000 characters are rejected.
    • Ollama: api_key required; base_url default https://ollama.com; timeout; max_results (max 10).
  2. Save the settings. Changes are hot-reloaded.

How interception works ​

  • Only providers without native web search are intercepted (the provider's Native web search flag controls this). With native support, your tools are passed through unchanged.
  • In Chat Completions, a web_search_options field (or a web_search tool definition) enables it; the proxy replaces the tool with a plain function named web_search taking a single query string, and executes the model's call against your search provider.
  • The proxy re-calls the provider with the results until the model stops searching, and returns the final answer to the client. Intermediate tool calls are not exposed on non-streaming paths, and usage across the re-calls is summed.
  • max_uses on the tool definition is enforced per request.
  • Requests taking the native-passthrough tier disable interception for that request.

The interceptor also reads further per-tool options; only some reach the search provider:

OptionBehavior
allowed_domains, blocked_domainsSearXNG filters results to/excluding these domains; ignored by Ollama
user_locationSearXNG: passed as location (city/region/country) with language derived from timezone; ignored by Ollama
search_context_size, external_web_access, return_token_budget, search_content_typesCaptured from the tool definition but not enforced by any search provider

What clients see ​

  • Anthropic-protocol clients receive native server_tool_use + web_search_tool_result blocks, and the billing counter provider_info.server_tool_use.web_search_requests.
  • Other protocols receive result blocks: {"type":"web_search_result", "url", "title", "encoded_content": <base64 snippet>, "encoded_index": <base64 sha256>, "page_age"?}. Note: this is base64 encoding, not Anthropic's encryption.
  • Search failures do not fail the HTTP request: the model receives a web_search_tool_result_error with one of these codes: too_many_requests (429/timeout), invalid_input (400), query_too_long, unavailable (5xx), invalid_api_key (401 from the search provider), or max_uses_exceeded. The same code and the search provider's message are reported on the client-visible web_search_call.action (error_code / error_message, item statusfailed); Anthropic-protocol clients get the code inside the web_search_tool_result_error object, which has no message field.

Observability ​

Every intercepted search is logged (Logs → Web Search): query, provider, status, result count, and current-vs-maximum use. The query is stored verbatim; it is a content field, so the Log Input/Output master switch scrubs it together with the other bodies. The provider column holds the search provider's wire name (searxng / ollama).

MCP is separate ​

MCP servers are not injected into model requests. They are exposed as MCP endpoints at /servers/<name>/mcp for MCP clients, using the same API keys, budgets, and logs. See MCP Servers.

MIT licensed