Payment (x402)

Start an x402 payment session

Changed on

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/api/start-payment-session

Request

  • Base URL
    http://localhost:3773
  • Auth
    HTTP bearer

Response

Payment session opened

session_idstring required
status'pending' | 'completed' | 'failed' | 'expired' required
amountstring required

Amount as string to avoid float precision

assetstring required
networkstring required
pay_tostring required

Wallet address to pay

created_atstring date-time required
expires_atstring date-time
capture_urlstring uri

Human-facing payment URL

Example response

{
  "asset": "USDC",
  "network": "base-sepolia"
}

Changes

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      api operation id startPaymentSession removed and replaced with

    • info

      the endpoint scheme security BearerAuth was removed from the API

    • info

      api tag Payment (x402) added

    • info

      api tag Payment removed

    • info

      removed the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status