On an enabled Anthropic model, include singleapi:web_fetch and exactly one HTTPS URL in the latest user message. The model can read that page and return an answer with citations. Check supported_tools in GET /v1/models before using this feature.
Send a fetch request
With client and model_id configured as in the quickstart, select an Anthropic model that advertises fetch support:
response = client.chat.completions.create(
model=model_id,
messages=[{"role": "user", "content": "Summarise https://docs.python.org/3/tutorial/ and cite the page."}],
max_tokens=1024,
extra_body={"tools": [{
"type": "singleapi:web_fetch",
"max_uses": 1,
"max_content_tokens": 8192,
}]},
)
print(response.choices[0].message.content)
details = response.model_dump()
print(details.get("hosted_tool_usage"))
print(details["choices"][0]["message"].get("citations"))Limits and billing
Use the model's published fetch limits. The current API supports automatic tool choice and non-streaming text responses. Fetch cannot be mixed with search or client functions. The URL must appear in the latest user message; an optional allowed_domains list must include the URL's host or a parent domain. Inaccessible pages and provider refusals can produce tool errors.
max_content_tokens approximately caps fetched text, but does not cap PDFs. Anthropic has no separate fetch fee; fetched content still counts as input tokens. Managed fetch requests can temporarily hold the remaining model context cost before settling actual provider usage. BYOK uses your provider account and has zero SingleAPI charge. See BYOK and the API reference.