Update: streaming is live. Paid before the first token, refunded after the last.
Both routes now stream, each in its native format: OpenAI chunks on /v1/chat/completions, Anthropic events on /v1/messages. Add stream: true, nothing else changes.
The problem to solve: x402 normally settles after the answer, from the full response. A stream has no "after" until the last token, so a signature could expire mid-answer, and the settlement header cannot follow a body that has already started.
Our answer, same as for long requests: settle the ceiling before the first token, inside the enclave, then refund the unused part on-chain after the last one. The final event carries the refund transaction, the token counts and the Ed25519 receipt naming the enclaves that answered. If the model fails mid-stream, the full ceiling is refunded.
First real stream on the production enclave today, DeepSeek V4 Flash in the sealed GPU tier:
• ceiling settled 0.000286 USDG, usage 0.000139 at the holder rate
• 42 chunks, 97 output tokens
• refunded 0.000147 USDG, tx 0xcfdfc40ee44a44ab59e1840e1a498356b87aa785675e7bf93b3daa9507d59cb6
• receipt signed, gateway tdx, model tdx+gpu, 0 bytes retained
node client/pay.js "…" --stream --network eip155:4663
Measured release 0.10.0: the compose that pins it is published, the enclave check on the site matches it.
https://t.co/VySlQHAnez
0x4d3ace48b1590bc4c5dd46f05237c133be564eb3