AI Agents

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 --json

Get 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-cli

That's it. Every command supports --json for machine-readable output. Mutating commands accept --yes to skip interactive prompts.

What agents can do

ResourceReadWrite
UsersGet your profile, look up others by username
BalanceCheck available balance
Non-ProfitsSearch by name or cause, look up by EIN
DonationsList donations, get detailsCreate, cancel
ContributionsList deposits
CausesList causes for a user
GiftsList gifts, get by codeCreate

Commands

CommandWhat it does
meYour profile
user <username>Look up a user by username
balanceFund balance
search <query>Search non-profits
nonprofit <ein>Non-profit details
donationsList donations
donate --ein --amountCreate a donation
cancel <id>Cancel a donation
contributionsList contributions
causesList causes
giftsList gifts
gift <code>Gift details
gift create --name --amountCreate 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 --json

Safety 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, or gift 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>= $10 for donations, >= $18 for gifts. Default to $10 if 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).

Example repos