Give your agent a Daffy account
Let AI agents search non-profits, check balances, make donations, and send gifts through the Daffy API. Set an API key, point your agent at daffy-cli, and it's ready to go.
mkdir -p ~/.daffy && echo 'DAFFY_API_KEY=your-key' > ~/.daffy/credentials
npx daffy-cli search "doctors without borders" --json
npx daffy-cli balance --json
npx daffy-cli donate --ein 133433452 --amount 50 --yes --jsonGet started
Two steps. No SDK, no server, no config files.
1. Grab your API key from daffy.org/settings/developers (opens in a new tab). Save it to a credentials file (recommended) or set it as an environment variable:
# Option A: credentials file (persistent, recommended)
mkdir -p ~/.daffy && echo 'DAFFY_API_KEY=your-key' > ~/.daffy/credentials
# Option B: environment variable
export DAFFY_API_KEY="your-key"The CLI checks DAFFY_API_KEY env var first, then falls back to ~/.daffy/credentials.
2. Run any command via npx (zero install) or install globally:
npm install -g daffy-cliThat's it. Every command supports --json for machine-readable output. Mutating commands accept --yes to skip interactive prompts.
What agents can do
| Resource | Read | Write |
|---|---|---|
| Users | Get your profile, look up others by username | — |
| Balance | Check available balance | — |
| Non-Profits | Search by name or cause, look up by EIN | — |
| Donations | List donations, get details | Create, cancel |
| Contributions | List deposits | — |
| Causes | List causes for a user | — |
| Gifts | List gifts, get by code | Create |
Commands
| Command | What it does |
|---|---|
me | Your profile |
user <username> | Look up a user by username |
balance | Fund balance |
search <query> | Search non-profits |
nonprofit <ein> | Non-profit details |
donations | List donations |
donate --ein --amount | Create a donation |
cancel <id> | Cancel a donation |
contributions | List contributions |
causes | List causes |
gifts | List gifts |
gift <code> | Gift details |
gift create --name --amount | Create a gift |
Example: donate by name
A typical agent flow — search, verify funds, then donate:
# Find the non-profit
npx daffy-cli search "khan academy" --json | jq '.items[0].ein'
# Check available balance
npx daffy-cli balance --json | jq '.available_balance'
# Make the donation
npx daffy-cli donate --ein 261544963 --amount 25 --note "Great work" --yes --jsonSafety rules
Minimum donation is $10. Minimum gift is $18.
If you're building an agent that calls daffy-cli, enforce these rules:
- Always confirm before running
donate,cancel, orgift create. Never execute these without explicit user approval. - Search first — when a user names a non-profit, look it up. Don't guess EINs.
- Validate amounts —
>= $10for donations,>= $18for gifts. Default to$10if no amount is specified. - Report results — after every mutating command, surface the key fields:
id,status,amount.
Skill file
Drop this file into your agent's workspace and it will know how to use every Daffy API endpoint — donations, gifts, balance checks, non-profit search, and common multi-step workflows.
Download daffy-donation-SKILL.md
The skill follows the Claude Code skill format (opens in a new tab). You can use it as-is or extend it to build custom workflows on top of the Daffy API.
For more examples of how skills are structured, see the Anthropic skills repository (opens in a new tab).