API reference

API reference · Public

x402 pay per request: whether it is on, and on what terms

GET/api/x402No key

With x402 on (the operator set ANTIMATTER_X402_FACILITATOR_URL and ANTIMATTER_DEPOSIT_ADDRESS), a POST to /v1/chat/completions, /v1/messages, /v1/responses or /v1/embeddings with no key is answered 402 with an x402 version 2 PaymentRequired (body and PAYMENT-REQUIRED header): the request's worst case in USDC on each accepted network, exact scheme, EIP-3009. Retry with the signed authorization in PAYMENT-SIGNATURE; the payment is settled through the facilitator before the request is served, credited to the paying wallet's own account, and the answer carries PAYMENT-RESPONSE. What the request does not spend stays on that wallet's balance. With x402 off a keyless request is a 401, as it always was.

Answer 200

The x402 configuration a payer needs; the price is on each request's 402.

Fields of the 200 answer
FieldTypeWhat it is
enabledbooleanWhether keyless requests are offered x402 payment.
reasonstring or nullWhy it is off, or null when it is on.
x402VersionintegerThe protocol version spoken: 2.
schemestringThe payment scheme: exact.
payTostring or nullThe operator's wallet the payment goes to.
networksarray of object
networks[].networkstringCAIP-2 network id, eip155:<chainId>.
networks[].namestringThe network's name.
networks[].assetstringThe USDC contract, lower case.
networks[].symbolstringUSDC.
networks[].decimalsintegerThe token's configured decimals.
networks[].domainobject
networks[].domain.namestring
networks[].domain.versionstring
resourcesarray of string
Antimatter