Skip to main content
A Compose Key is a JWT bearer token that handles payment server-side. You create it once with your wallet address and chain ID, then the SDK attaches it to every request as Authorization: Bearer compose-<jwt>.

Create a key

Pass an existing key

If you already have a token (e.g., from a previous session or another service):

List keys

Revoke a key

Check active session

Token storage

The SDK auto-detects localStorage in browser environments and persists the token under compose:token:<userAddress>:<chainId>. In Node.js, tokens are kept in memory. To use a custom storage adapter (e.g., a database or secure enclave):

When to use Compose Keys vs raw x402

Use Compose Keys when a human is involved. Use raw x402 when machines talk to machines.