---
title: "It supports every tool · Tempo AI Platform docs"
description: "How one MPP session channel pays the platform's tools, web search and any paid API, with one transaction to open it."
url: "https://gateway.tempo-dev.workers.dev/docs/guides/tools"
---

> Every page of the Tempo AI Platform is Markdown at its URL with .md, or with Accept: text/markdown. The index of every page is https://gateway.tempo-dev.workers.dev/llms.txt, the API https://gateway.tempo-dev.workers.dev/openapi.json and the MCP server https://gateway.tempo-dev.workers.dev/mcp.

# It supports every tool

Every call on the platform is paid over an MPP session: a payment channel on Tempo, opened once with a deposit, and then a voucher signed off chain for each call. That is what lets a call cost $0.0001, and what lets one key pay the platform's tools, the web and any of the paid APIs on mpp.dev without an account at any of them.

[Get your Tempo Key](https://gateway.tempo-dev.workers.dev/key.md) · [Services reference](https://gateway.tempo-dev.workers.dev/docs/services.md)

## One session, many calls

A Tempo Key opens its channel with the gateway on its first paid request, or any MPP client opens one from its wallet; the gateway sponsors the network fee. After that, the channel is the only thing that touches the chain until it tops up or closes.

```text
                            voucher total    spent
open the channel, 1.00             -           -    one transaction
kv_get, 0.0001                0.0001      0.0001
model call, holds 0.04        0.0401      0.0401
  usage known, refunded       0.0401      0.0063
bucket_put, 0.005             0.0451      0.0113
settle, hourly     the escrow pays the platform 0.0113, on chain
close              0.9887 goes back to the wallet, on chain
```

A channel's life for an MPP client: vouchers carry the running total, spent follows real usage after refunds, and only the open, settlement and close are transactions.

1. **Voucher.** For each call the client signs a voucher for its running total, off chain, with the channel's signer: the wallet, or the access key a Tempo Key holds.
2. **Check.** The gateway verifies it against the channel's state, kept in a `Channels` Durable Object per key and updated by one compare-and-swap: tens of milliseconds and no transaction. A route's 402 can be reused, so a client that already holds the challenge sends its voucher with the first request.
3. **Hold and refund.** A model call does not know its cost in advance, so it holds an amount and gets back what it did not use once its usage is known, also when the client disconnects. A Tempo Key holds close to the call's real cost and pays any overrun after it.
4. **Settle.** The gateway is each channel's operator, so every hour it settles the highest voucher within what was spent, and the escrow moves that much to the platform.
5. **Close.** A close sends what was spent to the platform and the rest of the deposit back to the wallet. A client can close at once with a close credential on any paid route, or ask the escrow to close, which the gateway answers within a minute.

## Any paid API

A cell's `fetch`, `/v1/fetch/:url` and the MCP tool `fetch` are one function. It sends the request, and when the service answers 402 it pays from the key where the key can: a session in the key's own token, or a charge in any of MACH, OUSD, pathUSD and USDC.e, swapping on Tempo's DEX when the wallet holds another stablecoin than the one asked for.

```text
cell fetch(url), POST /v1/fetch/<url> or the MCP tool fetch
  |
  v
the service -> 402 with its challenges: session or charge, in its token
  |
  +- one the key can pay, under Gateway-Max-Usd -> the key signs it
  +- USDC.e only -> charge the key the same amount (agent.fetch),
  |                 then the treasury pays the service, up to $0.25
  +- none -> 402 payment_failed, nothing signed
  v
the service's answer, with Gateway-Paid and Gateway-Payer
```

How a call to a paid API is paid: by the key directly, through the bridge for a USDC.e-only service, or not at all.

- **A ceiling per call**\
  `Gateway-Max-Usd` caps what one call pays the service, 0.25 by default and at most 5. A challenge above it is never signed, and when every challenge is, the call answers 402 `over_limit`.
- **The bridge**\
  A service that takes only USDC.e, when the key cannot pay USDC.e itself, is charged to the key first, the same amount over its session with the gateway, and then the treasury pays the service. The charge comes back only when the treasury's payment never moved, so nobody can drain it by refusing payments.
- **What is sent**\
  Your key and cookies never leave the gateway; `Fetch-Authorization` becomes the service's `Authorization`. Redirects come back as they are, and private addresses, the gateway itself and plain http are refused before anything is charged.
- **The directory**\
  `GET /api/services` relays mpp.dev's list of services, so an agent can find one before it pays.

## Web search

Workers AI and the other providers have no web search of their own, so the model routes run it: OpenAI's `web_search` on `/v1/responses` and Anthropic's `web_search` and `web_fetch` on `/v1/messages` work on any model, and both harnesses search through them.

1. The route gives the model search, open-page and find-in-page functions and calls it.
2. Each web call the model makes is paid to the provider, Tako, then Exa, then Cloudflare's Web Search for a search, by the key from its own wallet where it can, or by the treasury inside the request's charge.
3. The results go back to the model as a tool message, at most 12 KB, for up to 4 rounds and 5 web calls by default; the last round has no web tools, so the model answers.
4. The answer cites each page as a link, which the route turns into citations, and its usage reports the web calls and what they cost.

## What it costs

| Tool                 | What it pays for                                                            | Price                                         |
| -------------------- | --------------------------------------------------------------------------- | --------------------------------------------- |
| web_search           | A search: Tako first, then Exa, then Cloudflare's Web Search when both fail | $0.00025 – $0.012 (what the provider charged) |
| open_page, web_fetch | A page read for the model: Tako, then Exa                                   | $0.001 – $0.002 (what the provider charged)   |
| fetch                | Any https URL, its 402 paid from the key                                    | $0.0001 (plus what the service asks)          |

## Try it

**Any service**

```sh
curl https://gateway.tempo-dev.workers.dev/v1/fetch/https://api.exa.ai/search \
  -H "authorization: Bearer $TEMPO_KEY" \
  -H gateway-app:default \
  -H content-type:application/json \
  -H "gateway-max-usd: 0.05" \
  -d '{"query":"speculative decoding","numResults":5}'
```

**Web search**

```sh
curl https://gateway.tempo-dev.workers.dev/v1/responses \
  -H "authorization: Bearer $TEMPO_KEY" \
  -H gateway-app:default \
  -H content-type:application/json \
  -d '{"model":"@cf/deepseek-ai/deepseek-v4.1-flash-1017","tools":[{"type":"web_search"}],"input":"Who won the last F1 race?"}'
```

**Directory**

```sh
curl https://gateway.tempo-dev.workers.dev/api/services | jq '.services[].name'
```

## Go deeper

- [Services](https://gateway.tempo-dev.workers.dev/docs/services.md): web search and `/v1/fetch` in full.
- [The MPP service](https://gateway.tempo-dev.workers.dev/docs/guides/mpp.md): the 402 and the voucher, from the client's side.
- [mpp.dev](https://mpp.dev): the protocol and its directory of services.

[<- It can pay for its own compute, memory and storage](https://gateway.tempo-dev.workers.dev/docs/guides/resources.md) · [It connects to your tools ->](https://gateway.tempo-dev.workers.dev/docs/guides/connectors.md)
