> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Tempo MPP

> The simplest way to make paid API calls — one function call handles the entire 402 payment flow.

Tempo Machine Payment Protocol (Tempo MPP) is the simplest way to make paid API calls to Allium. The `Client` wrapper handles the entire 402 negotiation, signing, and retry flow — you just make requests as normal.

## Quickstart with Agent

The fastest way to get started — let your AI agent handle setup and payments for you.

<Steps>
  <Step title="Install allium-cli">
    ```bash theme={null}
    curl -sSL https://agents.allium.so/cli/install.sh | sh
    ```

    <Warning>
      [allium-cli](https://github.com/Allium-Science/allium-cli) is still in early beta.
    </Warning>
  </Step>

  <Step title="Install agent skills">
    ```bash theme={null}
    npx skills add allium-labs/skills --yes
    ```
  </Step>

  <Step title="Open your agent">
    Start Claude Code, Codex, or any compatible AI agent.
  </Step>

  <Step title="Ask a question">
    ```
    Set up Allium and fetch the latest balances for vitalik.eth
    ```
  </Step>
</Steps>

## How It Works

<Steps>
  <Step title="Send request">
    Make an API request using the Tempo `Client`.
  </Step>

  <Step title="Client handles 402">
    The client automatically receives the `402 Payment Required` response, signs a USDC payment authorization, and retries the request.
  </Step>

  <Step title="Get data">
    You receive your data with a `200` response. The payment flow is invisible to your code.
  </Step>
</Steps>

## Supported Tokens & Networks

Tempo MPP payments use **USDC** on the Tempo network:

| Network             | USDC Contract Address                        |
| ------------------- | -------------------------------------------- |
| **Tempo** (mainnet) | `0x20c000000000000000000000b9537d11c60e8b50` |

## Implementation

### Install

```bash theme={null}
pip install "pympp[tempo]"
```

### Set Up Your Account

Create a `TempoAccount` from your private key. This account will sign payments on your behalf.

```bash theme={null}
export YOUR_PRIVATE_KEY="your-eth-private-key"
```

### Make a Paid API Call

```python theme={null}
from mpp.client import Client
from mpp.methods.tempo import tempo, TempoAccount, ChargeIntent
from mpp.methods.tempo._defaults import TESTNET_RPC_URL, TESTNET_CHAIN_ID
import os

account = TempoAccount.from_key(os.getenv("YOUR_PRIVATE_KEY"))

async with Client(methods=[
    tempo(
        account=account,
        rpc_url=TESTNET_RPC_URL,
        intents={"charge": ChargeIntent()},
    )
]) as client:
    response = await client.post(
        "https://agents.allium.so/api/v1/developer/prices",
        json=[{"chain": "solana", "token_address": "So11111111111111111111111111111111111111112"}],
    )
    print(response.json())
```

The `Client` intercepts the `402` response, constructs and signs the payment using your `TempoAccount`, and retries the request automatically. You just see the final `200` response with your data.
