Web Fetch
Let the model fetch a public URL and read extracted page or PDF content.
Use gonkagate:web_fetch when the model should read a specific public URL. GonkaGate fetches the URL, extracts useful text from HTML, plain text, or PDF content, and passes the result back to the model.
Use Web Search when the model needs to find sources. Use Web Fetch when you already have the URL.
Quick start
export GONKAGATE_API_KEY="gp-your-api-key"
curl https://api.gonkagate.com/v1/chat/completions \
-H "Authorization: Bearer $GONKAGATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3-235b-a22b-instruct-2507-fp8",
"messages": [
{
"role": "user",
"content": "Summarize the page at https://example.com/article."
}
],
"tools": [
{ "type": "gonkagate:web_fetch" }
]
}'How it works
- Add
{ "type": "gonkagate:web_fetch" }totools. - The model decides which URL from the conversation it needs to fetch.
- GonkaGate fetches the public URL and extracts readable content.
- The extracted result is returned to the model as tool output.
- The model uses that content to answer normally in
choices[0].message.content.
Configuration
{
"tools": [
{
"type": "gonkagate:web_fetch",
"parameters": {
"max_uses": 5,
"max_content_tokens": 20000,
"allowed_domains": ["docs.example.com"],
"blocked_domains": ["private.example.com"]
}
}
]
}| Parameter | Type | Default | Description |
|---|---|---|---|
engine | string | auto | Optional compatibility value. Supported values are auto and openrouter. Omit this unless you are migrating a request that already sends it. |
max_uses | integer | 5 | Maximum fetch calls in one request. Valid range: 1 to 50. |
max_content_tokens | integer | 20000 | Approximate maximum content returned to the model from each fetch. Valid range: 1 to 100000. Longer content is truncated. |
allowed_domains | string[] | none | If set, only these domains and their subdomains can be fetched. |
blocked_domains | string[] | none | If set, these domains and their subdomains are rejected. |
Domain filtering
Use allowed_domains when the request should stay inside a known docs site or product domain.
{
"tools": [
{
"type": "gonkagate:web_fetch",
"parameters": {
"allowed_domains": ["docs.gonkagate.com", "github.com"]
}
}
]
}Domains are matched against the exact domain and subdomains. For example, example.com also allows docs.example.com.
Supported URLs and content
- URLs must be absolute
http://orhttps://URLs. - URLs with embedded credentials are rejected.
- Private, local, or non-public network targets are rejected.
- HTML, plain text, and PDFs are supported.
- Very large or unsupported responses can fail before the model receives content.
stream: trueis not supported withgonkagate:web_fetch.- If you also provide user-defined function tools, the model must not call Web Fetch and your function tool in the same assistant turn.
Tool result
The model receives a tool result like this. Your application normally sees only the final model answer, not this raw object, unless the model includes details from it.
{
"url": "https://example.com/article",
"title": "Article title",
"content": "Extracted page text...",
"content_type": "text/html; charset=utf-8",
"http_status": 200,
"status": "completed",
"retrieved_at": "2026-06-29T12:00:00.000Z"
}If a fetch fails, the model receives a failed tool result:
{
"url": "https://example.com/missing",
"status": "failed",
"error": "HTTP 404: Not Found",
"retrieved_at": "2026-06-29T12:00:00.000Z"
}Usage
When Web Fetch runs, the response can report fetch count in usage.server_tool_use.web_fetch_requests. Fetched content is also part of the model context, so it can affect normal token usage.
Common errors
| Error code | What it means | Fix |
|---|---|---|
unsupported_server_tool | gonkagate:web_fetch was used with stream: true, or the request used an unknown gonkagate:* tool. | Omit stream or set stream: false; use a supported tool type. |
invalid_server_tool_parameters | A parameter has the wrong type, range, or unsupported name. | Use only the parameters listed on this page. |
invalid_server_tool_call | The model tried to call Web Fetch and a user-defined function tool in the same assistant turn. | Split the task so the model fetches first, then calls your function tool in a later turn. |
server_tool_limit_exceeded | The model tried to fetch more URLs than max_uses. | Raise max_uses within the allowed range or narrow the prompt. |
See also
- Server Tools Overview
- Web Search when the model should find sources first.
- PDF Inputs Plugin when your request includes PDF files directly.
- Chat Completions API reference for the full request schema.