pay.sh docs
Using pay

Pass-through commands

Wrap HTTP clients and agent CLIs while pay handles HTTP 402 payment challenges.

Pass-through commands keep the tool you already know in charge of the request shape. pay runs the tool, detects HTTP 402 challenges, builds a payment proof, then retries with the same URL, method, headers, and body.

Agent summary

  • Preserve the original provider URL exactly.
  • Use curl for general HTTP requests.
  • Use claude or codex when the agent should discover and call paid APIs.
  • Use --sandbox for tests and examples.
  • Use --debugger only when inspecting the payment exchange.

HTTP clients

pay --sandbox curl https://payment-debugger.vercel.app/mpp/quote/AAPL
pay --sandbox curl https://example.gateway/v1/search \
  -H 'content-type: application/json' \
  -d '{"query":"test"}'
pay --sandbox wget https://example.gateway/v1/export.csv
pay --sandbox http POST https://example.gateway/v1/search query=test

All arguments after curl, wget, or http are forwarded to the underlying tool.

Built-in fetch

pay --sandbox fetch https://payment-debugger.vercel.app/mpp/quote/AAPL

pay fetch is not a pass-through command; it uses pay's built-in HTTP client. Use it when the environment should not depend on an external curl, wget, or HTTPie binary.

Agent sessions

pay --sandbox claude
pay --sandbox codex
pay --sandbox --debugger claude

Agent commands attach Pay MCP tools to the session. The agent can search the provider catalog, inspect endpoints, check balances, and call paid APIs through pay's 402-aware curl tool.

Inspect the active account

pay whoami
pay account list

Use whoami or account list before assuming a mainnet account exists.

On this page