# camelai.io — x402 API Network

Pay-per-request APIs for AI agents. USDC micropayments on Base, Polygon, or Solana via [x402](https://x402.org) — or buy credits with a credit card via Stripe.

## Services

Each service has its own docs at its domain. Visit any service URL for full API details.

| Service | Domain | Price |
|---------|--------|-------|
| QR Code | [qr.camelai.io](https://qr.camelai.io) | $0.001 |
| Screenshot | [screenshot.camelai.io](https://screenshot.camelai.io) | $0.01 |
| Email Verify | [verify.camelai.io](https://verify.camelai.io) | $0.005 |
| DNS Lookup | [dns.camelai.io](https://dns.camelai.io) | $0.001 |
| Web Scraper | [scraper.camelai.io](https://scraper.camelai.io) | $0.005 |
| Geocoding | [geo.camelai.io](https://geo.camelai.io) | $0.001 |
| Image Resize | [resize.camelai.io](https://resize.camelai.io) | $0.001 |
| URL Shortener | [link.camelai.io](https://link.camelai.io) | $0.001 |
| Image Gen | [imagegen.camelai.io](https://imagegen.camelai.io) | $0.01 |
| Disposable Email | [inbox.camelai.io](https://inbox.camelai.io) | $0.005 |
| SMS Send | [sms.camelai.io](https://sms.camelai.io) | $0.01 |
| PDF to Text | [pdf.camelai.io](https://pdf.camelai.io) | $0.01 |
| GPU | [gpu.camelai.io](https://gpu.camelai.io) | $0.50 |
| VPS / Sandbox | [vps.camelai.io](https://vps.camelai.io) | $0.005–$0.129 |
| Browser Session | [browser.camelai.io](https://browser.camelai.io) | $0.02 |
| Deploy Worker | [deploy.camelai.io](https://deploy.camelai.io) | $0.01 |
| File Upload | [files.camelai.io](https://files.camelai.io) | $0.001 |

## How It Works

1. `POST` to any service with the required JSON fields
2. Receive a `402 Payment Required` response with payment details
3. Sign a USDC payment using your wallet
4. Resend the request with the payment header
5. Get your result

## Quick Start (Node.js — recommended)

### 1. Create a wallet

```js
// npm install viem
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";

const privateKey = generatePrivateKey();
const account = privateKeyToAccount(privateKey);
console.log("Address:", account.address);   // Fund this with USDC on Base
console.log("Private Key:", privateKey);     // Save this securely
```

Fund the address with USDC on Base using the [Base app](https://apps.apple.com/app/base-web3-wallet/id1278383455) or any wallet. $5–$10 is plenty.

### 2. Make requests

```js
// npm install @x402/fetch @x402/evm viem
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY);
const client = new x402Client();
registerExactEvmScheme(client, { signer });
const pay = wrapFetchWithPayment(fetch, client);

const res = await pay("https://qr.camelai.io", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ text: "https://example.com" }),
});
```

### Shell alternative: purl

[purl](https://github.com/stripe/purl) is a curl-like CLI with built-in x402 support. Import the wallet you created above:

```bash
# Install (pick one)
brew install stripe/purl/purl   # macOS
cargo install purl               # or via Rust

# Import the wallet you created above
purl wallet add --type evm --name my-agent --private-key $WALLET_PRIVATE_KEY --password mypass --set-active=true

# Make requests
purl --password mypass -X POST -d '{"text": "https://example.com"}' https://qr.camelai.io
```

## Payment Options

**x402 (USDC)** — sign a micropayment per request. Works on Base, Polygon, or Solana. No account needed.

**Stripe (Credit Card)** — [buy credits](https://camelai.io/checkout?amount=5) ($5 / $20 / $100), get an API key, add `Authorization: Bearer <key>` to requests.

## Details

- **Networks:** Base, Polygon, Solana — all USDC
- **Facilitator:** Coinbase CDP (fee-free)
- **OpenAPI:** Each service exposes `/.well-known/openapi.json`
- **Service Index:** [/.well-known/services.json](https://camelai.io/.well-known/services.json)

Built by [camelAI](https://github.com/qaml-ai)
