Skip to main content
Beta
BetaServer tools are currently in beta. The API and behavior may change.
The openrouter:web_fetch server tool gives any model the ability to fetch content from a specific URL. When the model needs to read a web page or PDF document, it calls the tool with the URL. OpenRouter fetches and extracts the content, returning text that the model can use in its response.

How It Works

  1. You include { "type": "openrouter:web_fetch" } in your tools array.
  2. Based on the user’s prompt, the model decides whether it needs to fetch a URL and generates the request.
  3. OpenRouter fetches the URL using the configured engine (defaults to auto, which uses native provider fetch when available or falls back to Exa).
  4. The page content (text, title, and URL) is returned to the model.
  5. The model incorporates the fetched content into its response. It may fetch multiple URLs in a single request if needed.

Quick Start

Configuration

The web fetch tool accepts optional parameters to customize behavior:

Engine Selection

The web fetch server tool supports multiple fetch engines:
  • auto (default): Uses native fetch if the provider supports it, otherwise falls back to Exa
  • native: Prefers the provider’s built-in web fetch; falls back to the openrouter engine if the model doesn’t support native fetch. When a workspace admin has set an engine list on the Server Tools page, the fallback is the first non-native engine in that list instead; a list of only native rejects the request with a 403 on models without native fetch
  • exa: Uses Exa’s Contents API to extract page content (supports BYOK)
  • openrouter: Uses direct HTTP fetch with content extraction
  • firecrawl: Uses Firecrawl’s scrape API (BYOK, bring your own key)
  • parallel: Uses Parallel’s extract API for high-quality content extraction

Engine Capabilities

Firecrawl (BYOK)

Firecrawl uses your own API key. To set it up:
  1. Go to your OpenRouter plugin settings and configure your Firecrawl API key
  2. Your Firecrawl account is billed separately from OpenRouter

Hard Limits

To prevent runaway costs:
  • Exa engine: No hard limit (billed via API credits)
  • Parallel engine: No hard limit (billed via API credits)
  • Firecrawl engine: No hard limit (uses your Firecrawl credits)
  • OpenRouter/native engines: Hard limit of 50 fetches per request

Domain Filtering

Restrict which domains can be fetched using allowed_domains and blocked_domains:
When allowed_domains is set, only URLs from those domains will be fetched. When blocked_domains is set, URLs from those domains will be rejected.

Content Truncation

Use max_content_tokens to limit the amount of content returned:
Content exceeding this limit is truncated. This is useful for controlling context window usage when fetching large pages.

Works with the Responses API

The web fetch server tool also works with the Responses API:

Response Format

When the model calls the web fetch tool, it receives a response like:
If the fetch fails, the response includes an error:

Workspace Settings

Workspace admins can set an engine list, allowed domains, and blocked domains for openrouter:web_fetch on the workspace’s Server Tools page. Each tool entry is either locked or a default:
  • Locked (the default when the entry is created): requests and presets in the workspace are limited to these settings. A request that names an engine outside the list, or whose domain list has no overlap with the workspace’s, is rejected with a 403.
  • Default (“Prevent overrides” off): the settings fill in what a request leaves unset. A request that names its own engine keeps it, and a request that sets either domain list (an empty list counts) keeps its lists as sent; the workspace domain lists are used only when the request sets neither.
In both modes a request with no engine (or engine: "auto") runs the workspace’s Default engine, and a native request on a model without native fetch runs its Native fallback engine (see the native row under Engine Selection). Both are stored at the head of the engine list: the default first, then the fallback. Settings on the workspace’s Plugins tab do not apply to server tools.

Pricing

All pricing is in addition to standard LLM token costs for processing the fetched content.

Next Steps