Ax402Docs
FOR AGENTS

CLI reference

Full ax402 command reference

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

Install and run

npm install -g @ax402/cli
ax402 apis list --json

Or run without installing:

npx @ax402/cli apis list --json

From source

git clone https://github.com/AxLabs/ax402-sdks.git
cd ax402-sdks && pnpm install
pnpm --filter @ax402/cli build
node tools/cli/dist/index.js apis list --json

Global flags

  • --json — JSON output on any command

Environment

  • AX402_BASE_URL — control plane (default https://api.ax402.io)
    • 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]
ax402 apis slug-check --slug SLUG [--exclude-api-id ID] [--json]
ax402 apis probe-upstream --api-id ID [--endpoint-id EP] [--path PATH] [--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 settlements export --format csv|json [--days 30] [--api-id ID] [--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]

billing / income / facilitator

ax402 billing overview [--json]
ax402 billing packages [--json]
ax402 billing invoices [--json]
ax402 income summary [--json]
ax402 income ledger [--limit N] [--offset N] [--api-id ID] [--network NET] [--json]
ax402 income payout-requests [--json]
ax402 facilitator stats [--days 30] [--json]
ax402 facilitator events [--days 30] [--limit N] [--offset N] [--json]

config / networks / scopes

ax402 config platform [--json]
ax402 config billing [--json]
ax402 networks supported [--json]
ax402 scopes presets [--json]
ax402 scopes list [--json]
ax402 exchange-rates supported [--json]
ax402 exchange-rates lookup --network NET --asset ADDR [--quote USD] [--date YYYY-MM-DD] [--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