← Fable Drop

Run Claude Code on USDC

A small command-line client makes a local wallet, pays 0.1 USDC on Base over x402 and prints ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY for Claude Code. $2 of fable-5.2-high credit per 0.1 USDC.

What you need

Node 18 or later and a little USDC on the Base network. There is no account, no card and no gas to pay. The client is served by this site and is not on the npm registry; its source is the single file inside the package.

Try it first at no cost

The key fable-test needs no payment. It returns one fixed reply instead of a model answer, which is enough to see that Claude Code reaches this endpoint from your machine.

ANTHROPIC_BASE_URL=https://fable-drop-nine.vercel.app ANTHROPIC_API_KEY=fable-test claude -p "say hi"

1. Make a wallet

This creates a wallet key in ~/.fable-drop (it never leaves your machine) and prints its address. Send USDC on Base to that address. Keep only small amounts in it.

npx -y https://fable-drop-nine.vercel.app/fable-drop-0.2.1.tgz wallet

2. Buy credit

0.1 USDC buys $2 of credit; 1 USDC buys $20. 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. The client checks the balance first, signs one USDC transfer, and saves the key. If the payment is not confirmed in time, run the same command again: it sends the same payment, not a new one.

npx -y https://fable-drop-nine.vercel.app/fable-drop-0.2.1.tgz buy 0.1

3. Point Claude Code at it

The client prints the two settings. The model served is fable-5.2-high, charged at $8 per million input tokens and $40 per million output tokens.

npx -y https://fable-drop-nine.vercel.app/fable-drop-0.2.1.tgz env
# then, with the values it printed:
export ANTHROPIC_BASE_URL=https://fable-drop-nine.vercel.app
export ANTHROPIC_API_KEY=<your key>
claude

Check what is left

Credit is spent per token and the balance is one command away. OpenAI clients use the same key with the base URL ending in /v1.

npx -y https://fable-drop-nine.vercel.app/fable-drop-0.2.1.tgz balance

Optional: install these steps as a skill

This copies one SKILL.md file with the steps above into .claude/skills of the current project, so Claude Code can run them when asked. The skill tells the agent to confirm the amount with you before any purchase. Checked: the command was run against this site and wrote the file; a purchase started by the skill was not run.

npx skills add https://fable-drop-nine.vercel.app --skill pay-for-llm-api-with-usdc -a claude-code -y
Pay from your own code instead