vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
I want to understand x402. Who can help me? I don't want step-by-step, copy-paste instructions. I want to understand the HTTP flow and the payloads involved. I feel it is something very simple, but I went through the whole https://www.x402.org website and I can't find an actual HTTP exchange example.
3 replies
1 recast
12 reactions

Nemil Dalal pfp
Nemil Dalal
@nemild
Here's the flow. Feel free to DM and happy to walk through in more detail.
1 reply
0 recast
0 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
Thanks! The client does not execute the tx, it just submits it to the Server? That's a nice design, makes it much easier for the client. I guess the client expected to be aware of the scheme in advance, right?
1 reply
0 recast
0 reaction

Nemil Dalal pfp
Nemil Dalal
@nemild
Exactly. We did it that to reduce overhead on client and also to enable models where price may need to change as part of API request (e.g., inference). And yes, client needs to understand/respect scheme. Ideally, each AI agent and browser eventually knows this. We're starting with our AgentKit supporting this.
1 reply
0 recast
1 reaction

vrypan |--o--| pfp
vrypan |--o--|
@vrypan.eth
- Can a client skip steps (1) to (3) and start the flow from (4)? In theory, yes, assuming the client has knowledge of the expected X-Payment scheme. Are there thoughts about encouraging/discouraging this? - What is the expected Server response if X-Payment is provided, but it's invalid for some reason? Wrong scheme, nonce already used, wrong amount, etc? 402? 404? Something else? I think these responses should be part of the spec. - Are there thoughts about including "next request paymentRequirements" in 200 response headers? This would allow more efficient "conversations". Ex. first request is free, next request costs $0.01, after 1000 requests the cost goes to $0.001, etc. and I can update X-Payment accordingly.
1 reply
0 recast
0 reaction