Skip to content
agentsub
Esc
↑↓navigate↵open⌘Jpreview
On this page

AgentSub Gateway API

Reviewed live AgentSub gateway contract. Blocked fixture, synthetic-agent and legacy execution routes are omitted. This document is imported directly by GET /v1/openapi.json; static structural checks do not prove deployed runtime behavior.

Money: amounts ending Uc are canonical nonnegative int64 decimal strings. 1 credit = 1,000,000 microcredits = $0.01; 1 microcredit = $0.00000001. USD prices are exact decimal strings. Payment amounts are integer cents, minimum 50 ($0.50), disclosed to the human before approval.

Authentication: verified human Clerk session JWTs permit owner controls, merchant registration, connector management and MCP. Verified AgentID tokens or broker resource tokens permit agent operations. MCP agents require the exact canonical MCP resource audience; direct Clerk human sessions are also accepted. AgentID social Clerk sessions permit only own-agent overview and service execution; never human approvals or controls. A verified human Clerk owner and server-verified AgentID owner binding are required before agent registration. Merchant asm_ keys are hashed, scoped, revocable, and restricted to their own catalog/offers/redemptions and voucher introspection.

Idempotency: payment/service/merchant/webhook mutations require a 1–200 character key matching [A-Za-z0-9._:-]. Core ledger/register/caps/freeze operations accept nonempty keys up to 255 characters. Profile operations and OAuth exchanges do not require this header. Reuse the same key with the same payload for recovery; changed payloads conflict. Secret-issuance replays return metadata without plaintext secrets.

Real Stripe/Link approval and confirmed successful settlement are required before paid credits are minted or retained operations resume; deployments may disable payments or lack Link credentials and return actionable configuration errors. x402 is unconfigured. Welcome credits are restricted to gateway GitHub/AgentMail services. Confirmed paid network credits can cover active verified registered merchant offers subject to agent caps and allowlists. Transfers, cashout and fiat payouts are disabled. Merchant capture records a payable ledger balance, not a fiat payout.

Merchant webhook events are durably queued after canonical capture/release and delivered through configured Cloudflare Queues with signed HMAC headers, bounded retries and per-attempt receipts. Delivery is at least once; receivers must deduplicate eventId. Configuration reports whether the queue is available.

OAuth defaults to a human/agent identity choice; verified human consent issues agentsub:owner tokens, upstream AgentID authorization issues agentsub:agent tokens. An explicit requested scope constrains the available identity choice. Owner OAuth tokens live ten minutes; browser logout alone does not revoke an already-issued resource token.

AgentID social-session bindings are persisted privately only after real upstream userinfo verification, keyed to the current backend Clerk external-account ID. Signed Clerk sessions recheck that account/provider on every request; cached AgentID owner identity expires after 24 hours and then requires upstream reauthentication. Canonical immutable owner-subject binding and once-owner grants remain separately enforced by ledger registration.

Clerk may retain an expired upstream AgentID access token without a refresh token even after social sign-in/reconnection. The explicit /oauth/social/connect flow renews identity through the registered direct AgentID broker and validates it against the active Clerk external account. The API does not infer verified owner claims from robot email or client metadata.

Version 0.3.0
Base URLhttps://api.agentsub.dev

Health

Discovery

OAuth

Owner

Agent

Services

Payments

Merchant Registry

Merchant Scoped

MCP

Merchant Webhooks