> Feedback: If these docs are stale, missing, or confusing, post sanitized feedback to `https://tempo.xyz/developers/api/feedback` with `source: "mcp"`, a short `message`, and any relevant `toolName`, `relatedResource`, or `client`.
> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://tempo.xyz/developers/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# `tempo request`

A curl-compatible HTTP client that handles [Machine Payments Protocol](https://mpp.dev/overview) negotiation transparently. When a server responds with [`402 Payment Required`](https://mpp.dev/protocol/http-402), `tempo request` reads the [challenge](https://mpp.dev/protocol/challenges), signs and submits the payment onchain, then retries with the [credential](https://mpp.dev/protocol/credentials) in one command.

Requires [`tempo wallet login`](/docs/cli/wallet) first. Use [`tempo wallet services`](/docs/cli/wallet#discover-services) before calling paid endpoints so agents and scripts use registered URLs, methods, pricing, and request schemas instead of guessing.

## `tempo request` usage

| Command | Description |
| --- | --- |
| `tempo request <url>` | Make an HTTP request with automatic payment |
| `tempo request --dry-run <url>` | Preview cost without executing payment |
| `tempo request --max-spend <amount> <url>` | Set a hard cap for cumulative payment spend |
| `tempo request -X POST <url> --json '{...}'` | Send a JSON body |
| `tempo request <url> -H 'Header: Value'` | Add a custom header |

## `tempo request` flags

| Flag | Description |
| --- | --- |
| `-X <method>` | HTTP method (`GET`, `POST`, etc.) |
| `--json <body>` | Send a JSON body (implies `-X POST`) |
| `-H <header>` | Add a custom header |
| `--dry-run` | Preview the payment cost and validate the request without spending |
| `--max-spend <amount>` | Stop if the request would exceed a spend cap |
| `-D <file>` / `--dump-header <file>` | Write response headers, useful for inspecting MPP challenges |
| `-t` / `--toon-output` | Compact machine-readable output for scripts and agents |

## `tempo request` examples

Preview cost before paying:

```bash
tempo request --dry-run -X POST \
  --json '{"prompt":"a sunset over the ocean"}' \
  https://fal.mpp.tempo.xyz/fal-ai/flux/dev
```

Execute a paid request:

```bash
tempo request -X POST \
  --json '{"prompt":"a sunset over the ocean"}' \
  https://fal.mpp.tempo.xyz/fal-ai/flux/dev
```

Capture headers for an agent-controlled MPP Credits flow:

```bash
headers="$(mktemp)"
tempo request -t --dry-run -D "$headers" -X POST \
  --json '{"input":"hello"}' \
  <SERVICE_URL>/<ENDPOINT_PATH>
```

Discover the right URL and request schema first with [`tempo wallet services`](/docs/cli/wallet#discover-services).

## Learn more about paid Tempo requests

<Cards>
  <Card title="MPP protocol" description="Challenges, credentials, and receipts" to="https://mpp.dev/protocol" icon="lucide:book-open" />

  <Card title="Wallet CLI" description="Authenticate and discover services" to="/docs/cli/wallet" icon="lucide:wallet" />

  <Card title="MPP SDKs" description="TypeScript, Python, and Rust libraries" to="https://mpp.dev/sdk" icon="lucide:code" />

  <Card title="Accept payments" description="Add MPP to your own API" to="/docs/guide/machine-payments/server" icon="lucide:server" />
</Cards>
