Skip to content

neosun100/openAgentPay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

99 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OpenAgentPay

The open control plane for AI agent payments

Any wallet. Any protocol. Any agent framework. In one line of code.

License CI Tests Live on AWS

Wallets Protocols Frameworks SDKs

๐Ÿš€ Live Demo ยท โšก Quickstart ยท ๐Ÿ“Š Coverage ยท ๐Ÿ—๏ธ Architecture ยท ๐Ÿค Contributing


LiteLLM let any LLM run with one line of code. OpenAgentPay lets any AI agent pay with one line of code.

OpenAgentPay is an open, pluggable abstraction layer over wallets ร— payment protocols ร— agent frameworks. Swap any of the three with a one-line config change โ€” your business logic never changes. It is the unifying control plane for the emerging Crypto Agent Payments space, the way LiteLLM became the unifier for LLM inference.

// Same business code. Switch the rail by changing one field.
await pay({ walletProvider: "coinbase-cdp", amount: "1.50 USDC", to: merchant }); // x402 on Base
await pay({ walletProvider: "okx",          amount: "1.50 USDC", to: merchant }); // OAP-CEX on OKX
await pay({ walletProvider: "stellar",      amount: "1.50 USDC", to: merchant }); // Stellar SEP-31

๐Ÿ“– Full strategic framing โ†’ docs/POSITIONING.md ยท Resume any session โ†’ docs/STATE.md


๐Ÿ“Š Coverage at a glance

Layer What it abstracts Count
L0 ยท CLI oap (config ยท doctor ยท conformance ยท pay ยท session ยท audit) ยท oap-proxy ยท certifier-cli โœ…
L1 ยท Agent Framework Plugins LangChain ยท LlamaIndex ยท Vercel AI ยท Mastra ยท CrewAI ยท AutoGen ยท Strands ยท โ€ฆ 35
L2 ยท Orchestration PaymentManager ยท ProtocolRouter ยท WalletRouter ยท 7-Layer Guardrail ยท refund/subscription/receipt โœ…
L3 ยท Protocol Adapters x402 ยท AP2 ยท OAP-CEX ยท ACP ยท Web Monetization ยท GNAP ยท MPP ยท L402 ยท โ€ฆ 22
L4 ยท Wallet Connectors EVM ยท CEX ยท MPC/smart-account ยท Move ยท Cosmos ยท Bitcoin/UTXO ยท โ€ฆ (8 L2-confirmed) 61
L5 ยท Settlement EVM RPC ยท CEX REST ยท Solana RPC ยท IBC ยท Hedera Mirror โœ…
SDKs TypeScript ยท Python ยท Go ยท Java ยท Rust (+ in-process engines) 6 langs

4,114 tests passing across 5 languages ยท 0 failures ยท CI-gated ยท live on AWS


โšก Quickstart

git clone https://github.com/neosun100/openAgentPay && cd openAgentPay
pnpm install           # Node โ‰ฅ 22.13, pnpm โ‰ฅ 11
pnpm demo              # โ†’ API on :8787  +  Web UI on http://localhost:5173

Then open the 7-tab control panel: Run ยท How It Works ยท AI Agent ยท Guardrail ยท Spend Analytics ยท Wallet Matrix ยท Certify.

Run the test suite or a live proof:

pnpm -r test           # 3,921 TS tests (+ Python/Go/Java/Rust in their dirs)
pnpm smoke:okx         # real OKX Demo Trading sandbox โ€” OAP-CEX signature accepted live
pnpm smoke:l2evm       # Magic + ZeroDev addresses queryable on live Base Sepolia
pnpm l2:verify         # Stellar + Aptos + Sui funded on-chain via public faucets (3/3)

๐Ÿ’ณ Wallet coverage (61 connectors)

8 are L2-confirmed โœ… โ€” verified against a real chain or exchange (not just signature-real). The rest are L1 conformance-green (real in-process keypair + real signature; broadcast pluggable). Every connector passes the 25-test conformance suite.

EVM & L2 โ€” arbitrum ยท base ยท blast ยท linea ยท mantle ยท mode ยท optimism ยท polygon ยท scroll ยท zksync ยท berachain ยท berachain-mainnet ยท ronin ยท sonic ยท metamask ยท walletconnect

Managed ยท MPC ยท Smart-account โ€” coinbase-cdp ยท circle ยท fireblocks ยท magic โœ… ยท zerodev โœ… ยท web3auth ยท crossmint ยท stripe-privy

CEX (OAP-CEX) โ€” binance ยท okx โœ… ยท bitget ยท bybit ยท hashkey

Non-EVM chains โ€” solana ยท aptos โœ… ยท sui โœ… ยท movement ยท near ยท near-mainnet ยท cosmos ยท celestia ยท initia ยท injective ยท sei ยท stellar โœ… ยท hedera ยท tron ยท tron-mainnet ยท ton ยท ton-mainnet ยท polkadot ยท cardano ยท flow ยท tezos ยท ripple ยท aleo ยท starknet ยท fuel ยท stacks ยท algorand ยท hashkey (hashkey-chain โœ…)

Bitcoin & UTXO โ€” bitcoin ยท litecoin ยท dogecoin ยท monero ยท kaspa


๐Ÿ”Œ Protocol coverage (22 adapters)

Every adapter passes the 13-test protocol conformance suite + composition v3. One ProtocolAdapter interface (detect / parsePaymentRequired / buildRetry / preSubmit) spans six standards ecosystems.

Ecosystem Adapters
Coinbase x402 (v1/v2 HTTP-402 micropayments)
Google ap2 (mandate envelope, W3C VC) ยท a2a-discovery (AP2 v0.2 agent-to-agent)
OpenAI / Stripe acp (Agentic Commerce) ยท mpp (Merchant Payments Protocol)
W3C web-monetization (Interledger) ยท w3c-payment (Payment Request + SPC)
IETF gnap (RFC 9635 grant negotiation)
Lightning l402 (LSAT)
CEX cex-pay โ€” OAP-CEX v0.1 (Binance + OKX live-verified)
Chain-native stellar ยท sui ยท aptos ยท cosmos-ibc ยท hedera-hcs ยท tron-usdt ยท open-payments
Agent identity / registry erc8004 ยท erc7777 ยท skyfire ยท virtuals-acp ยท nevermined

Dual-rail design: x402 settles on-chain (EVM, EIP-3009); OAP-CEX settles inside a centralized exchange (HMAC-signed authorization) โ€” because CEXes are structurally off-chain and forcing x402 onto them is the wrong abstraction. Same PaymentManager drives both.


๐Ÿค– Agent framework coverage (35 plugins)

Each plugin is a thin shim over the framework-agnostic OpenAgentPayLlamaTool kernel โ€” zero reimplemented payment logic.

TypeScript (28) โ€” langchain ยท llamaindex ยท langgraph ยท vercel-ai ยท mastra ยท openai-agents ยท openai-swarm ยท google-adk ยท crewai-flows ยท dspy ยท agno ยท smolagents ยท letta ยท agentscope ยท marvin ยท voltagent ยท spinai ยท motia ยท xsai ยท mcp-tool ยท cloudflare-agents ยท instructor-js ยท inngest-agentkit ยท atomic-agents ยท pydantic-graph ยท llama-stack ยท llamaindex-workflows ยท ai-sdk-v5

Python (7) โ€” strands ยท autogen ยท crewai ยท semantic-kernel ยท pydantic-ai ยท bedrock-agentcore ยท instructor


๐Ÿงฐ SDKs (6 languages)

Language Package Mode
TypeScript @openagentpay/core in-process engine + HTTP client
Python packages/python-sdk full async HTTP client
Go sdks/go HTTP client + in-process engine
Java sdks/java HTTP client + in-process engine
Rust sdks/rust async HTTP client
โ€” @openagentpay/proxy LiteLLM-Proxy-style multi-tenant server

๐Ÿ—๏ธ Architecture

OpenAgentPay 5+1 layer architecture
L0  CLI         oap (config/doctor/conformance/pay/session/audit) ยท oap-proxy ยท certifier-cli
L1  Plugin      35 agent-framework adapters (thin shims over one kernel)
L2  Orchestration  PaymentManager ยท ProtocolRouter ยท WalletRouter ยท 7-Layer Guardrail ยท finance
L3  Protocol    22 ProtocolAdapters (detect โ†’ parse โ†’ buildRetry โ†’ preSubmit)
L4  Wallet      61 WalletConnectors (createInstrument ยท getBalance ยท signAuthorization ยท settle)
L5  Settlement  EVM RPC ยท CEX REST ยท Solana RPC ยท IBC ยท Hedera Mirror

The contract everything implements lives in packages/core/src/types.ts. Routers are the LiteLLM-Router equivalents. Money is always { amountAtomic, decimals, currency } โ€” never a float.


๐Ÿ›ก๏ธ 7-Layer Guardrail

7-Layer Guardrail

A defense-in-depth policy engine inspired by AWS Bedrock AgentCore Payments, open-sourced: spend limits ยท per-agent budgets ยท jurisdiction rules ยท OFAC/Chainalysis/TRM screening ยท two-person approval ยท jurisdiction gating ยท WORM audit. Audit sinks: in-memory ยท console ยท DynamoDB ยท S3 Object-Lock (WORM, SOX/MRM-grade). See docs/GOVERNANCE.md.


โœ… Quality & proof

  • 4,114 tests across 5 languages (TS 3,921 ยท Python 89 ยท Go 56 ยท Java 30 ยท Rust 18), 0 failures, CI-gated on every PR.
  • On-chain verified: HashKey Chain + Coinbase CDP (Base Sepolia) real txs; Stellar + Aptos + Sui funded via public faucets (pnpm l2:verify, 3/3).
  • Dual-CEX live: Binance Pay + OKX Demo Trading โ€” the OAP-CEX OK-ACCESS-SIGN recipe is accepted by the real OKX API (pnpm smoke:okx), proving the protocol is not Binance-specific.
  • L2 EVM live: Magic + ZeroDev addresses are queryable against the real Circle USDC contract on Base Sepolia (pnpm smoke:l2evm).

Federated conformance certifier

@openagentpay/certifier issues HMAC-signed ConformanceCertificates and ships a reusable GitHub Actions workflow (.github/workflows/certify.yml, workflow_call) so any third party can self-certify a wallet/protocol package and obtain a verifiable badge โ€” the oapconformance.io engine for letting the ecosystem grow its own connectors.


๐Ÿงฉ Add your own wallet

Implement the 5-method WalletConnector interface and pass the conformance suite:

interface WalletConnector {
  getCapabilities(): WalletCapabilities;                 // pure
  createInstrument(input): Promise<Instrument>;          // throw on empty userId; idempotent
  getBalance(instrumentId): Promise<Money>;              // throw on unknown id
  signAuthorization(input): Promise<SignedAuthorization>; // throw on wrong protocol
  settle(signed): Promise<SettlementResult>;
}
oap conformance test --pkg packages/wallet-your-wallet   # must pass all 25 tests

Full guide โ†’ CONTRIBUTING.md. The 25-test suite is real protection โ€” it caught a silent-accept bug in wallet-hashkey during development.


๐Ÿ—บ๏ธ Roadmap

Current main โ†’ v1.0 GA arc is tracked in docs/ROADMAP.md. Highlights shipped: federated certifier ยท oap pay/session/audit ยท S3-WORM audit ยท Go/Java in-process engines ยท AP2 v0.2 A2A ยท ACP/Web-Monetization/GNAP ยท dual-CEX live proof.


๐Ÿค Contributing

We welcome new wallet connectors, protocol adapters, and framework plugins. See CONTRIBUTING.md for the build/test workflow, conformance gates, and "good first contribution" ideas.


๐Ÿ“ License & disclaimer

Apache-2.0 โ€” see LICENSE. Maintained by @neosun100.

This is an independent open-source project and does not represent the official position of AWS, Coinbase, Stripe, Google, OpenAI, Binance, OKX, HashKey, or any other named party. Testnet/sandbox only until v1.0 GA.

About

๐ŸŒ Open, pluggable Agent Payments platform for AWS Bedrock AgentCore โ€” any wallet, any protocol, any governance. Live on HashKey Chain Testnet.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors