# Prepaid credits

Most MCP clients (Claude, Cursor) can't pay per call. With credits you top up once with USDC and use an API key: each
call deducts its normal price from your balance. Crypto only (USDC on Base or Solana); no cards, no account, no personal data.

**Good to know before you send money:**

- Top-ups are $1 to $500 each.
- A top-up request is open for **48 hours**. Send the exact amount within that time. A transfer that arrives after its
  request expired, or with a different amount, isn't matched automatically: keep the transaction hash and file a refund
  request with your key (step 3); it is reviewed by hand.
- Your key is shown **once** and we only store a hash of it, so we can't show it again. Treat it like a password: a URL
  or config with `?key=` in it can end up in logs, screenshots and shared files, and anyone with the key can spend
  your balance. Prefer the `Authorization: Bearer` header where your client supports it.

## 1. Start a top-up (get your key)

```bash
curl -X POST https://aayatai.com/credits/topup -H "content-type: application/json" -d '{"amountUsd": 5}'
```

You get an **API key (shown once: keep it secret)** and an exact amount such as `5.000437` USDC. Send **exactly** that
amount of USDC on **Base** to the address shown: the unique decimals are how we recognise your payment. It's credited
about 15 minutes after it confirms. To add more later, run the same command with `-H "Authorization: Bearer <key>"`.
The answer also has a `paymentUri` (EIP-681 on Base, Solana Pay on Solana) for wallets; `GET /credits/qr?uri=<paymentUri>`
draws it as a QR code (SVG), and `GET /credits/topup/<topupId>` shows `open`, `paid` or `expired`.
A person without a terminal can do all of this at [https://aayatai.com/credits](https://aayatai.com/credits) in a browser.

**Paying from Solana?** Add `"network": "solana"` and send the exact amount of USDC
(mint `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`) on Solana to the Solana address shown instead:

```bash
curl -X POST https://aayatai.com/credits/topup -H "content-type: application/json" -d '{"amountUsd": 5, "network": "solana"}'
```

## 2. Use it

- **HTTP:** add `Authorization: Bearer <key>` to any call, e.g. `curl -H "Authorization: Bearer <key>" "https://aayatai.com/dns?name=example.com"`.
- **MCP (Claude, Cursor, others):** use `https://aayatai.com/mcp?key=<key>` as the server URL (claude.ai connectors can't send
  headers; keep that URL private), or better, send the Authorization header if your client supports it (Claude Code:
  `--header "Authorization: Bearer <key>"`; Cursor and VS Code: a `headers` entry). Set-up per client: [/mcp/setup](/mcp/setup).

Failed calls are never charged (the price goes back to your balance). Each answer shows your remaining balance, and
warns you when it drops below $1.

## 3. Check your balance, or ask for a refund

```bash
curl -H "Authorization: Bearer <key>" https://aayatai.com/credits/balance
curl -X POST https://aayatai.com/credits/refund -H "Authorization: Bearer <key>" -H "content-type: application/json" -d '{"toAddress": "0xYourBaseAddress"}'
```

Refunds of unused balance are reviewed and sent by hand (usually within 5 working days). See the [terms](/terms).