agentcash Wallet & Paid APIs
Call any x402-protected API with automatic payment. Payment is the authentication — no API keys or subscriptions needed.
Setup
If the agentcash CLI is not yet installed, see rules/getting-started.md for installation and wallet setup.
Wallet Management
Your wallet is auto-created on first use and stored at ~/.agentcash/wallet.json.
Check Balance
CODEBLOCK0
Returns wallet address, USDC balance, and deposit link. Always check before expensive operations.
Redeem Invite Code
CODEBLOCK1
One-time use per code. Credits added instantly. Run npx agentcash wallet info after to verify.
Deposit USDC
- 1. Get your wallet address via INLINECODE2
- Send USDC on Base network (eip155:8453) to that address
- Or use the deposit UI: INLINECODE3
Important: Only Base network USDC. Other networks or tokens will be lost.
Calling Paid APIs
1. Discover endpoints
CODEBLOCK2
Returns all endpoints, pricing, and usage instructions. Read the instructions field — it has critical endpoint-specific guidance.
2. Check schema (optional)
CODEBLOCK3
Returns full request/response JSON schemas and pricing for a specific endpoint.
3. Make a paid request
CODEBLOCK4
Payment is automatic: sends request, gets 402 challenge, signs USDC payment, retries with credential, returns result. Payments settle only on success (2xx) — failed requests cost nothing.
Available Services
| Origin | Service | What it does |
|---|
| INLINECODE5 | StableEnrich | Research APIs: Apollo (people/org), Exa (web search), Firecrawl (scraping), Grok (X/Twitter), Google Maps, Clado (LinkedIn), Serper (news/shopping), WhitePages, Reddit, Hunter (email verification), Influencer enrichment |
| INLINECODE6 |
StableUpload | Pay-per-upload file hosting. 10MB/$0.02, 100MB/$0.20, 1GB/$2.00. 6-month TTL |
|
https://stablestudio.dev | StableStudio | AI image/video generation: GPT Image, Flux, Grok, Nano Banana, Sora, Veo, Seedance, Wan |
|
https://stablesocial.dev | StableSocial | Social media data: TikTok, Instagram, X/Twitter, Facebook, Reddit, LinkedIn. $0.06/call, async two-step |
|
https://stableemail.dev | StableEmail | Send emails ($0.02), forwarding inboxes ($1/mo), custom subdomains ($5) |
|
https://stablephone.dev | StablePhone | AI phone calls ($0.54), phone numbers ($20), top-ups ($15) |
|
https://stablejobs.dev | StableJobs | Job search via Coresignal |
Run npx agentcash discover <origin> on any origin to see its full endpoint catalog.
Quick Reference
| Task | Command |
|---|
| Check balance | INLINECODE13 |
| Redeem code |
npx agentcash wallet redeem <code> |
| Discover endpoints |
npx agentcash discover <url> |
| Check pricing/schema |
npx agentcash check <url> |
| Paid POST request |
npx agentcash fetch <url> -m POST -b '{...}' |
| Paid GET request |
npx agentcash fetch <url> |
Tips
- - Always discover first — the
instructions field has critical endpoint-specific patterns and required parameters. - Payments settle only on success (2xx) — failed requests cost nothing.
- Use
npx agentcash check <url> when unsure about request/response format. - Add
--format json for machine-readable output, --format pretty for human-readable. - Add
-v for verbose output to see payment details. - Network: Base (eip155:8453), Currency: USDC.
Troubleshooting
| Issue | Solution |
|---|
| "Command not found" | Run INLINECODE24 |
| "Insufficient balance" |
Check balance, deposit USDC or redeem invite code |
| "Payment failed" | Transient error — retry the request |
| "Invalid invite code" | Code already used or doesn't exist |
| Balance not updating | Wait for Base network confirmation (~2 sec) |
技能名称: agentcash-wallet
详细描述:
agentcash 钱包与付费 API
通过自动支付调用任何受 x402 保护的 API。支付即认证——无需 API 密钥或订阅。
设置
如果尚未安装 agentcash CLI,请参阅 rules/getting-started.md 了解安装和钱包设置。
钱包管理
您的钱包在首次使用时自动创建,并存储在 ~/.agentcash/wallet.json。
查看余额
bash
npx agentcash wallet info
返回钱包地址、USDC 余额和充值链接。在执行高消耗操作前请务必检查。
兑换邀请码
bash
npx agentcash wallet redeem YOUR_CODE
每个代码仅限一次性使用。积分即时到账。之后运行 npx agentcash wallet info 验证。
充值 USDC
- 1. 通过 npx agentcash wallet info 获取您的钱包地址
- 在 Base 网络(eip155:8453)上向该地址发送 USDC
- 或使用充值界面:https://x402scan.com/mcp/deposit/
重要提示:仅支持 Base 网络上的 USDC。其他网络或代币将丢失。
调用付费 API
1. 发现端点
bash
npx agentcash discover https://stableenrich.dev
返回所有端点、定价和使用说明。请阅读 instructions 字段——其中包含关键的端点特定指导。
2. 检查模式(可选)
bash
npx agentcash check https://stableenrich.dev/api/apollo/people-search
返回特定端点的完整请求/响应 JSON 模式及定价。
3. 发起付费请求
bash
npx agentcash fetch https://stableenrich.dev/api/apollo/people-search -m POST -b {persontitles: [CEO], personlocations: [San Francisco]}
支付自动完成:发送请求、获取 402 挑战、签署 USDC 支付、携带凭证重试、返回结果。仅在成功(2xx)时结算支付——失败的请求不产生费用。
可用服务
| 来源 | 服务 | 功能描述 |
|---|
| https://stableenrich.dev | StableEnrich | 研究 API:Apollo(人员/组织)、Exa(网页搜索)、Firecrawl(爬取)、Grok(X/Twitter)、Google Maps、Clado(LinkedIn)、Serper(新闻/购物)、WhitePages、Reddit、Hunter(邮箱验证)、影响者数据丰富 |
| https://stableupload.dev |
StableUpload | 按次付费文件托管。10MB/$0.02,100MB/$0.20,1GB/$2.00。6个月有效期 |
| https://stablestudio.dev | StableStudio | AI 图像/视频生成:GPT Image、Flux、Grok、Nano Banana、Sora、Veo、Seedance、Wan |
| https://stablesocial.dev | StableSocial | 社交媒体数据:TikTok、Instagram、X/Twitter、Facebook、Reddit、LinkedIn。$0.06/次,异步两步操作 |
| https://stableemail.dev | StableEmail | 发送邮件($0.02)、转发邮箱($1/月)、自定义子域名($5) |
| https://stablephone.dev | StablePhone | AI 电话($0.54)、电话号码($20)、充值($15) |
| https://stablejobs.dev | StableJobs | 通过 Coresignal 进行职位搜索 |
在任何来源上运行 npx agentcash discover 查看其完整端点目录。
快速参考
| 任务 | 命令 |
|---|
| 查看余额 | npx agentcash wallet info |
| 兑换代码 |
npx agentcash wallet redeem
|
| 发现端点 | npx agentcash discover |
| 检查定价/模式 | npx agentcash check |
| 付费 POST 请求 | npx agentcash fetch -m POST -b {...} |
| 付费 GET 请求 | npx agentcash fetch |
提示
- - 始终先进行发现——instructions 字段包含关键的端点特定模式和必需参数。
- 仅在成功(2xx)时结算支付——失败的请求不产生费用。
- 对请求/响应格式不确定时,使用 npx agentcash check 。
- 添加 --format json 获取机器可读输出,--format pretty 获取人类可读输出。
- 添加 -v 获取详细输出以查看支付详情。
- 网络:Base(eip155:8453),货币:USDC。
故障排除
| 问题 | 解决方案 |
|---|
| 命令未找到 | 运行 npm install -g agentcash |
| 余额不足 |
检查余额,充值 USDC 或兑换邀请码 |
| 支付失败 | 临时错误——重试请求 |
| 无效邀请码 | 代码已使用或不存在 |
| 余额未更新 | 等待 Base 网络确认(约2秒) |