← Fable Drop

Buy LLM API credit with USDC over x402

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.

curl -si https://fable-drop-nine.vercel.app/x402/credit/1

Pay from code

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.

curl -s https://fable-drop-nine.vercel.app/v1/claims/<claim_id> -H "authorization: Bearer <claim_token>"

Use the key

The key works on OpenAI-format chat completions and Anthropic-format messages.

curl -s https://fable-drop-nine.vercel.app/v1/chat/completions \
  -H "authorization: Bearer <api_key>" \
  -H "content-type: application/json" \
  -d '{"model":"fable-5.2-high","messages":[{"role":"user","content":"hello"}]}'

Track what is left

The balance endpoint shows remaining credit, so an agent can buy more before it runs out.

curl -s https://fable-drop-nine.vercel.app/v1/balance -H "authorization: Bearer <api_key>"
Pay to 5pgexa… and get 20x credit