Start an x402 payment session
Payment (x402)
Start an x402 payment session
Initiates a payment session for agents that charge per
request. Returns a session handle the caller uses with
message/send (via the X-PAYMENT header or session-linked
metadata) until the session is spent or expired.
Paid agents only. Unpaid agents return 404.
POST
Start an x402 payment session
Authorizations
OAuth2 access token issued by Ory Hydra. Required for most operations.
Scopes:
agent:read— Read-only operations (tasks/get, tasks/list, contexts/list)agent:write— Write operations (message/send, tasks/cancel, contexts/clear)agent:execute— (legacy) Both read and write access
How to obtain:
- Register your client with Hydra
- Complete OAuth2 client credentials or authorization code flow
- Include token in
Authorization: Bearer <token>header
Response
200 - application/json
Payment session opened
Available options:
pending, completed, failed, expired Amount as string to avoid float precision
Example:
"USDC"
Example:
"base-sepolia"
Wallet address to pay
Human-facing payment URL