关于 Gas Estimator X402
Gas Estimator X402 是面向 AI Agent 的多链 EVM Gas 估算服务,可一次查询 Ethereum、Base、Polygon、Arbitrum 和 BSC 的费用,并比较当前成本最低的链。它通过 x402 按次付费。
主要功能
- 01一次查询多个 EVM 链
- 02提供低、中、高 Gas 估算
- 03估算简单转账的美元费用
- 04指出当前成本最低的链
- 05通过 x402 按次付费
适用场景
- 01跨链交易前比较 Gas 成本
- 02为多链 Agent 选择费用较低的链
MCP 相关
提供 MCP 服务端点,向 MCP 客户端暴露 `crypto_estimate_gas` 工具,用于查询多条 EVM 链的 Gas 估算。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://gas-estimator.api.klymax402.com/mcpclaude mcp add --transport sse gas-estimator-x402 https://gas-estimator.api.klymax402.com/mcp{"mcpServers":{"gas-estimator-x402":{"type":"sse","url":"https://gas-estimator.api.klymax402.com/mcp"}}}在 Cursor 中打开{"servers":{"gas-estimator-x402":{"type":"sse","url":"https://gas-estimator.api.klymax402.com/mcp"}}}在 VS Code 中打开{"mcpServers":{"gas-estimator-x402":{"type":"sse","url":"https://gas-estimator.api.klymax402.com/mcp"}}}{"mcpServers":{"gas-estimator-x402":{"serverUrl":"https://gas-estimator.api.klymax402.com/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
Gas Estimator API
一次调用即可获取多条链的 Gas 价格:ETH、Base、Polygon、Arbitrum、BSC。比较各条链,找到成本最低的链。通过 x402 按次付费(在 Base L2 上使用 USDC),无需 API 密钥、无需注册,也没有速率限制。
这是 klymax402 市场的一部分——面向 AI Agent 的 100 个 x402 微支付 API,只需一个钱包,使用 Base 上的 USDC。
快速入门——MCP
添加到 MCP 客户端配置中(Claude Desktop、Cursor、ElizaOS 等):
{
"mcpServers": {
"gas-estimator": {
"url": "https://gas-estimator.api.klymax402.com/mcp"
}
}
}
快速入门——HTTP(x402)
curl -X POST "https://gas-estimator.api.klymax402.com/api/estimate" \
-H "Content-Type: application/json" \
-d '{}'
# -> 402 Payment Required, with an x402 payment challenge in the response body
任何支持 x402 的客户端(@x402/fetch、x402-agent-tools、ATXP)都能自动处理 402 -> 签名 -> 重试流程。
工具
| 工具 | 方法 | 路径 | 价格 | 描述 |
|---|---|---|---|---|
crypto_estimate_gas | POST | /api/estimate | $0.005 | 获取多个 EVM 链的 Gas 价格估算及 USD 成本 |
crypto_estimate_gas
需要一次比较多个 EVM 链的 Gas 价格时使用。以 JSON 格式返回多链 Gas 估算结果。
参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
chain | string | 否 | 链名称:ethereum、base、polygon、arbitrum、bsc。省略则返回所有链。 |
返回值
chains——包含链名称的链上 Gas 数据数组low——慢速确认时的 Gas 价格,单位为 gweimedium——标准确认时的 Gas 价格,单位为 gweihigh——快速确认时的 Gas 价格,单位为 gweitransferCostUsd——各条链上简单转账的预估 USD 成本cheapestChain——当前 Gas 成本最低的链
响应示例:
{"chains":[{"chain":"base","low":0.005,"medium":0.008,"high":0.012,"transferCostUsd":0.01},{"chain":"ethereum","low":12.5,"medium":18.0,"high":25.0,"transferCostUsd":0.85}],"cheapestChain":"base"}
适用场景:跨链交易前选择成本最低的链。对于需要优化 Gas 成本的多链 Agent 至关重要。
不适用于:兑换报价(请使用 dex_get_swap_quote)、跨链桥(请使用 bridge_find_best_route)。
Agent 提示词示例
- “一次比较多个 EVM 链的 Gas 价格”
付款
- 协议:x402 ——基于 HTTP 的按次付费,无需注册,无需 API 密钥
- 网络:Base L2(
eip155:8453) - 资产:USDC
- 支付服务:Coinbase CDP(主要),PayAI(备用)
- 也可通过 ATXP 访问(OAuth 封装的 x402,受 RFC 9728 受保护资源元数据保护)
klymax402 的一部分
面向 AI Agent 的 100 个 x402 微支付 API——只需一个钱包,使用 Base 上的 USDC,无需注册。
- 目录:https://klymax402.com/llms.txt
- 完整 API 参考:https://klymax402.com/llms-full.txt
- 实时统计:https://klymax402.com/stats
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。