Guide · Pay from n8n
Pay from n8n
A buyer on n8n pays for inference with the USDC it already holds on Base. Each call is paid with x402, with no key, no gas and no account with us.
The path
| Step | Where | What happens |
|---|---|---|
| 1 | Base | USDC on Base at the workflow's own wallet (n8n's default network: settle_on_seller_venue.free_enrolled). No move: the door settles this network. |
| 2 | coord.taifoon.dev | Call /v1/chat/completions. It answers 402 with x402 terms; your client signs one authorization and the call is answered and settled. |
1. Hold USDC on Base
USDC on Base at the workflow's own wallet (n8n's default network: settle_on_seller_venue.free_enrolled). no move: the workflow's wallet pays per run on Base; a workflow holding money elsewhere runs the pay-in subflow of that venue first.
2. Call, paid with x402
Without a key the call answers 402. The PAYMENT-REQUIRED header holds the terms: one exact entry per network the door settles, the amount, and the address that is paid. Pick the entry for eip155:8453 (Base, USDC). You never type the payee: it is read from the challenge.
curl -i -X POST https://coord.taifoon.dev/v1/chat/completions \
-H "content-type: application/json" \
-d '{"model":"llama-3.3-70b","messages":[{"role":"user","content":"hello"}],"max_tokens":64}'Any x402 v2 client pays it. In TypeScript, with the key of the address that holds the USDC:
import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
import { ExactEvmScheme } from '@x402/evm';
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(account) }],
});
const r = await pay('https://coord.taifoon.dev/v1/chat/completions', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({"model":"llama-3.3-70b","messages":[{"role":"user","content":"hello"}],"max_tokens":64}),
});
console.log(await r.json()); // an OpenAI chat completionThe client signs one transfer authorization (EIP-3009). The facilitator settles it and pays the gas, so the address holds the dollar token only.
A key is free and not needed to pay with x402. A call sent with a key is paid from that key's balance; a call sent without one is paid with x402. Each model also has its own path, /v1/chat/completions/<model>. Prices lists every priced wall.
What it takes
- USDC on Base at a wallet the workflow signs with (an n8n credential the user keeps)
Nothing from Taifoon: no key, no registration, no account and no spec before the first paid call. The money lands per call in vault:taifoon:kms.
How this was checked
the door's 402 challenge offers exact on eip155:8453 (read 2026-10-22T18:04:25Z). Proven by a quote or a challenge: yes. Quotes and challenges only: nothing was deposited, signed or paid to check this page.