Skip to main content
POST
Create x402 Session
Sessions let you pre-authorize a spending budget for repeated x402 API calls. Payments within a session are deducted from the session budget without requiring individual approval for each call.

Request Body

string
required
The agent whose wallet funds the session.
string
required
Maximum total amount the session can spend (e.g., "100.00").
string
required
CAIP-2 chain identifier for settlement (e.g., eip155:84532).
integer
required
Session time-to-live in seconds. The session expires after this duration.
string[]
Optional list of URLs this session is authorized to pay. If omitted, all x402-enabled URLs are allowed.

Example

Response

Authorizations

X-API-Key
string
header
required

API key authentication. Keys are prefixed with awx_.

Body

application/json
agent_id
string
required

The agent whose wallet funds the session.

budget_limit
string
required

Maximum total amount the session can spend (e.g., "100.00").

chain
string
required

CAIP-2 chain identifier for settlement (e.g., eip155:84532).

ttl_seconds
integer
required

Session time-to-live in seconds. The session expires after this duration.

allowed_urls
string<uri>[]

Optional list of URLs this session is authorized to pay. If omitted, all x402-enabled URLs are allowed.

Response

Session created successfully.

An x402 payment session with a pre-authorized spending budget.

id
string

Unique session identifier (e.g., sess_xyz789).

agent_id
string

Agent whose wallet funds the session.

budget_limit
string

Maximum total amount the session can spend.

budget_spent
string

Total amount spent so far.

budget_remaining
string

Remaining budget available.

chain
string

CAIP-2 chain identifier for settlement.

status
enum<string>

Session status.

Available options:
active,
expired,
deleted
allowed_urls
string<uri>[]

URLs this session is authorized to pay.

expires_at
string<date-time>

ISO 8601 expiration timestamp.

created_at
string<date-time>

ISO 8601 creation timestamp.