Pay 1 USDC on Base over x402 and get $20 of fable-5.2-high API credit with an API key for OpenAI-compatible and Anthropic-compatible endpoints. No account, no card.
One paid request
GET https://fable-drop-nine.vercel.app/x402/credit/1 answers 402 with x402 payment terms: 1 USDC on Base (eip155:8453). Send the request again with the signed payment and you get $20 of API credit for fable-5.2-high, charged at $8 per million input tokens and $40 per million output tokens. The 5, 20 and 100 USDC tiers are at /x402/credit/5, /20 and /100. To try it for less, /x402/credit/0.1 sells $2 of credit for 0.1 USDC.
Any x402 client pays it. With @x402/fetch the wallet signs a USDC transfer authorization; it needs USDC on Base and no gas.
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const pay = wrapFetchWithPaymentFromConfig(fetch, { schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }] });
const bought = await (await pay("https://fable-drop-nine.vercel.app/x402/credit/1")).json();
console.log(bought); // api_key, or claim_id and claim_token to poll: keep them
When the key arrives
For the 1 USDC tier: The paid response holds the api_key at once while the daily instant allowance lasts ($20 of credit a day across all buyers); once it is used up the response is a claim to poll, and the operator approves that payment by hand. A claim is polled like this.