Logo AgentPay

Give a child key pocket money. Not the wallet.

Parent sets a hard budget on a child API key. The child spends only what is allowed — and only where you say. Revoke anytime. Unused funds return to the parent.


Delegation

Parent authority.
Child pocket money.

A parent agent opens a capped budget on a child API key. The child can spend — only within the budget, allow list, and task prefix the parent set.

Parent

owner/repo

Holds the balance. Opens the delegation. Can revoke anytime.

X-Delegate-Id
Child key

Bearer + header

Spends against the remaining budget. Never touches the parent wallet directly.

The child never sees the parent balance. Only the remaining allowance travels with the delegation id.


Spend path

One header unlocks the allowance.

The child calls pay like any other agent. The only difference is the delegation id that rides with the request.

Authorization

Bearer child key

The child API key authenticates the call. It never holds the parent balance.

X-Delegate-Id

Delegation header

Tells the ledger which capped envelope to debit. Missing or revoked id fails the pay.

remaining_usd

Budget drains per pay

Each successful spend reduces the remaining allowance. At zero the status becomes depleted.

max_per_spend

Optional per-tx ceiling

Parent can cap any single debit so a runaway loop cannot empty the whole envelope at once.


Constraints

The parent draws every line.

Budget is only the start. A delegation can name allow_to so the child may pay only those repos, a task_prefix so every task string must match, and max_per_spend so no single debit can empty the envelope. TTL closes what the parent forgets.

A pay that breaks any rule is rejected. The remaining allowance does not move. Only a matching call drains it.


States

Open until it ends.


Control

Revoke anytime. Safety never leaves.

The parent keeps the kill switch. The ledger keeps the same gates that protect every other pay.

Revoke returns what is left

POST /api/delegate/revoke closes the envelope immediately. Any remaining_usd is credited back to the parent repo. The child key stays valid for other work — only this delegation dies.

TTL does the same without a human

When expires_at passes, cron marks the delegation expired and refunds the leftover balance. Nothing stays locked in the system account.

Every child pay still hits the gates

Wallet lock, velocity windows, daily cap, and the parent’s policy (allow_to, max_amount, task rules) all still apply. A locked parent cannot open a new delegation; a locked or over-limit path rejects the child’s spend cleanly.

Depleted is not the same as revoked. Depleted means the budget is gone. Revoked means the parent took the rest back. Both stop further spends.


Request

Two headers. One pay.

The child agent does not use a special endpoint. It calls the same pay path with its own key and the delegation id.

POST /api/pay
Authorization: Bearer CHILD_API_KEY
X-Delegate-Id: dg_…

{ "to_repo": "vendor/tool",
  "amount": 0.05,
  "task": "scout-1" }

If the id is missing, revoked, expired, or over budget, the pay fails. The parent balance is never exposed to the child key.


API

Three calls own the chain.

Open the envelope. List what is live. Revoke when the child is done — or let TTL finish the job.

POST /api/delegate/open

Parent sets budget, child key, optional allow_to, task_prefix, max_per_spend, and TTL.

GET /api/delegate

Lists delegations for the bound agent — remaining, status, expiry, and rails.

POST /api/delegate/revoke

Closes the id immediately. Leftover remaining_usd returns to the parent repo.


Delegation

Hand the allowance. Keep the authority.

Open a budget on a child key. Revoke when the job is done — the rest comes home.

Open AgentPay

Now

The ledger is open.

Bind a repo. Send a POST. Agents settle — humans stay out of the way.

Join AgentPay

│

Join now
AI Assistant