Ax402Docs
FOR AGENTS

CLI reference

Full ax402 command reference

The ax402 CLI automates control-plane operations from shell scripts and CI. Same routes as the TypeScript SDK. Agent quick start: Agent guide .

Build and run

# From ax402-sdk monorepo
pnpm install
pnpm --filter @axlabs/ax402-cli build
node tools/cli/dist/index.js apis list --json
# Or via package script
pnpm --filter @axlabs/ax402-cli start -- apis list --json

Package is workspace-only today — build from the ax402-sdk repository.

Global flags

  • --json — JSON output on any command

Environment

  • AX402_BASE_URL — control plane (default http://api.localhost:8090)
    • AX402_API_KEY — scoped API key for automation
    • AX402_JWT — alternative to API key (interactive)
    • AX402_EVM_PRIVATE_KEY — buyer signing for pay url

Command reference

apis

ax402 apis list [--json]
ax402 apis create --name NAME --slug SLUG --upstream URL [--pay-to 0x...] [--json]
ax402 apis get --id ID [--json]
ax402 apis update --id ID [--name NAME] [--slug SLUG] [--upstream URL] [--pay-to 0x...] [--json]
ax402 apis delete --id ID [--json]

endpoints

ax402 endpoints list --api-id ID [--json]
ax402 endpoints create --api-id ID --path "/v1/*" [--method GET] [--price-usdc 0.10] [--scheme exact|batch-settlement] [--json]
ax402 endpoints update --api-id ID --endpoint-id EP [--enabled true|false] [--json]
ax402 endpoints delete --api-id ID --endpoint-id EP [--json]

domains

ax402 domains suggest --apex example.com [--prefix x402] [--json]
ax402 domains add --api-id ID --hostname HOST [--json]
ax402 domains list --api-id ID [--json]
ax402 domains verify --api-id ID --domain-id ID [--json]
ax402 domains delete --api-id ID --domain-id ID [--json]

keys

ax402 keys list [--json]
ax402 keys create --name NAME --scopes apis:read,apis:write [--json]
ax402 keys revoke --id ID [--json]

auth

ax402 auth login --email EMAIL --password PASS [--json]
ax402 auth me [--json]

openapi

ax402 openapi parse --file PATH [--json]
ax402 openapi import --api-id ID --file PATH [--price-usdc 0.10] [--json]

stats / settlements / batch

ax402 stats overview [--days 30] [--json]
ax402 stats api --api-id ID [--days 30] [--json]
ax402 settlements list --api-id ID [--json]
ax402 settlements batch --api-id ID [--json]
ax402 settlements history [--days 30] [--api-id ID] [--limit N] [--offset N] [--json]
ax402 batch overview --api-id ID [--json]
ax402 batch settings --api-id ID --claim-interval-secs N --settle-interval-secs N --refund-interval-secs N [--json]

config / networks

ax402 config platform [--json]
ax402 networks supported [--json]
ax402 scopes presets [--json]

inspect / pay (buyer)

ax402 inspect url --url GATEWAY_URL [--method GET] [--json]
ax402 pay url --url GATEWAY_URL [--method GET] [--json]

inspect url fetches a gateway hostname and parses HTTP 402 payment requirements (no wallet). pay url requires AX402_EVM_PRIVATE_KEY in the CLI or a browser wallet in the Workbench.

Exit codes

  • 0 — success
    • 1 — API error
    • 2 — usage / validation error

On this page