Skip to content

Recipes

Working examples. Each recipe is a small, self-contained agent you can copy and adapt.

RecipeWhat it shows
Subscription payerAn agent that pays a fixed monthly subscription on the first of each month.
Trading copilotAn agent that executes trades on a single whitelisted DEX, capped by weekly spend.
Service payerAn agent that pays per-call API fees to a single recipient.

Each recipe sits in examples/ in the monorepo.

Pattern

Every recipe follows the same shape:

  1. Read environment (AGENSAI_API_KEY, AGENSAI_OWNER_PRIVATE_KEY).
  2. getAgent(ens) if the agent already exists, else createAgent({ ... }).
  3. Loop or schedule the recurring action.
  4. Each call goes through agent.execute({ ... }).

The agent's policy bundle does the safety work. Your recipe code is just business logic.