- Standalone (Docker)
- Embedded (SDK)
Run Key0 as a pre-built Docker container alongside your existing API. No code changes required.
Best for teams that want a quick deploy, prefer Docker-native workflows, or want to avoid touching application code.
- Published to Docker Hub as
key0ai/key0 - Configure via the browser-based Setup UI at
/setup, or through environment variables - Token issuance (subscription) is delegated to your
ISSUE_TOKEN_APIendpoint — Key0 POSTs to it after a successful payment and forwards the credential back to the agent - Pay-per-request (standalone proxy) is enabled by setting
PROXY_TO_BASE_URLand defining top-levelroutes. Clients buy arouteId, Key0 settles the payment, forwards the request to your backend, and returns the backend response directly as aResourceResponse. NoISSUE_TOKEN_APIcall for route-based purchases. - Docker Compose profiles control which infrastructure is managed for you:
| Profile | What it includes |
|---|---|
| (none) | BYO Redis and Postgres |
redis | Managed Redis |
postgres | Managed Postgres |
full | Managed Redis + Postgres (batteries included) |
Comparison
| Standalone (Docker) | Embedded (SDK) | |
|---|---|---|
| Setup | docker compose up then browser Setup UI | npm install @key0ai/key0 |
| Configuration | Setup UI or environment variables | TypeScript SellerConfig object |
| Token issuance (subscription) | Delegated to your ISSUE_TOKEN_API endpoint | Your fetchResourceCredentials callback |
| Pay-per-request | Set PROXY_TO_BASE_URL → proxy via /x402/access | key0.payPerRequest() middleware on each route |
| Per-request response | ResourceResponse (backend data, no token) | Your route handler’s response (no token) |
| Infrastructure | Docker Compose manages Redis + Postgres | You provide store instances (Redis, Postgres, or in-memory) |
| Best for | Quick deploy, no code changes, Docker-native workflows | Full control, existing app integration |
Which should I choose?
Choose Standalone if you have an existing API and want to add agent payments without modifying your application code. Key0 runs as a sidecar container and calls back to your token endpoint. Choose Embedded if you want the payment flow to live inside your server process. You get direct access to theChallengeEngine, full control over credential issuance, and no extra container to manage.
Both modes support the same transports (REST x402, A2A, MCP), the same on-chain verification, and the same refund logic. You can start with one and switch later.
Next steps
Quickstart: Standalone
Run Key0 as a Docker service in under 5 minutes.
Quickstart: Embedded
Add Key0 to an existing Express, Hono, or Fastify server.

