alchemy-openapi-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAlchemy Prices API Skill
Alchemy Prices API 技能
Use this skill to run Alchemy Prices API operations through + OpenAPI.
uxcReuse the skill for shared execution, auth, and error-handling guidance.
uxc使用此技能通过 + OpenAPI运行Alchemy Prices API操作。
uxc复用技能以实现共享执行、认证和错误处理指导。
uxcPrerequisites
前提条件
- is installed and available in
uxc.PATH - Network access to .
https://api.g.alchemy.com - Access to the curated OpenAPI schema URL:
https://raw.githubusercontent.com/holon-run/uxc/main/skills/alchemy-openapi-skill/references/alchemy-prices.openapi.json
- An Alchemy API key.
- 已安装且可在
uxc中访问。PATH - 可访问的网络权限。
https://api.g.alchemy.com - 可访问精心整理的OpenAPI schema URL:
https://raw.githubusercontent.com/holon-run/uxc/main/skills/alchemy-openapi-skill/references/alchemy-prices.openapi.json
- 一个Alchemy API密钥。
Scope
适用范围
This v1 skill intentionally covers the narrow Prices API surface:
- token price lookup by symbol
- token price lookup by contract address
- historical token prices
This skill does not cover:
- node JSON-RPC
- NFT or portfolio APIs
- write operations
- the broader Alchemy API surface
- multi-symbol batch lookup in one call
uxc
此v1版本技能仅涵盖有限的Prices API功能:
- 通过代币符号查询代币价格
- 通过合约地址查询代币价格
- 代币历史价格
此技能不涵盖:
- 节点JSON-RPC
- NFT或投资组合API
- 写入操作
- 更广泛的Alchemy API功能
- 在单次调用中批量查询多个代币符号
uxc
Authentication
认证
Alchemy Prices API places the API key in the request path: .
/prices/v1/{apiKey}/...Configure one API-key credential with a request path prefix template:
bash
uxc auth credential set alchemy-prices \
--auth-type api_key \
--secret-env ALCHEMY_API_KEY \
--path-prefix-template "/prices/v1/{{secret}}"
uxc auth binding add \
--id alchemy-prices \
--host api.g.alchemy.com \
--scheme https \
--credential alchemy-prices \
--priority 100Validate the active mapping when auth looks wrong:
bash
uxc auth binding match https://api.g.alchemy.comAlchemy Prices API将API密钥放在请求路径中: 。
/prices/v1/{apiKey}/...使用请求路径前缀模板配置一个API密钥凭据:
bash
uxc auth credential set alchemy-prices \
--auth-type api_key \
--secret-env ALCHEMY_API_KEY \
--path-prefix-template "/prices/v1/{{secret}}"
uxc auth binding add \
--id alchemy-prices \
--host api.g.alchemy.com \
--scheme https \
--credential alchemy-prices \
--priority 100当认证出现问题时,验证当前的映射关系:
bash
uxc auth binding match https://api.g.alchemy.comCore Workflow
核心工作流程
-
Use the fixed link command by default:
command -v alchemy-openapi-cli- If missing, create it:
uxc link alchemy-openapi-cli https://api.g.alchemy.com --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/alchemy-openapi-skill/references/alchemy-prices.openapi.json alchemy-openapi-cli -h
-
Inspect operation schema first:
alchemy-openapi-cli get:/tokens/by-symbol -halchemy-openapi-cli post:/tokens/by-address -halchemy-openapi-cli post:/tokens/historical -h
-
Start with narrow single-asset reads before batch historical requests:
alchemy-openapi-cli get:/tokens/by-symbol symbols=ETH currency=USDalchemy-openapi-cli post:/tokens/by-address '{"addresses":[{"network":"eth-mainnet","address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}],"currency":"USD"}'
-
Use positional JSON only for the POST endpoints:
alchemy-openapi-cli post:/tokens/historical '{"symbol":"ETH","startTime":"2025-01-01T00:00:00Z","endTime":"2025-01-07T00:00:00Z","interval":"1d","currency":"USD"}'
-
默认使用固定链接命令:
command -v alchemy-openapi-cli- 如果未找到,创建链接:
uxc link alchemy-openapi-cli https://api.g.alchemy.com --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/alchemy-openapi-skill/references/alchemy-prices.openapi.json alchemy-openapi-cli -h
-
先查看操作schema:
alchemy-openapi-cli get:/tokens/by-symbol -halchemy-openapi-cli post:/tokens/by-address -halchemy-openapi-cli post:/tokens/historical -h
-
在批量历史请求前,先从单一资产的查询开始:
alchemy-openapi-cli get:/tokens/by-symbol symbols=ETH currency=USDalchemy-openapi-cli post:/tokens/by-address '{"addresses":[{"network":"eth-mainnet","address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}],"currency":"USD"}'
-
仅对POST端点使用JSON参数:
alchemy-openapi-cli post:/tokens/historical '{"symbol":"ETH","startTime":"2025-01-01T00:00:00Z","endTime":"2025-01-07T00:00:00Z","interval":"1d","currency":"USD"}'
Operations
操作列表
get:/tokens/by-symbolpost:/tokens/by-addresspost:/tokens/historical
get:/tokens/by-symbolpost:/tokens/by-addresspost:/tokens/historical
Guardrails
防护规则
- Keep automation on the JSON output envelope; do not use .
--text - Parse stable fields first: ,
ok,kind,protocol,data.error - Treat this v1 skill as read-only and prices-only. Do not imply RPC, trade execution, or wallet mutation support.
- API keys are sensitive because they appear in the request path. Use or
--secret-env, not shell history literals, when possible.--secret-op - is query-based in the live API.
/tokens/by-symbol - The live API supports repeated parameters, but this v1 skill intentionally narrows that endpoint to a single
symbols=query because currentsymbols=<TOKEN>query argument handling does not reliably execute array-shaped query parameters.uxc - Historical requests can expand quickly. Keep time windows tight unless the user explicitly wants a larger backfill.
- is equivalent to
alchemy-openapi-cli <operation> ....uxc https://api.g.alchemy.com --schema-url <alchemy_openapi_schema> <operation> ...
- 仅对JSON输出结果进行自动化处理,不要使用参数。
--text - 优先解析稳定字段: ,
ok,kind,protocol,data.error - 将此v1版本技能视为仅读取、仅价格查询工具。不要认为它支持RPC、交易执行或钱包操作。
- API密钥属于敏感信息,因为它们会出现在请求路径中。尽可能使用或
--secret-env,不要在shell历史记录中明文输入。--secret-op - 在实际API中是基于查询参数的。
/tokens/by-symbol - 实际API支持重复的参数,但此v1版本技能特意将该端点限制为单一
symbols=查询,因为当前symbols=<TOKEN>的查询参数处理无法可靠执行数组形式的查询参数。uxc - 历史请求的数据量可能会快速膨胀。除非用户明确需要更大范围的回溯数据,否则保持时间窗口紧凑。
- 等同于
alchemy-openapi-cli <operation> ....uxc https://api.g.alchemy.com --schema-url <alchemy_openapi_schema> <operation> ...
References
参考资料
- Usage patterns:
references/usage-patterns.md - Curated OpenAPI schema:
references/alchemy-prices.openapi.json - Alchemy Prices API docs: https://www.alchemy.com/docs/reference/prices-api
- Prices API endpoints: https://www.alchemy.com/docs/reference/prices-api-endpoints
- 使用模式:
references/usage-patterns.md - 精心整理的OpenAPI schema:
references/alchemy-prices.openapi.json - Alchemy Prices API文档: https://www.alchemy.com/docs/reference/prices-api
- Prices API端点: https://www.alchemy.com/docs/reference/prices-api-endpoints