Ax402Docs

Control plane API

REST contract, auth, API keys

The control plane is the seller-facing REST API behind this dashboard. SDKs, CLI, and MCP tools are thin wrappers over the same routes defined in the OpenAPI contract.

OpenAPI contract

Machine-readable spec: openapi/openapi.json in the ax402-clients repository. Agents should load this file for exact request/response shapes.

Authentication

  • Seller JWT — from POST /auth/login or signup; used by the dashboard BFF
    • API key — X-API-Key: ax402_live_... (production) or ax402_sandbox_... (Sandbox); scoped for automation
    • Environment — JWT clients send X-Ax402-Environment: production|development. API key environment is fixed by key prefix.
    • Email verification required before write operations

Sandbox / Test mode

Development APIs settle on the Anvil fork (eip155:845320402). See the full Sandbox guide for RPC URLs, faucet, and wallet private keys.

RouteAuthNotes
GET /config/local-devPublic / sessionFork RPC, chain id, payment token
GET /sandbox-walletJWT + developmentGet-or-create funded wallet + private key
POST /sandbox-wallet/resetJWT + developmentRotate keypair + fund
POST /dev/balancesJWT + development{ eth_wei, usdc_base }
POST /dev/faucetJWT + developmentManual ETH/USDC deal

Core resources

  • /apis — register upstream base URL, slug, pay-to mode; optional discovery_guidance, discovery_contact_email, openapi_version
  • /apis/{id}/discovery — computed gateway discovery URLs (apis:read)
  • /apis/{id}/endpoints — per-route x402 accepts; optional request_schema / response_schema
  • /apis/{id}/domains — custom hostnames + DNS verification
  • /openapi/parse, /openapi/import — bulk endpoint creation (schemas preserved when present)
  • /stats/overview, /settlements — analytics
  • /config/platform — public platform metadata
  • /config/local-dev, /sandbox-wallet, /dev/* — Sandbox / chain-dev (see above)

Gateway discovery

Buyers and agents discover payable routes on the gateway host:

  • GET https://{api-host}/openapi.json — AgentCash OpenAPI
  • GET https://{api-host}/.well-known/x402.json — x402 origin manifest

See API discovery.

Gateway vs control plane

Buyers pay gateway hostnames (e.g. https://myapi.example.com/v1/data), not the control plane URL. Use buyer SDKs, React paywall, or ax402 pay url for gateway URLs only.

Client libraries

LanguagePackage
TypeScript@ax402/sdk — Ax402Client with auth, apis (incl. discovery), endpoints, domains, openapi, stats, settlements, config
Gogithub.com/AxLabs/ax402-sdks/go — GetAPIDiscovery, discovery fields on CreateAPIInput
Pythonax402_sdk.Ax402Client — apis.discovery; install from ax402-sdks (packages/python/) until PyPI publish
CLI@ax402/cli — apis discovery, discovery urls
MCP@ax402/mcp-server — ax402_discovery_urls, ax402_set_discovery_guidance

See SDK overview and API discovery.

On this page