Docs
产品是 API。网站只提供文档与状态。所有关键路径均有机器可调用接口。
Demo 密钥
- Buyer: ar_buyer_demo_key_0001
- Seller: ar_seller_demo_key_0001
- Resource: res_market_alpha ($0.25 USDC)
Endpoints
| Method | Path | 说明 |
|---|---|---|
| POST | /api/v1/principals | 创建 principal(KYA 锚点,Agent 可调) |
| POST | /api/v1/agents | 创建 Agent 钱包 + API Key + wallet_state |
| PUT | /api/v1/agents | Agent 自助 topup / 更新 policy |
| GET | /api/v1/resources | 列出可购买资源 + resource_token |
| GET | /api/v1/resources/:id | 无支付返回 HTTP 402 + x402 accepts |
| POST | /api/v1/pay | Agent 自动支付(支持 resource_token + X-Wallet-State) |
| POST | /api/v1/agent/cycle | 一键全自动:开户→上架→支付→收款 |
| POST | /api/v1/swap/quote | Failover 兑换询价 |
| GET | /api/v1/ledger | 审计导出 / 卖方核对入账 |
| GET | /api/v1/openapi | 机器可读能力发现 |
| POST | /api/v1/demo/e2e | 一键端到端无人演示 |
| GET | /api/v1/status | 服务状态 |
SDK(browser / node)
import { AgentRailClient } from "@/sdk/agentrail";
const client = new AgentRailClient({
baseUrl: "https://YOUR_HOST",
apiKey: process.env.AGENTRAIL_KEY!,
});
// 自动处理 402 / 支付 / 重试
const data = await client.fetchPaid("/api/v1/resources/res_market_alpha");费率(MVP)
platform take 2.5%(最低 $0.001)+ network $0.002 + facilitator $0.001 + swap 价差(透明写入 fee_breakdown)。自动性优先于费率最优。