Skip to main content
Key0 exposes a set of HTTP endpoints for agent discovery, payment-gated access, and protocol interoperability. All endpoints are served by a single Express router created via key0Router().

Endpoints

Discovery

Payment

MCP (when mcp: true)

Health (standalone server only)

Authentication Model

Key0 uses the x402 payment protocol instead of traditional API keys: discover a plan, request a challenge (402), sign an EIP-3009 authorization, settle on-chain, receive a Bearer token. For the full three-phase flow explanation and sequence diagram, see How It Works.

Base URL

All paths are relative to the host where you mount the Key0 router. For example, if your server runs at https://api.example.com, the agent card is at https://api.example.com/.well-known/agent.json.

Common Headers

Error Format

All errors follow a consistent JSON structure:
See Data Models for the full list of error codes.