Quickstart

Prefer the CLI — path of least resistance. MCP and raw HTTP are complementary.

RouteCommand / docs
1. CLI (default)npx @aispace.bot/x402 …CLI & MCP
2. MCPnpx -y @aispace.bot/x402 mcpCLI & MCP
3. Raw HTTPBelow — only if you cannot run Node

Requirements (paid): wallet with USDC on Base. Free catalogs need no wallet.

Base URL: https://x402.aispace.bot

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 256

Accurate 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 response

Discover

curl -sS "https://x402.aispace.bot/openapi.json" | head

Free catalog

curl -sS "https://x402.aispace.bot/api/v1/models?type=text"
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