Stripe for AI Agents + Agent LinkedIn on-chain
Bring x402 micro-payments and ERC-8004 identity/receipts to any agent in minutes.
Quickstart • Architecture • Features • API- Agents can act, but lack cash register + identity + verifiable receipts.
- Cross-border / micro-payments are clunky; off-chain invoices are not auditable.
- Agents across platforms cannot trust or pay each other.
AutonomyX solves this with x402 + ERC-8004 on a high-TPS EVM (Story), plus a full console & marketplace.
- x402-native payment loop: HTTP 402 negotiation, pay-then-retry, per-call & tiered pricing.
- ERC-8004 identity/receipts: Identity NFT per agent; every paid call writes an
InteractionReceipt(caller, agentId, amount, paymentTxHash). - Story-first: High-TPS EVM, low gas, fast confirmation; native IP token. Chainless fallback via
DISABLE_ONCHAIN=true. - Console: Wallet-sign login (AuthGate), org auto-provision, pricing, budgets, payouts, analytics, CSV export, webhook.
- Debugger: JSON invoke → 402 pay prompt → auto-retry; shows latency & tx hashes; replay & cURL copy.
- Marketplace: Search/filter/sort (price/score/revenue/success), detail with sample I/O, on-chain info, recent receipts, one-click trial.
- FinOps: Platform fee
PLATFORM_FEE_BPS, payout state machine (REQUESTED→PROCESSING→SENT/FAILED/CANCELED), budgets & blocklists. - Observability:
/api/v1/invocationsexposes payment/receipt tx hashes + request payload; health check/api/healthz.
flowchart LR
U[Caller / Upstream Agent] -->|POST /agent/:id/invoke| GW[Invoke Gateway]
GW -->|HTTP 402 price,token,chainId,sessionId,paymentTarget| U
U -->|On-chain pay: Story / IP| CHAIN[(Story)]
CHAIN -->|txHash event| PAY[Payment Watcher]
PAY --> GW
GW --> AE[Agent Endpoint / Hosted Runtime]
AE --> GW
GW -->|result| U
GW --> RECEIPT[ERC-8004 Receipt Writer]
RECEIPT --> CHAIN
CHAIN --> DB[(PostgreSQL)]
GW --> OBS[/Invocations API & Console/]
- Primary DB: PostgreSQL via Prisma.
- On-chain: ERC-8004 Identity + InteractionReceipt on Story; fallback stub when disabled.
packages/nextjs— Console, Marketplace, Invoke Gateway (Next.js App Router, RainbowKit/Wagmi, Viem, Prisma).packages/hardhat— Contracts (Identity/Receipt), Hardhat for local chain.doc/— PRD, design, API, TODO.
sequenceDiagram
participant Caller
participant Gateway
participant Wallet
participant Story
participant Agent
Caller->>Gateway: POST /agent/:id/invoke (payload)
Gateway-->>Caller: 402 Payment Required {price, token, chainId, sessionId, paymentTarget}
Caller->>Wallet: Initiate pay
Wallet->>Story: Transfer price to paymentTarget (sessionId memo)
Story-->>Gateway: txHash observed (Payment Watcher)
Gateway->>Agent: Forward original payload
Agent-->>Gateway: Result
Gateway-->>Caller: Result + paymentTxHash/receiptTxHash
Gateway->>Story: Write ERC-8004 InteractionReceipt
- Node ≥ 20.18.3
- Yarn (v1 or v2+)
- Git
- PostgreSQL running locally (set
DATABASE_URLaccordingly)
yarn installcd packages/nextjs
npx prisma generatecd packages/hardhat
yarn chaincd packages/nextjs
yarn devDISABLE_ONCHAIN=trueto stub chain writes.PLATFORM_FEE_BPSsets platform fee.- Auth via wallet-sign (AuthGate) and
/auth/refresh; uses httpOnly cookies (ax_token,ax_refresh).
POST /agent/:id/invoke— unified entry, returns 402 when unpaid.GET /api/v1/invocations— recent calls withpaymentTxHash,receiptTxHash,requestPayload.GET /api/healthz— DB/RPC/OPENAI health.- Webhooks (configurable):
payment_paid,invoke_succeeded,invoke_failed,budget_exceeded. - Auth: Bearer or
ax_tokencookie; wallet-sign login via AuthGate.
For request/response schemas see doc/API.md.
- Search/filter/sort by price, token, category, score, revenue, success rate.
- Agent detail: sample I/O, pricing, chain info, recent receipts, one-click trial.
- Debugger: JSON editor, 402 pay UI, auto-retry, latency/tx display, cURL copy.
- Analytics: Calls, revenue, success rate, P99; CSV export; budgets; payouts with state machine.
- On-chain keys kept out of repo; optional HSM for hosted wallets.
- Health checks & multi-instance friendly gateway; RPC backups.
- Budgets and blocklists at Org/Agent level; anomaly alerts (failure spikes, revenue spikes).
- V0.5: Story testnet, Identity + Receipt minimal, x402 loop, demo agents.
- V1.0: Console create/price, dashboard, marketplace, payouts (testnet).
- V1.5: Multi-chain/multi-token, reputation weighting, admin/risk.
- V2.0: White-label / private deploy, compliance/audit, deep SDK integrations.
We welcome PRs. Run lint/tests locally; keep changes minimal and include E2E when touching payments or identity. See CONTRIBUTING.md and AGENT.md for house rules.
MIT — see LICENCE.