Skip to content

Request a priced resource

GET
/{resource}
curl --request GET \
--url https://example.com/example

The first, unpaid call to a priced route is answered with 402 Payment Required and a challenge listing what would satisfy it (each entry a PaymentRequirements). The caller signs an EIP-3009 transferWithAuthorization and retries the same request with an X-PAYMENT header — base64-encoded JSON of the decoded Payment shape (see Settlement for that shape fully expanded). A valid payment yields the resource; an invalid one is challenged again.

resource
required
string

Any priced route on the gateway (e.g. an agent proxy path).

X-PAYMENT
string

Base64(JSON) of a decoded Paymentx402Version, scheme (v1: exact), network (v1: base), and the signed payload. Absent on the first request; present on the paid retry.

The resource, returned once a valid X-PAYMENT is presented.

Payment Required — the x402 challenge. accepts lists the acceptable payments, each a PaymentRequirements.

Media typeapplication/json
object
x402Version
required
integer
accepts
required
Array<object>

One entry of a 402 challenge’s accepts array.

object
scheme
required
string
network
required
string
maxAmountRequired
required

Decimal string (256-bit)

string
asset
required

Token contract address (hex)

string
payTo
required
string
resource
required
string
maxTimeoutSeconds
required
integer
Examplegenerated
{
"x402Version": 1,
"accepts": [
{
"scheme": "example",
"network": "example",
"maxAmountRequired": "example",
"asset": "example",
"payTo": "example",
"resource": "example",
"maxTimeoutSeconds": 1
}
]
}