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

# Pay Per Call

> Pay for single API calls in USDC on Base with the x402 protocol, with no subscription.

Without a subscription you can pay for one call at a time. The payment travels on the HTTP request itself, using [x402](https://x402.org), in USDC on Base. No card and no plan needed.

Payment starts once your free questions are used up: 10 to start, then 1 per day. A call that fails on Shumi's side is never charged, because settlement runs only after a successful response.

## Check the price

| Call | Price |
| - | - |
| A data call: `coin`, `market`, `funding`, `regime`, `signal`, `scan` and the rest | 0.005 USDC |
| A plain-word question (`shumi ask`, `POST /api/cli`) | 0.05 USDC |
| `pairs` and `walkforward` | 0.05 USDC |
| `watch` live streams | No per-call price |

`GET https://api.shumi.ai/api/cli/manifest` lists the priced routes with their price.

## Set up a wallet

<Steps>
  <Step title="Create a wallet">
    ```bash theme={"dark"}
    shumi wallet create
    ```

    A wallet on your machine, encrypted with a passphrase you choose. It only pays and is separate from the account you signed in with.
  </Step>

  <Step title="Fund it with USDC on Base">
    ```bash theme={"dark"}
    shumi wallet address
    shumi wallet fund --amount 25
    ```

    Send USDC on Base to the address, or open the link `wallet fund` prints to buy USDC with a card. You need no ETH for gas.
  </Step>

  <Step title="Check the balance">
    ```bash theme={"dark"}
    shumi wallet balance
    ```
  </Step>
</Steps>

## Pay from the terminal

The next priced command asks before it pays:

```
💸 Shumi needs 0.005 USDC on Base to run `shumi coin risk DOGE`.
   From  0xD1C8…6f99 (balance 4.83 USDC)
   To    0xc624…b394
   Pay? [Y/n]
```

Check the recipient before you answer. Enter or `y` pays and runs the command. `n` stops with `Payment declined` and nothing is charged.

To pay without a prompt, add `--auto-pay` or set `SHUMI_AUTO_PAY=1`. `--agent` implies it. Three variables control unattended payment:

| Variable | Default | What it does |
| - | - | - |
| `SHUMI_MAX_PRICE_USDC` | `0.10` | Ceiling per call. A higher price is refused |
| `SHUMI_DAILY_USDC_CAP` | `1.00` | Ceiling per UTC day, so a looping agent cannot drain the wallet |
| `SHUMI_X402_PRIVATE_KEY` | none | Sign with this key instead of the encrypted wallet. Needed for `--agent` runs, which cannot type a passphrase |

`shumi wallet receipts` lists your last 20 payments, with `--since`, `--until` and `--export csv`.

## Pay from your own code

A priced route answers `402 Payment Required` with an x402 challenge instead of the usual envelope:

```json theme={"dark"}
{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "base",
    "maxAmountRequired": "5000",
    "resource": "https://api.shumi.ai/api/cli/coin/risk/DOGE",
    "payTo": "0x...",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "maxTimeoutSeconds": 60,
    "extra": { "name": "USD Coin", "version": "2" }
  }]
}
```

`maxAmountRequired` is in USDC's smallest unit. USDC has six decimals, so `5000` is 0.005 USDC.

<Steps>
  <Step title="Sign">
    Sign an EIP-3009 `transferWithAuthorization` for `maxAmountRequired` to `payTo`.
  </Step>

  <Step title="Resend">
    Repeat the request with the signed payload in the `X-PAYMENT` header.
  </Step>

  <Step title="Read the receipt">
    Shumi runs the call, settles on chain and returns the settlement in `X-PAYMENT-RESPONSE` (x402 v1). Newer x402 v2 servers use `PAYMENT-RESPONSE`, so read either. A failed call settles nothing.
  </Step>
</Steps>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.