pay tokens for tokens
OpenRouter with no API key. You pay in yUSDCx or wTOKENx. Paste the clanker prompt into whatever is holding your keys. The 402 names the exact amount, in USD, at that second, times 3.
try it yourself
Dump this into Claude / Grok / Codex. It has everything.
No SDK. No OpenRouter key. If it can POST and sign one Solana TransferChecked, it can buy inference here. Raw prompt also at /prompt.txt.
Use https://x402-tokens.fly.dev as an OpenAI-compatible inference endpoint. There is no API key.
POST https://x402-tokens.fly.dev/v1/chat/completions
Content-Type: application/json
Body is a normal OpenRouter/OpenAI chat completion:
{"model":"google/gemini-2.5-flash","messages":[{"role":"user","content":"..."}],"max_tokens":256}
You will get HTTP 402. That is the product, not an error.
accepts[] will include one row per live rail. Pick ONE:
- yUSDCx mint 6ZjjxcoicqM4nniddkuPVwew4PDwY3swbfHsGbCuLuTv 20bps tax price $1 stable
- wTOKENx mint Bo7xBF7SY8EyUBPUxRP66SFafxoPf2n5uqiLjbxEebx9 20bps tax price Birdeye EVULoNF4DeMBN4dGiZiDfpiiTfNZgoCvXWWgaV3epump at the 402
Every row:
- network: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
- payTo: WzMaL78srutrF6CsxEkWuhMaDF5HZA6jNRaEPengqpb
- feePayer: WzMaL78srutrF6CsxEkWuhMaDF5HZA6jNRaEPengqpb ← tx feePayer MUST be this. you do not pay SOL.
- maxAmountRequired: already 3× OpenRouter USD, in that token's raw units, grossed up for its transfer tax. do not reprice it.
- facilitator: https://x402.accrue.fund
Build one Solana legacy Transaction:
1. feePayer = WzMaL78srutrF6CsxEkWuhMaDF5HZA6jNRaEPengqpb
2. exactly one Token-2022 TransferChecked: your ATA of the chosen mint → payTo's ATA, amount = maxAmountRequired, decimals = 6
3. you sign as the token owner. leave the feePayer signature empty.
4. serialize requireAllSignatures=false, base64 that bytes
X-PAYMENT header = base64 of this JSON (utf8):
{"x402Version":1,"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","payload":{"transaction":"<base64-tx>"}}
POST the SAME body again with X-PAYMENT set. Do not change model/messages/max_tokens after the 402 — the quote is for that body.
On 200 you get a normal chat.completion.
Raw TOKEN (EVULoNF4DeMBN4dGiZiDfpiiTfNZgoCvXWWgaV3epump) and raw USDC will not settle. Wrap first:
- USDC → yUSDCx via FrSERTNCPvTtaDS9AvQp9u1nYGzXDb3kC9MdL8Xxn2NE escrow 2qLm8aCvn6gQVUFeQ7EC5J62Y95gFzc3vReHzD5d5Gj2
- TOKEN → wTOKENx via the same program, escrow 7j682FdwSdTkXNjbMrrLd5wcXQoh23UTZaDReqKXbL2q
Both wraps are Token-2022 with a 20bps transfer tax. Yield is that tax.
Do not use api.cdp.coinbase.com. This service names https://x402.accrue.fund. GET https://x402-tokens.fly.dev/.well-known/x402.json and https://x402-tokens.fly.dev/prompt.txt if you want this text again.
Hit the endpoint. It should 402 you.
No wallet in the browser. This button is a GET-equivalent POST with no X-PAYMENT. If the service is up you get a challenge, not a completion.
curl -sS https://x402-tokens.fly.dev/v1/chat/completions \
-H 'content-type: application/json' \
-d '{"model":"google/gemini-2.5-flash","messages":[{"role":"user","content":"say hi"}]}'
- Wrap first. Raw USDC and raw TOKEN will not settle. USDC → yUSDCx or TOKEN → wTOKENx. Same program, 20bps Token-2022 tax, yield stays in the wrap.
- POST the same body again with header
X-PAYMENT= base64 of an x402 payload whose transaction is aTransferCheckedofmaxAmountRequiredof the chosen wrap toWzMaL78srutrF6CsxEkWuhMaDF5HZA6jNRaEPengqpb, fee payerWzMaL78srutrF6CsxEkWuhMaDF5HZA6jNRaEPengqpb. - The facilitator at https://x402.accrue.fund verifies and sponsors gas. You need no SOL.
- On 200 you get a normal OpenRouter chat completion. The key never leaves this host.
Price
OpenRouter's published USD rate for the model, times 3. yUSDCx is $1. wTOKENx is Birdeye spot of TOKEN at the 402. Both wraps take 20bps on transfer — that's the yield.
What is live today
yUSDCx · wTOKENx
TOKEN EVULo…pump on pump.fun. Spendable rail is wTOKENx Bo7xBF7SY8EyUBPUxRP66SFafxoPf2n5uqiLjbxEebx9 — Token-2022, 20bps tax, PDA fee authority.