---
title: "It can pay for its own compute, memory and storage · Tempo AI Platform docs"
description: "How sandboxes, GPUs, browsers, values, files and repositories are bought, scoped to a wallet and billed by the second or the call."
url: "https://gateway.tempo-dev.workers.dev/docs/guides/resources"
---

> 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 can pay for its own compute, memory and storage

Sandboxes, GPUs, browsers, values, files and git repositories are each a set of routes over the provider best at it. They share one path: the request is checked, priced and paid before it runs, and what it creates belongs to the wallet that paid, in one app. The agent buys them from a cell the way you do from curl.

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

## Architecture

```text
a cell, your code or an MCP client
  |  compute_create, kv_set, git_commit, browser_create ...
  v
Worker:  validate -> price -> pay -> operation(env, tenant, input)
                                       tenant = (chain, wallet, app)
  |
  +---------+-----------+-----------+-----------+-----------+
  v         v           v           v           v           v
 E2B       Modal       Browserbase  D1          R2          code.storage
 sandboxes GPUs and    Chromium     kv values   bucket      git repos
 over MPP  images,     over MPP                 files       over MPP
           over gRPC
```

One path for every resource: validate, price, pay, then an operation scoped to the tenant, over the provider that serves it.

| Resource        | Provider and how the gateway reaches it                                                                                                                                                                            |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Sandboxes       | E2B first, Modal for what E2B cannot do. E2B is bought from its MPP proxy and driven through each sandbox's own daemon; Modal through its control-plane gRPC API, which the Worker speaks itself over TLS sockets. |
| GPUs and images | Modal: T4 to B200, up to eight, any registry image with apt and pip layers, snapshots and volumes, wherever Modal has capacity at its base rate, or in a region you name.                                          |
| Browsers        | Browserbase's Chromium, bought from its MPP service in prepaid minutes. The gateway keeps the session id and hands out the CDP connect URL.                                                                        |
| Key-value       | JSON values in Cloudflare D1, with versions for compare-and-swap, prefixes and a TTL.                                                                                                                              |
| Files           | Objects in Cloudflare R2 under chain/wallet/app/key, with their content type, ETag and ranges.                                                                                                                     |
| Git             | Repositories on code.storage, bought from Code Storage's MPP service. The gateway keeps each repository's token and commits, reads and diffs over code.storage's API, or hands out a remote for plain git.         |

## The path every call takes

1. **Validate.** The body is checked before anything is charged, so a malformed request answers 400 and costs nothing.
2. **Price.** Flat per call, per second for a lease, or the provider's own quote: an E2B sandbox's price is the amount E2B's own 402 asks for that request.
3. **Pay.** The key signs a voucher on its session channel, or an MPP client sends one. [Sessions](https://gateway.tempo-dev.workers.dev/docs/guides/tools.md#sessions)
4. **Scope.** The operation runs as a function of `(env, tenant, input)`, where the tenant is the chain, the wallet that paid and the `Gateway-App`. Every D1 query filters on all three and every R2 key starts with them, so another wallet's or app's item is simply not there: `not_found`.
5. **Buy upstream.** When the provider is itself an MPP service, as E2B, Browserbase and Code Storage are, a key pays it from its own wallet where its scopes allow and is charged nothing more; otherwise the platform's treasury pays it and the caller is charged the same amount.

The MCP tools and the `/v1` routes are adapters over the same functions, so a sandbox started from a cell, from curl or from Claude Code costs the same and lands in the same place. [The MCP server](https://gateway.tempo-dev.workers.dev/docs/guides/mcp.md)

## Compute

### Leases

A sandbox is paid ahead, by the second. `compute_create` pays its first lease (300 s unless you ask for less) at the sandbox's rate, `compute_renew` pays more seconds up to its timeout, and a sandbox nobody renews ends: E2B stops it at the paid time, and for Modal the cron terminates it 15 s after. A client that stops renewing stops paying.

```text
create  pays lease seconds ......|
renew   pays more, up to timeout .........|
                                 paidUntil  +15 s: the cron ends it
terminate  ends it now; Modal credits the unused seconds back
```

A lease: paid seconds, renewals up to the timeout, and the end when nobody renews.

`compute_terminate` ends a sandbox at once. A Modal sandbox's unused seconds are credited back to the channel that paid them; E2B refunds nothing, so its lease is what it costs.

### Choosing the provider

`provider: auto`, the default, picks E2B, which costs less (its base template, 2 vCPU and 512 MiB, about $0.10 an hour), unless the request needs Modal: a GPU, an image, apt or pip layers, a snapshot, a volume, a region, or more CPU or memory than an E2B template has. A Modal sandbox without a GPU runs in the Modal region nearest the Cloudflare location that served the request, at Modal's rate for that region, so an agent, its sandbox and the object that drives it end up near each other. A GPU sandbox runs wherever Modal has capacity, at its base rate without the region multiplier, unless `region` names one.

### Running commands

A Modal sandbox has a `Machine` Durable Object that keeps an HTTP/2 connection open to the Modal worker running it, so a `compute_exec` costs two round trips once that connection is warm: `true` went from 546 ms to 102 to 198 ms at the median, measured from a Mac on 2026-10-30. An E2B sandbox runs each command through its own daemon over HTTPS. Either becomes a hand with `attach`, with nothing installed in it: the `Machine` object runs the hand, and on Modal sends its commands through one shell in the sandbox that reads a command per line, one round trip each. [Machines](https://gateway.tempo-dev.workers.dev/docs/machines.md#how)

### Browsers

`browser_create` buys Browserbase minutes, 5 to 360, at $0.12 an hour, and answers a Chrome DevTools URL for Playwright or Puppeteer and a live view for a person. Both are secrets; the Browserbase session id never leaves the gateway, because Browserbase's own status and close take nothing else.

## Memory and storage

- **Everything expires**\
  Every value, file and repository has an expiry, 90 days at most, and reads treat an expired item as missing. `kv_set` without a `ttl` keeps a value for the longest.
- **Private until you say**\
  An owner makes one item public at a time, and anyone reads it free under `/p/:owner/:app/`, clones included. A private, expired or missing item answers the same 404, so a private name cannot be probed. [Public reads](https://gateway.tempo-dev.workers.dev/docs/memory.md#public)
- **Shared with grants**\
  A grant lets another wallet or a team read or write one key, a prefix or a whole kind in an app. A grantee names the owner with `Gateway-Owner`, still pays for its own calls, and is checked on every one. Grants an access key set end when that key is revoked. [Sharing](https://gateway.tempo-dev.workers.dev/docs/memory.md#sharing)
- **Git without git**\
  Commits, files, logs, diffs and branches are routes, so a cell keeps code with real history without a git client; `git_remote` answers a clone and push URL for a sandbox or a hand that has one.

## What it costs

Read live from `GET /v1/capabilities`, as every price on the platform is.

| Tool           | What it buys                            | Price                                                    |
| -------------- | --------------------------------------- | -------------------------------------------------------- |
| compute_create | A sandbox and its first lease           | $0.001 (the lease at the provider's rate, at least this) |
| compute_exec   | A command, up to 120 s                  | $0.00001                                                 |
| browser_create | A browser for its minutes               | $0.01 ($0.12 an hour, at least this)                     |
| kv_get         | Read a value                            | $0.00001                                                 |
| kv_set         | Write a value                           | $0.0002                                                  |
| bucket_put     | Store a file, up to 8 MiB               | $0.0004                                                  |
| git_create     | A repository, what Code Storage charges | $1                                                       |
| git_commit     | Commit files                            | $0.005                                                   |

## Go deeper

- [Compute](https://gateway.tempo-dev.workers.dev/docs/compute.md): every sandbox, volume and browser route.
- [Memory](https://gateway.tempo-dev.workers.dev/docs/memory.md): kv, bucket, git, public reads and sharing.
- [Pricing](https://gateway.tempo-dev.workers.dev/docs/pricing.md): every price and rate.

[<- It wakes up on its own](https://gateway.tempo-dev.workers.dev/docs/guides/triggers.md) · [It supports every tool ->](https://gateway.tempo-dev.workers.dev/docs/guides/tools.md)
