Stip

agent skill

Hand this to an agent: pay APIs under the human's Stip policy. The agent EOA signs EIP-3009. Stip never takes custody. Never paste a seed or private key into a chat.

When to use

The human has a paid seat and a policy (agent, caps, allowlist, expiry). An API returns HTTP 402. Charge native Circle USDC only, and only to a payTo on the allowlist.

paidFetch

Import from lib/client/agent.ts. Load the agent key from local env — the human keeps it. A short local script is scripts/demo-agent.ts.

import { paidFetch } from "../lib/client/agent";

const key = process.env.AGENT_PRIVATE_KEY as `0x${string}`;

const { response, settlement } = await paidFetch(
  "https://example.com/paid",
  { method: "GET" },
  { privateKey: key, fundingUrl: "https://usestip.com/fund" },
);
Steps
  1. Read the policy caps and allowlist. Stop if PAUSED, REVOKED, or EXPIRED.
  2. Fund the agent EOA with native USDC on Avalanche C-Chain. Not USDC.e, not USDT, not Stip.
  3. Call the API with paidFetch. On 402 it signs and retries.
  4. On OVER_PER_TX, OVER_DAILY, PAYTO_NOT_ALLOWED, AGENT_MISMATCH, or BAD_ASSET: stop and show the human the code. Do not spend off the allowlist.