> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opper.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Provider server-side tools

> Use Anthropic, OpenAI, and Google server-side tools (web search, code execution, grounding) through Opper.

Server-side tools are tools the *provider* runs for you — Anthropic's `web_search`, OpenAI's `code_interpreter`, Google's `googleSearch`, and so on. Unlike [function tools](/build/gateway/tools), there's no round-trip: the model invokes the tool, the provider runs it, and the result comes back in the same response.

Opper forwards these tools verbatim to each provider on that provider's native endpoint. Surcharges (e.g. \$10 / 1k web searches) bill as the provider reports them.

## Where each tool lives

Server-side tools are endpoint-specific — each provider only accepts its own tools on its own compatibility endpoint. Send them anywhere else and you get a 400 with a hint pointing at the right endpoint.

| Provider  | Endpoint                                                | Tools                                                                                                          |
| --------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| Anthropic | `POST /v3/compat/v1/messages`                           | `web_search_*`, `web_fetch_*`, `bash_*`, `computer_*`, `memory_*`, `text_editor_*`, `mcp_toolset`, `advisor_*` |
| OpenAI    | `POST /v3/compat/responses`                             | `web_search`, `file_search`, `code_interpreter`, `image_generation`                                            |
| Google    | `POST /v3/compat/v1beta/models/{model}:generateContent` | `googleSearch`, `codeExecution`, `urlContext`, `googleSearchRetrieval`                                         |

Function tools (your own `{type:"function",...}` definitions) work on every endpoint — the restriction is just for provider-native server tools.

## Examples

<CodeGroup>
  ```bash Anthropic web_search theme={null}
  curl https://api.opper.ai/v3/compat/v1/messages \
    -H "Authorization: Bearer $OPPER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "anthropic/claude-sonnet-4-6",
      "max_tokens": 1024,
      "messages": [{"role": "user", "content": "What were the top tech headlines today?"}],
      "tools": [{
        "type": "web_search_20250305",
        "name": "web_search",
        "max_uses": 3
      }]
    }'
  ```

  ```bash OpenAI web_search theme={null}
  curl https://api.opper.ai/v3/compat/responses \
    -H "Authorization: Bearer $OPPER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "openai/gpt-5.5",
      "input": "What were the top tech headlines today?",
      "tools": [{"type": "web_search"}]
    }'
  ```

  ```bash Google grounding theme={null}
  curl "https://api.opper.ai/v3/compat/v1beta/models/gemini-2.5-flash:generateContent" \
    -H "Authorization: Bearer $OPPER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "contents": [{"role":"user","parts":[{"text":"Who won the latest F1 race?"}]}],
      "tools": [{"googleSearch": {}}]
    }'
  ```
</CodeGroup>

## Responses

Each provider's native response shape comes back verbatim, so the official Anthropic / OpenAI / Google SDKs parse it without changes:

* **Anthropic** — `content[]` contains `server_tool_use`, `web_search_tool_result` (with the result URLs + encrypted content), and `text` blocks whose `citations[]` reference the sources the model actually grounded on.
* **OpenAI Responses** — `output[]` contains `web_search_call` items (with the search queries) and `message.content[].output_text.annotations[]` `url_citation` entries.
* **Google** — `candidates[0].groundingMetadata` carries `webSearchQueries`, `groundingChunks[].web` (URI + title), `groundingSupports`, and `searchEntryPoint`.

### Compact responses

Server-tool payloads can get heavy (Anthropic `web_search` results carry full snippets + per-result `encrypted_content`). Send `X-Opper-Compact-Response: true` to strip the bandwidth-heavy fields while preserving citation URLs and titles. Tradeoff: a compact response **can't be replayed** to extend a cited multi-turn conversation, because Anthropic citation continuity needs the `encrypted_index` / `encrypted_content` that compact mode drops.

## Routing through Bedrock and Vertex

When you route Claude through a cloud platform (`bedrock/claude-*`, `vertexai/claude-*`), the supported subset shrinks. Opper rejects with a clear 400 when you ask for something the cloud doesn't carry.

| Tool                                                   | Direct Anthropic | Vertex AI Claude | Bedrock Claude |
| ------------------------------------------------------ | ---------------- | ---------------- | -------------- |
| `web_search_*`                                         | ✓                | ✓                | ✗              |
| `web_fetch_*`                                          | ✓                | ✗                | ✗              |
| `bash_*` / `computer_*` / `memory_*` / `text_editor_*` | ✓                | ✓                | ✓              |
| `code_execution_*`                                     | ✓                | ✗                | ✗              |
| `mcp_toolset` / `advisor_*`                            | ✓                | ✗                | ✗              |

Source: Anthropic's [Features not supported](https://platform.claude.com/docs/en/api/claude-on-vertex-ai) lists on each platform's docs page.

## Provider docs

For the full parameter set on each tool (filters, citation options, region settings, etc.), consult the provider's own reference:

* [Anthropic — tool reference](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-reference)
* [OpenAI — Responses API tools](https://platform.openai.com/docs/guides/tools)
* [Google — generateContent tools](https://ai.google.dev/gemini-api/docs/grounding)

## See also

* **[Web search](/build/gateway/web-search)** — the portable `opper:web_search` tool: one tool entry that works on every endpoint, routes to native when supported and to Opper's engine when not.
* **[server-tools-compare](https://github.com/opper-ai/opper-cookbook/tree/main/examples/server-tools-compare)** — runnable cookbook example: fans the same question out to all three providers in parallel and shows queries, citations, cost, and the compact-mode size delta side by side.
