Wuraw
Open App

Playground

Watch a 402 get answered

Compose a request, run it, and follow the handshake step by step. The snippet underneath is the same call, ready to paste.

Endpoint

this request settles0.026000 USDG

Quoted before the call, settled after it. No balance is held between requests.

x402 handshake

  1. request sentno key, no account attached
  2. 402 payment requiredprice, asset, network and payee quoted
  3. authorization signedgasless EIP-3009 transferWithAuthorization
  4. facilitator verifiedvalidated off-chain in one round trip
  5. settled onchainUSDG transferred, tx hash returned
  6. response streamingtokens on the wire

Response

—

No response yet

Pick an endpoint, adjust the parameters, and run the request to see the settled response.

Snippet

curl -sN https://api.<your-domain>/v1/inference \
  -H "content-type: application/json" \
  -H "x-wuraw-wallet: 0x…" \
  -d '{
    "model": "anthropic/claude-fable-5",
    "messages": [
      {
        "role": "user",
        "content": "Summarize this contract and flag anything unusual."
      }
    ],
    "max_tokens": 512,
    "temperature": 0.7,
    "stream": true
  }'

The base URL resolves client-side after mount.

The handshake, in words

  1. 01

    Request

    Your client calls the router with no key and no account attached.

  2. 02

    402

    The router answers 402 Payment Required with the price, asset, network and payee.

  3. 03

    Authorize

    The wallet signs a gasless EIP-3009 transfer authorization and re-sends.

  4. 04

    Verify

    A facilitator validates the signed payload off-chain in a single round trip.

  5. 05

    Settle

    The transfer lands onchain, the tx hash comes back, and the response streams.

The signed payment header carries an EIP-3009 transferWithAuthorization, which is why the authorization costs no gas and needs no prior approval transaction. The header's name differs between the community specification and the current hosted-facilitator documentation, so the SDK negotiates it rather than hard-coding one.