Agent workflows

Automate gateway setup and paid API access from Cursor, Claude Desktop, or CI using the CLI and MCP server together. Use scoped API keys — never commit live keys or private keys to source control.

MCP server

pnpm --filter @axlabs/ax402-mcp-server build

AX402_API_KEY=ax402_live_... \
AX402_BASE_URL=http://api.localhost:8090 \
node ax402-sdk/tools/mcp-server/dist/index.js

Exposes control-plane tools (ax402_list_apis, ax402_add_endpoint, ax402_pay_url, and more). See the MCP reference.

CLI recipes

pnpm --filter @axlabs/ax402-cli build
export AX402_API_KEY=ax402_live_...

ax402 apis list --json
ax402 endpoints create \
  --api-id ID \
  --method GET \
  --path "/wp-json/wp/v2/posts" \
  --price-usdc 0.01 \
  --json

Full command list in the CLI guide.

Scope presets

Create automation keys with the apiManager preset from the SDK (packages/typescript/src/scopes.ts):

  • apis:read, apis:write
  • endpoints:read, endpoints:write
  • domains:read, domains:write
  • openapi:read

Use readonly for list/stats-only agents and analytics when stats access is sufficient.

Paying gateway URLs

Set AX402_EVM_PRIVATE_KEY for buyer flows in CLI (ax402 pay) and MCP (ax402_pay_url). See buyer clients for in-process signing in TypeScript, Go, and Python.