你的交易事件, 进入你自己的系统
当交易开仓或平仓、订单未能下达或策略暂停时,Fexr 会发送签名的 webhook。REST API 读取同样的账户、订单和额度,LLM 通过 MCP 获得同样的工具。
npm install fexrJS/TS SDK on npmwebhook 能告诉你什么
Each endpoint subscribes to the events it wants, one by one, by group such as trade.*, or all of them with *. These are the same events the app notifies you about.
| 事件 | 何时发送 |
|---|---|
trade.opened · trade.closed | 你账户中的仓位开仓或平仓,无论由你、你的代理还是策略发起 |
trade.failed | Fexr 没有下单,例如因为交易前检查拒绝了它 |
trade.strategy_paused | 某个策略在多次被拒后自动暂停 |
risk.liquidation · risk.account_margin | 某个仓位接近强平,或账户保证金不足 |
apm.session_started · apm.session_ended · apm.drawdown | 目标会话开始、结束或触及回撤档位 |
agent.rule_applied · agent.steered | 代理执行了你的一条规则,或你调整了它的方向 |
markets.watchlist_alert · markets.ai_signal | 你关注的标的触发提醒,或信号发出 |
vault.trading · vault.event | 你所在的金库发生交易、投票或变更 |
The full list is returned by GET /users/me/webhooks/events.
投递如何运作
Fexr-Signature: t=<unix>,v1=<hex>, an HMAC-SHA256 of the timestamp and body with your endpoint's secret.// Verify a Fexr webhook in Node
import crypto from 'node:crypto';
export function verify(rawBody, header, secret) {
const { t, v1 } = Object.fromEntries(header.split(',').map(p => p.split('=')));
const mac = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));
}每个计划包括什么
| 方案 | API | 网络钩子 |
|---|---|---|
| 自由的 | 无 API 密钥。x402 端点,在 Base 上以 USDC 按次付费,无需账户 | 没有任何 |
| Fexr Plus,每 30 天 $15 | 每天 1,000 次请求的 API 密钥 | 1 个端点 |
| Fexr Desk,每年 $2,500 | 每天 50,000 次请求,每个代理一把密钥,仅限组织的端点 | 5 个个人端点,外加工作区 webhook |
移动资金或下单的调用还需要 DPoP 证明(RFC 9449):由持有密钥的设备生成的全新签名,因此单独复制令牌没有任何作用。 API documentation
给你的 LLM 同样的工具
Claude、ChatGPT、Cursor 或你自己的代理都可以通过 MCP 或 x402 调用 Fexr 的类型化工具:市场数据、你的账户和订单,均受你钱包设定的额度约束。
x402 volume measured —
Common questions
如何添加 webhook?
In the app or with POST /users/me/webhooks: give an HTTPS URL and the events you want. Fexr returns the signing secret once, and you can send a test event straight away.
如果我的端点宕机会怎样?
Fexr 会在 1 分钟、5 分钟、30 分钟、2 小时、6 小时和 12 小时后重试。连续失败 20 次后,该端点会被关闭,直到你重新开启。
webhook 或 API 密钥能动我的钱吗?
不能。webhook 只负责通知。下单的 API 调用与 App 走同一把交易密钥和同样的十项交易前检查,而这把密钥无法提现。
使用数据需要账户吗?
不需要。x402 端点在 Base 上以 USDC 按次付费,无需密钥和账户。API 密钥随 Fexr Plus 或 Fexr Desk 提供。
有 SDK 吗?
Yes, for JavaScript and TypeScript: npm install fexr. Other languages use the REST API and the OpenAPI spec.
进一步探索
- API & SDK — 密钥、认证和端点参考
- Teams & Funds — SSO、每个代理独立的身份,以及签名的审计记录
- Fexr 如何执行 — API 调用之后订单会经历什么
- Agentic Safety — 每笔订单的十项检查
