How to Use Web Fetchpublic

Last verified 24 Aug 2026

Inference provides a single control plane for managing inference workflows. It includes a Model Catalog where you can view available foundation models, including both DigitalOcean-hosted and third-party commercial models, compare model capabilities and pricing, use routing to match inference requests to the best-fit model, and run inference using serverless or dedicated deployments.

Web fetch is a DigitalOcean-hosted tool that retrieves the full content of specific web pages and PDF documents during inference. When you add web fetch to your API request, the model fetches URLs referenced in the conversation and incorporates the content into its response. We use a third-party web fetch service (Exa.ai) for all non-Anthropic models. For Anthropic models, web fetch is a provider passthrough tool with a different schema (see Web Fetch with Anthropic Models).

To enable web fetch, include a tool object with type set to web_fetch in the tools array of your request. The following example sends a Responses API request with web fetch enabled:

import os
from pydo.inference import Client

client = Client(token=os.environ.get("MODEL_ACCESS_KEY"))

resp = client.responses.create(
    model="openai-gpt-4o",
    input="Summarize the content at https://docs.digitalocean.com/products/inference/",
    tools=[
        {
            "type": "web_fetch",
            "max_uses": 3,
        }
    ],
    max_output_tokens=1024,
    stream=False,
)

print(resp)
import { InferenceClient } from "@digitalocean/dots";

const client = new InferenceClient({
    apiKey: process.env.MODEL_ACCESS_KEY,
});

const resp = await client.responses.create({
    model: "openai-gpt-4o",
    input: "Summarize the content at https://docs.digitalocean.com/products/inference/",
    tools: [
        {
            type: "web_fetch",
            max_uses: 3,
        },
    ],
    max_output_tokens: 1024,
    stream: false,
});

console.log(resp);
curl -X POST https://inference.do-ai.run/v1/responses \
  -H "Authorization: Bearer $MODEL_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai-gpt-4o",
    "input": "Summarize the content at https://docs.digitalocean.com/products/inference/",
    "tools": [
      {
        "type": "web_fetch",
        "max_uses": 3
      }
    ],
    "max_output_tokens": 1024,
    "stream": false
  }'

You can optionally limit the number of fetches the model performs per request from 1 to 5 with max_uses. When the request reaches the limit, the model produces a final response using the content collected so far.

Alternatively, specify model: <model_name>:web to give the model access to web fetch and web search. This is particularly useful for coding agents where you can only change the model name.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.