Features / Agent tools

Web search, fetch, MCP and code. Run inside one API call.

Declare web search, web fetch, a remote MCP server or a code sandbox in any chat request; the gateway runs the tool loop and returns one answer with citations.

What it does

Web search
The model searches the web and reads the results. Narrow it with allowed_domains or blocked_domains, max_results and max_uses.
Web fetch
The model opens a URL and reads the page as text. Private, loopback and internal addresses are refused, and every redirect is checked again.
Remote MCP tools
Point the request at any Streamable HTTP MCP server with your own headers and an allowed_tools list. Hosted agents can attach MCP servers too.
Code sandbox
Bash and JavaScript in an isolated container with no network. A session_id keeps files between requests.
One answer, every round on the receipt
Each model round is billed and receipted as its own request; x-uplink-tool-calls, x-uplink-tool-charge and x-uplink-total-charge add them up.
Your balance protects you
Tool fees are held before each batch and refused with a 402 when the balance, the key’s budget or its limit cannot cover them. A tool error goes back to the model, never as an HTTP error.

Pricing · live catalog, 2026-11-04

ToolDeclare asPrice
Web searchuplink:web_search$0.01 per search
Web fetchuplink:web_fetch$0.001 per fetch
Code sandboxuplink:code_execution$0.05 per container-hour, 60 s minimum per call
Remote MCP toolsuplink:mcp$0.00 per call
Each model roundclaude-sonnet-5-5$1.20 in · $3.00 out per 1M tokens

Request example

curl · search and fetch
curl https://api.uplinkswitch.com/v1/chat/completions \
  -H "Authorization: Bearer $UPLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "messages": [{"role": "user", "content": "What changed in the latest Node.js release? Cite your sources."}],
    "tools": [
      {"type": "uplink:web_search"},
      {"type": "uplink:web_fetch"}
    ],
    "max_tool_rounds": 4
  }'
Python · code sandbox
from openai import OpenAI

client = OpenAI(base_url="https://api.uplinkswitch.com/v1", api_key="sk-uplink-live-...")

res = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Sum the primes under 10,000 and show the code you ran."}],
    tools=[{"type": "uplink:code_execution", "session_id": "report-42"}],
)
print(res.choices[0].message.content)
curl · remote MCP, Responses
curl https://api.uplinkswitch.com/v1/responses \
  -H "Authorization: Bearer $UPLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "input": "Open the three newest issues and summarize them.",
    "tools": [{
      "type": "mcp",
      "server_label": "tracker",
      "server_url": "https://mcp.example.com/mcp",
      "headers": {"Authorization": "Bearer YOUR_SERVER_TOKEN"},
      "allowed_tools": ["list_issues", "get_issue"],
      "require_approval": "never"
    }]
  }'
Python · Anthropic SDK
import anthropic

client = anthropic.Anthropic(base_url="https://api.uplinkswitch.com/v1", api_key="sk-uplink-live-...")

msg = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Find this week's TypeScript release notes."}],
    tools=[{"type": "web_search_20250305", "name": "web_search", "max_uses": 3}],
)
  • The answer is the format’s normal response. Headers x-uplink-tool-calls, x-uplink-tool-rounds and x-uplink-total-charge carry the count and the cost.
  • With stream: true the tool rounds run first and the final answer streams in the format’s own events.
  • Prices for every tool are public JSON at GET /v1/catalog, under server_tools.

Questions

A tool the gateway runs for the model inside your request. When the model calls web search, web fetch, an MCP tool or the sandbox, the gateway runs it, hands the result back to the model and asks again, until the model answers in text or the round limit is reached. Your code sends one request and gets one answer.

$0.01 per search, plus the model's tokens for each round at its catalog price. Fetching a page is $0.001 per fetch.

Any chat model in the catalog that takes tool calls, in the OpenAI Chat Completions, Responses and Anthropic Messages formats. Declare the tool in the format you already use: OpenAI’s web_search, code_interpreter and mcp types, Anthropic’s web_search_20250305, web_fetch_20250910, code_execution_20250825 and mcp_servers, or the uplink: types.

bash and javascript and python, with no network access. Pass the same session_id on the tool to keep the sandbox's files between requests. It bills $0.05 per container-hour with a 60 second minimum per call.

Up to 8 by default. Set max_tool_rounds in the body, or the x-uplink-max-tool-rounds header, to any whole number from 1 to 8. After the last round the model is asked once more without tools, so the answer ends in text.

Yes, in each format’s own shape: url_citation annotations on Chat Completions, citations and server_tool_use blocks on Messages, and web_search_call, mcp_call and code_interpreter_call items on Responses.