DOCS / ADD WITH CLAUDE CODE

Add Yeetful to your Coinbase agent with one prompt

Building an agent on the Coinbase Developer Platform? Paste the prompt below into Claude Code (or any capable coding agent) in your project. It wires the SDK in, then walks you through the two dashboard clicks — minting an API key and copying your grant id — at the right moment, with the right links.

The prompt

Add Yeetful spend-controlled x402 payments to this agent project.

Yeetful gives an agent an "expense account": an allowlist of hosts plus
per-call/per-day USDC budgets, enforced locally BEFORE any payment is
signed, with a receipt for every decision. Docs: https://yeetful.com/docs

Do the following, asking me to confirm anything ambiguous:

1. Install: npm install yeetful viem (or the pnpm/yarn equivalent this
   repo already uses).

2. Find where this project makes HTTP calls to paid or x402 APIs. Create a
   single shared payer in src/lib/pay.ts (adjust path to repo conventions):

   import { yeetful } from 'yeetful/agent'
   import { createWalletClient, http } from 'viem'
   import { base } from 'viem/chains'
   import { privateKeyToAccount } from 'viem/accounts'

   const wallet = createWalletClient({
     // If this project already has a Coinbase Developer Platform (CDP)
     // wallet or another viem account, use THAT as the account instead.
     account: privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`),
     chain: base,
     transport: http(),
   })

   export const pay = yeetful({
     wallet,
     grant: {
       id: process.env.YEETFUL_GRANT_ID,
       allow: [], // TODO: add the exact hostnames this agent may pay
       perCallUsd: 0.05,
       perDayUsd: 2,
     },
     apiKey: process.env.YEETFUL_API_KEY,
     // www origin on purpose: fetch drops auth headers on cross-origin
     // redirects, and the apex currently redirects to www.
     ledgerUrl: 'https://www.yeetful.com',
     onEvent: (m) => console.log('[yeetful]', m),
   })

   Replace direct fetch calls to those paid hosts with pay(), and add each
   host to the grant's allow list. Call await pay.flushLedger() before
   short-lived scripts exit.

3. Env setup: add PRIVATE_KEY (or wire the existing CDP signer),
   YEETFUL_API_KEY, and YEETFUL_GRANT_ID to .env; make sure .env is
   gitignored; add the three keys to .env.example with placeholder values.

4. Now walk me through the two Yeetful dashboard steps INTERACTIVELY —
   one at a time, waiting for me to confirm each before continuing:
   a. Tell me to open https://yeetful.com/dashboard/keys, connect my
      wallet, sign in, and mint an API key. Remind me the yf_ secret is
      shown only once. Wait for me to paste nothing — I'll put it in .env
      myself — then continue when I say done.
   b. Tell me to copy YEETFUL_GRANT_ID from the "Your expense account"
      chip on that same page into .env, and to flip ON the agents I trust
      at https://yeetful.com/dashboard/approvals. Continue when I say done.

5. Verify without spending: run the agent against one free (non-402)
   allowlisted endpoint, confirm a $0 "settled" receipt logs and a ledger
   sync POST succeeds (no 401s). Show me the output. Do NOT make a paid
   call unless I explicitly say so.

Keep the caps small. Never print or commit secrets. If this repo's paid
hosts speak x402 v1 or v2, no extra handling is needed — the SDK detects
the protocol version per challenge.

What it sets up

  • One shared pay() — a grant-aware fetch with an allowlist and small default caps ($0.05/call, $2/day) you can raise later
  • Your existing CDP wallet works as the signer— CDP accounts satisfy viem's account interface, so no separate key is needed
  • Hosted ledger sync pointed at the canonical origin (a cross-origin redirect would silently strip the auth header — details)
  • A no-spend verification step — the first paid call only happens when you say so

The two clicks Claude will ask you for

Why route a Coinbase agent through Yeetful?

CDP gives your agent a wallet; Yeetful gives it spending policy— the allowlist, the budgets, the typed refusals, and a receipt trail your dashboard (and your team) can audit. The two compose: CDP signs, Yeetful decides whether it should. When you want hard on-chain guarantees on top, the same grant terms are built to map onto Coinbase Spend Permissions — that's the direction of travel for the expense account.