💳 Agent Payments — Every Payment Rail for AI Agents
One skill. Every payment rail your agent needs.
- - Stripe — Fiat payments, invoices, subscriptions, payment links
- Coinbase Commerce — Accept crypto (BTC, ETH, USDC) through a trusted brand
- Spraay — Batch payments to multiple recipients across 13+ chains, x402 micropayments for agent-to-agent commerce
Quick Start
Which rail do I need?
| Use Case | Rail | Command |
|---|
| Charge a customer in USD | Stripe | INLINECODE0 |
| Create an invoice |
Stripe |
pay stripe invoice |
| Set up recurring billing | Stripe |
pay stripe subscribe |
| Accept crypto from a customer | Coinbase |
pay coinbase charge |
| Pay 1 person in USDC/ETH | Spraay |
pay spraay send |
| Pay 10-1000 people at once | Spraay |
pay spraay batch |
| Agent-to-agent micropayment | Spraay x402 |
pay spraay x402 |
| Payroll (team/contractors) | Spraay |
pay spraay payroll |
| Check any payment status | Any |
pay status <id> |
Setup
Each payment rail requires its own API key. You only need to configure the rails you use:
CODEBLOCK0
The skill works with any combination — install once, enable rails as needed.
Rail 1: Stripe (Fiat Payments)
Full Stripe integration for traditional payment processing. Your agent can charge customers, create invoices, manage subscriptions, and generate payment links.
Create a Payment (One-Time Charge)
CODEBLOCK1
Parameters:
- -
amount — Amount in cents (2000 = $20.00) - INLINECODE10 — Three-letter ISO code (usd, eur, gbp, etc.)
- INLINECODE11 — What the payment is for
- INLINECODE12 — Optional, sends receipt to customer
- INLINECODE13 — Custom key-value pairs for your records
Create an Invoice
CODEBLOCK2
Create a Subscription
CODEBLOCK3
Create a Payment Link
CODEBLOCK4
Check Payment Status
CODEBLOCK5
Status values: requires_payment_method, requires_confirmation, requires_action, processing, succeeded, INLINECODE19
Refund a Payment
CODEBLOCK6
For detailed Stripe API reference, see references/stripe-rail.md.
Rail 2: Coinbase Commerce (Crypto Acceptance)
Accept cryptocurrency payments through Coinbase Commerce. Customers pay in BTC, ETH, USDC, or other supported coins. Funds settle to your Coinbase account.
Create a Charge
CODEBLOCK7
Response includes:
- -
hosted_url — Coinbase-hosted checkout page (redirect customer here) - INLINECODE22 — Direct crypto addresses for each supported coin
- INLINECODE23 — Charge expires after 60 minutes
Check Charge Status
CODEBLOCK8
Status timeline: NEW → PENDING → CONFIRMED / FAILED / INLINECODE28
List All Charges
CODEBLOCK9
Cancel a Charge
CODEBLOCK10
For detailed Coinbase Commerce reference, see references/coinbase-rail.md.
Rail 3: Spraay (Batch Payments + x402 Micropayments)
Spraay is the batch payment and micropayment layer. Pay multiple recipients in a single transaction across 13+ blockchains, or use x402 micropayments for agent-to-agent commerce.
What makes Spraay unique: Neither Stripe nor Coinbase can send payments to multiple recipients at once. Spraay does this natively — pay your whole team, distribute tokens to a community, or airdrop to thousands of addresses in one transaction.
Batch Payment (Multiple Recipients)
CODEBLOCK11
Single Send
CODEBLOCK12
Supported Chains (13+)
Base, Ethereum, Arbitrum, Polygon, BNB Chain, Avalanche, Unichain, Plasma, BOB, Solana, Bittensor, Stacks, Bitcoin
x402 Micropayments (Agent-to-Agent)
x402 enables pay-per-request API calls. Your agent pays fractions of a cent per call — no subscriptions, no API keys, just HTTP payments.
CODEBLOCK13
The Spraay gateway has 76+ x402 endpoints across 16 categories:
- - AI Inference, Search/RAG, Communication (Email, XMTP)
- IPFS/Storage, Compliance (KYC/AML), Oracle, GPU/Compute
- RPC (7 chains), Data Reads, Bridge, Escrow, Payroll
- Wallet Provisioning, DeFi Reads, Robot Task Protocol
Bitcoin Batch Payments (PSBT)
CODEBLOCK14
For detailed Spraay reference, see references/spraay-rail.md.
Cross-Rail Workflows
Workflow: Accept fiat, pay team in crypto
- 1. Customer pays via Stripe → INLINECODE31
- Confirm payment received → INLINECODE32
- Batch pay your team in USDC via Spraay → INLINECODE33
Workflow: Crypto invoice with fiat fallback
- 1. Create Coinbase Commerce charge → INLINECODE34
- If customer prefers fiat, create Stripe payment link → INLINECODE35
- Track both → INLINECODE36
Workflow: Agent-to-agent service payment
- 1. Agent A calls Agent B's API via x402 → INLINECODE37
- Payment settles automatically via HTTP headers
- No invoicing, no accounts, no API keys needed
Workflow: Payroll (contractors worldwide)
- 1. US contractors → Stripe (ACH/direct deposit)
- International contractors → Spraay batch (USDC on Base/Polygon)
- One skill handles both rails
Payment Status (Universal)
Check payment status across any rail:
CODEBLOCK15
Reference Docs
See references/ for detailed documentation on each payment rail:
- -
stripe-rail.md — Full Stripe API reference (PaymentIntents, Invoices, Subscriptions, Customers) - INLINECODE40 — Coinbase Commerce API reference (Charges, Webhooks, Checkout)
- INLINECODE41 — Spraay Protocol reference (Batch payments, x402 gateway, Bitcoin PSBT, supported chains, RTP)
Links
- - Stripe Docs: https://docs.stripe.com
- Coinbase Commerce Docs: https://docs.cdp.coinbase.com/commerce
- Spraay Gateway: https://gateway.spraay.app
- Spraay Docs: https://docs.spraay.app
- GitHub: https://github.com/plagtech/agent-payments
💳 Agent Payments — AI代理的全面支付通道
一个技能。您的代理所需的所有支付通道。
- - Stripe — 法币支付、发票、订阅、支付链接
- Coinbase Commerce — 通过可信品牌接受加密货币(BTC、ETH、USDC)
- Spraay — 跨13+条链向多个收款人批量支付,x402微支付用于代理间交易
快速开始
我需要哪个通道?
| 使用场景 | 通道 | 命令 |
|---|
| 向客户收取美元费用 | Stripe | pay stripe charge |
| 创建发票 |
Stripe | pay stripe invoice |
| 设置定期计费 | Stripe | pay stripe subscribe |
| 接受客户加密货币支付 | Coinbase | pay coinbase charge |
| 向1人支付USDC/ETH | Spraay | pay spraay send |
| 一次性支付10-1000人 | Spraay | pay spraay batch |
| 代理间微支付 | Spraay x402 | pay spraay x402 |
| 薪资发放(团队/承包商) | Spraay | pay spraay payroll |
| 查询任何支付状态 | 任意 | pay status
|
设置
每个支付通道需要自己的API密钥。您只需配置使用的通道:
bash
法币支付(Stripe)
export STRIPESECRETKEY=sklive...
加密货币收款(Coinbase Commerce)
export COINBASECOMMERCEAPI_KEY=...
批量支付 + x402支付(Spraay)
export SPRAAYGATEWAYURL=https://gateway.spraay.app
该技能支持任意组合——安装一次,按需启用通道。
通道1:Stripe(法币支付)
完整的Stripe集成,用于传统支付处理。您的代理可以收取客户费用、创建发票、管理订阅和生成支付链接。
创建支付(一次性收费)
bash
curl -X POST https://api.stripe.com/v1/payment_intents \
-u $STRIPESECRETKEY: \
-d amount=2000 \
-d currency=usd \
-d paymentmethodtypes[]=card \
-d description=服务支付
参数:
- - amount — 金额(以分为单位,2000 = $20.00)
- currency — 三位ISO代码(usd、eur、gbp等)
- description — 支付用途说明
- receipt_email — 可选,向客户发送收据
- metadata[key] — 自定义键值对,用于您的记录
创建发票
bash
步骤1:创建发票项目
curl -X POST https://api.stripe.com/v1/invoiceitems \
-u $STRIPESECRETKEY: \
-d customer=cus_... \
-d amount=5000 \
-d currency=usd \
-d description=咨询服务 — 2026年3月
步骤2:创建并发送发票
curl -X POST https://api.stripe.com/v1/invoices \
-u $STRIPESECRETKEY: \
-d customer=cus_... \
-d collectionmethod=sendinvoice \
-d daysuntildue=30
步骤3:最终确定并发送
curl -X POST https://api.stripe.com/v1/invoices/{invoice_id}/finalize \
-u $STRIPESECRETKEY:
curl -X POST https://api.stripe.com/v1/invoices/{invoice_id}/send \
-u $STRIPESECRETKEY:
创建订阅
bash
curl -X POST https://api.stripe.com/v1/subscriptions \
-u $STRIPESECRETKEY: \
-d customer=cus_... \
-d items[0][price]=price_... \
-d paymentbehavior=defaultincomplete
创建支付链接
bash
curl -X POST https://api.stripe.com/v1/payment_links \
-u $STRIPESECRETKEY: \
-d lineitems[0][price]=price... \
-d line_items[0][quantity]=1
查询支付状态
bash
curl https://api.stripe.com/v1/paymentintents/{piid} \
-u $STRIPESECRETKEY:
状态值:requirespaymentmethod、requiresconfirmation、requiresaction、processing、succeeded、canceled
退款
bash
curl -X POST https://api.stripe.com/v1/refunds \
-u $STRIPESECRETKEY: \
-d paymentintent=pi...
详细的Stripe API参考,请参见 references/stripe-rail.md。
通道2:Coinbase Commerce(加密货币收款)
通过Coinbase Commerce接受加密货币支付。客户可以使用BTC、ETH、USDC或其他支持的币种支付。资金结算到您的Coinbase账户。
创建收费
bash
curl -X POST https://api.commerce.coinbase.com/charges \
-H Content-Type: application/json \
-H X-CC-Api-Key: $COINBASECOMMERCEAPI_KEY \
-d {
name: 服务支付,
description: 咨询服务费用,
pricingtype: fixedprice,
local_price: {
amount: 100.00,
currency: USD
},
metadata: {
customerid: cust123,
orderid: ord456
}
}
响应包含:
- - hostedurl — Coinbase托管的结账页面(将客户重定向至此)
- addresses — 每种支持币种的直接加密货币地址
- expiresat — 收费在60分钟后过期
查询收费状态
bash
curl https://api.commerce.coinbase.com/charges/{charge_id} \
-H X-CC-Api-Key: $COINBASECOMMERCEAPI_KEY
状态时间线:NEW → PENDING → CONFIRMED / FAILED / EXPIRED
列出所有收费
bash
curl https://api.commerce.coinbase.com/charges \
-H X-CC-Api-Key: $COINBASECOMMERCEAPI_KEY
取消收费
bash
curl -X POST https://api.commerce.coinbase.com/charges/{charge_id}/cancel \
-H X-CC-Api-Key: $COINBASECOMMERCEAPI_KEY
详细的Coinbase Commerce参考,请参见 references/coinbase-rail.md。
通道3:Spraay(批量支付 + x402微支付)
Spraay是批量支付和微支付层。跨13+条区块链在单笔交易中向多个收款人支付,或使用x402微支付进行代理间交易。
Spraay的独特之处: Stripe和Coinbase都无法一次性向多个收款人发送支付。Spraay原生支持此功能——一次性支付整个团队、向社区分发代币、或向数千个地址空投。
批量支付(多个收款人)
bash
在Base链上一笔交易支付3人
curl -X POST $SPRAAYGATEWAYURL/api/batch \
-H Content-Type: application/json \
-d {
chain: base,
token: USDC,
recipients: [
{address: 0xAlice..., amount: 100.00},
{address: 0xBob..., amount: 75.50},
{address: 0xCharlie..., amount: 200.00}
]
}
单笔发送
bash
curl -X POST $SPRAAYGATEWAYURL/api/send \
-H Content-Type: application/json \
-d {
chain: base,
token: USDC,
to: 0xRecipient...,
amount: 50.00
}
支持的链(13+)
Base、Ethereum、Arbitrum、Polygon、BNB Chain、Avalanche、Unichain、Plasma、BOB、Solana、Bittensor、Stacks、Bitcoin
x402微支付(代理间)
x402支持按请求付费的API调用。您的代理每次调用支付几分钱——无需订阅、无需API密钥,只需HTTP支付。
bash
任何启用x402的端点——支付通过HTTP头完成
curl $SPRAAYGATEWAYURL/api/ai/inference \
-H Content-Type: application/json \
-d {