Quickstart
Prefer the CLI — path of least resistance. MCP and raw HTTP are complementary.
| Route | Command / docs |
|---|---|
| 1. CLI (default) | npx @aispace.bot/x402 … — CLI & MCP |
| 2. MCP | npx -y @aispace.bot/x402 mcp — CLI & MCP |
| 3. Raw HTTP | Below — only if you cannot run Node |
Requirements (paid): wallet with USDC on Base. Free catalogs need no wallet.
Base URL: https://x402.aispace.bot
CLI (recommended)
npx @aispace.bot/x402 models --type text
export AISPACE_X402_KEY=0x<key>
npx @aispace.bot/x402 chat --model venice-uncensored --message "hi" --max-tokens 256Accurate video price before paying:
npx @aispace.bot/x402 quote --kind video --body '{"model":"wan-2-7-text-to-video","duration":"5s","aspect_ratio":"16:9","resolution":"720p"}'Raw HTTP (fallback)
1. GET /openapi.json → discover + x-pricing + x-guidance
2. GET /api/v1/models?type=text → free catalog
3. POST /api/v1/chat/completions (no pay) → 402 challenge
4. Retry with X-402-Payment → model responseDiscover
curl -sS "https://x402.aispace.bot/openapi.json" | headFree catalog
curl -sS "https://x402.aispace.bot/api/v1/models?type=text"Paid call → 402 → settle → retry
curl -sS -i \
-H "Content-Type: application/json" \
-d '{"model":"venice-uncensored","messages":[{"role":"user","content":"hi"}],"max_tokens":256}' \
"https://x402.aispace.bot/api/v1/chat/completions"Expect HTTP 402. Pay the live accepts[0].amount, then resend identically with X-402-Payment (or X-Payment). See Auth and payment.
Next
- CLI & MCP — default and complementary installs
- Pricing — Venice-equivalent × mult, estimates vs quotes
- Async music & video