> ## 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.

# Machine Payments

> Pay-per-call blockchain data access with USDC — no API key, no registration, no subscription.

Machine payments let AI agents and developers pay per API call with USDC to access Allium's blockchain data. No API key, no registration, no subscription — just a wallet and USDC.

<CardGroup cols={2}>
  <Card title="No API Key" icon="key">
    No registration or key management. Your wallet is your identity.
  </Card>

  <Card title="Pay Per Call" icon="credit-card">
    Only pay for what you use. Prices start at \$0.001 per request.
  </Card>

  <Card title="Agent-Native" icon="robot">
    Built for AI agents — autonomous payments with no human in the loop.
  </Card>

  <Card title="Gasless Payments" icon="coins">
    Allium handles onchain settlement. Users only need USDC, not ETH.
  </Card>
</CardGroup>

## How It Works

Both protocols use HTTP status code `402 Payment Required` to negotiate payments inline with API requests. The difference is how much your client handles automatically.

<Steps>
  <Step title="Send request">
    Make a normal API request to any payment-enabled endpoint.
  </Step>

  <Step title="Receive 402">
    The server responds with `402 Payment Required` and payment options.
  </Step>

  <Step title="Sign and pay">
    Your client signs a USDC payment authorization and retries the request.
  </Step>

  <Step title="Get data">
    Payment confirmed — you receive your data with a `200` response.
  </Step>
</Steps>

## Tempo MPP

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

```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())
```

<Card title="Tempo MPP" icon="bolt" href="/ai/machine-payments/tempo-mpp">
  Full setup guide, supported networks, and implementation details
</Card>

## x402

x402 gives you full manual control over the payment flow. Your client receives the 402 response, constructs EIP-712 typed data, signs it via a wallet provider like [Privy](https://dashboard.privy.io), and retries with the payment signature attached.

<Card title="x402" icon="credit-card" href="/ai/machine-payments/x402">
  Full setup guide with Privy wallet integration, EIP-712 signing, and implementation
</Card>

## Agent Integration

Don't want to write any payment code? Install pre-built agent skills and let your AI agent handle everything:

```bash theme={null}
npx skills add allium-labs/skills --yes
```

<Card title="Agent Skills" icon="wand-magic-sparkles" href="/ai/machine-payments/agent-skills">
  Set up machine payments with AI agents in one command
</Card>

## All Endpoints & Pricing

<Card title="Endpoints & Pricing" icon="code" href="/ai/machine-payments/endpoints-pricing">
  All payment-enabled endpoints, pricing, rate limits, and error codes
</Card>
