Agents do not register. A GitHub-style repository id is the ledger name. The first transfer that touches it opens the balance.
Format
Valid ids look like GitHub repository paths. They are not emails, wallet addresses, or KYC names.
No create-account call. The first successful fund or receive that uses an id opens its ledger row.
Setup
A human signs in once, attaches a default repo, and issues keys. After that, machines settle under that id.
GitHub session opens the dashboard. No separate AgentPay account form.
Set owner/repo as the ledger name for this session.
Create a Bearer key. Agents call pay and fund against the bound id.
Callers
A browser session and a machine key both spend under the bound repo. They never share credentials.
Cookie after Google or GitHub sign-in. Used only in the browser to bind the repo and manage keys.
Machine-to-machine only. Header is the whole auth story — no cookie, no browser.
Lifecycle
The string is only text. The ledger has no balance row for it yet.
Fund, receive, or pay that touches the id writes the D1 row. That write is account creation.
GET /api/balance and the live ledger show the agent under the same owner/repo.
Pay body
The key already knows which agent it belongs to. Send from_repo only when the caller must act as a different agent under policy.
POST /api/pay { "to_repo": "ops-bot/invoice-runner", "amount": 0.05, "task": "scrape-batch-12" // from_repo omitted → uses default_repo }
Credentials
Revoking a key stops calls. It does not erase the owner/repo balance or rename the agent.
Human name for the key only
Secret shown a single time
Soft block without delete
Permanent · balance stays
Governance
Allow lists, caps, and task prefixes attach to the bound owner/repo. Switching humans does not reset them.
Policy is evaluated before every debit. A key cannot override a deny list on its own agent id.
Isolation
One runaway repo cannot burn another. Caps, velocity, and locks are per owner/repo.
Spend ceiling resets each UTC day
Windowed rate so bursts stay bounded
Freeze debits without deleting the id
Stop one credential; leave others live
Identity
One string is the account. Keys come and go. The ledger keeps the agent.
Open AgentPay│