Agent Bank API

Build against Dino Agent Bank with the current public spend API, webhook events, and implementation patterns.

Agent Bank is the treasury control plane for agents: spend accounts, wallet funding, approvals, cards, API keys, and ledger-backed audit trails.

Today, the stable public integration surface for Agent Bank is the agent spend REST API on https://api.dino.id/v1.

#What is public today

Use these endpoints with a Dino spending key (Authorization: Bearer din_...):

  • POST /v1/spend
  • GET /v1/spend/:id
  • GET /v1/balance

You can also subscribe to state changes through Agent Spend Webhooks.

  1. In dashboard, fund team wallet and create a spend account.
  2. Issue a Dino spending key for that account.
  3. Call POST /v1/spend with idempotency.
  4. If status=needs_approval, route operator to approval UI and wait for webhook.
  5. Reconcile final state in your app using webhook event payload or GET /v1/spend/:id.

#Example: create spend request

curl -sS -X POST "https://api.dino.id/v1/spend" \
  -H "Authorization: Bearer YOUR_DINO_SPEND_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount_cents": 25000,
    "currency": "usd",
    "merchant_name": "OpenAI",
    "reason": "model inference for support agent"
  }'

#Example: check request status

curl -sS "https://api.dino.id/v1/spend/req_123" \
  -H "Authorization: Bearer YOUR_DINO_SPEND_KEY"

#Example: check account budget/balance context

curl -sS "https://api.dino.id/v1/balance" \
  -H "Authorization: Bearer YOUR_DINO_SPEND_KEY"

#Core implementation guidance

  • Always send Idempotency-Key for POST /v1/spend.
  • Treat needs_approval as pending, not failure.
  • Use webhooks first, polling second for approval outcomes.
  • Never expose spending keys to client-side code.
  • Keep LLMs away from raw keys; use a server-side tool boundary.

#Error handling

Expect machine-readable errors (example):

{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded"
  }
}

Common codes include:

  • invalid_api_key
  • revoked_api_key
  • invalid_request
  • funding_source_budget_exceeded
  • plan_spend_volume_exceeded
  • rate_limited