Install
openclaw skills install betalpha-finance提供 A 股、基金、ETF 等实时行情及估值数据,需先配置 API Token 并动态获取最新接口端点。
openclaw skills install betalpha-finance此 Skill 需要以下凭据才能正常工作:
| 凭据名称 | 类型 | 存储位置 | 用途 | 如何获取 |
|---|---|---|---|---|
| API Token | 字符串 | ~/.config/betalpha/api_key.txt | 认证用户身份,访问金融数据 API | 扫描小程序码:https://ai.firstindex.cn/qr.jpg |
安全说明:
chmod 600)读取权限:
~/.config/betalpha/api_key.txt - 读取 API Token写入权限:
~/.config/betalpha/api_key.txt - 存储 API Token(自动配置时)~/.config/betalpha/api_cache.json - 缓存 API 端点列表(可选)此 Skill 需要访问以下外部域名:
| 域名 | 用途 | 是否必需 |
|---|---|---|
ai.firstindex.cn | 获取 API 端点列表和查询实时金融数据 | ✅ 必需 |
数据传输说明:
X-API-Key) 中发送到 ai.firstindex.cn数据收集:无
本地存储数据:
数据删除:
# 删除所有本地数据
rm -rf ~/.config/betalpha/
安全最佳实践:
ls -la ~/.config/betalpha/.gitignore 中添加:~/.config/betalpha/false - 需要用户明确请求true - 每次使用时建议确认这是一个高性能金融数据网关,提供 A 股、基金、ETF 等实时行情数据。
每次使用此 Skill 时,必须严格按以下顺序执行:
~/.config/betalpha/api_key.txt~/.config/betalpha/api_key.txt"https://ai.firstindex.cn/api/discovery~/.config/betalpha/api_cache.json)https://ai.firstindex.cn{endpoint}X-API-Key: {your_api_key}告诉 Claude 你的 API Token,Claude 会帮你配置:
我的 API Token 是:xxxxx
# Linux/Mac
mkdir -p ~/.config/betalpha
echo "YOUR_API_TOKEN" > ~/.config/betalpha/api_key.txt
# Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.config\betalpha"
Set-Content -Path "$env:USERPROFILE\.config\betalpha\api_key.txt" -Value "YOUR_API_TOKEN"
以下是基于最新 discovery 接口的可用端点(可能会更新):
/realtime/api/realtime/price/stock?codes=000001,000002codes - 股票代码,多个用逗号分隔/realtime/api/realtime/price/minute?code=000001code - 单个股票代码/realtime/api/fund-valuation/{code}/realtime/api/realtime/price/etf/realtime/api/iopv/realtime/api/news/limit/{limit}用户:查询 000001 的股票价格
助手:[步骤1] 检查配置文件... 未找到 API Token
请扫描小程序码获取 API Token:
https://ai.firstindex.cn/qr.jpg
获取后请告诉我,我会帮你配置。
用户:查询 000001 的股票价格
助手:[步骤1] 检查配置文件... ✓ API Token 已配置
[步骤2] 检查 API 接口更新... ✓ 已获取最新端点列表
[步骤3] 调用 /api/realtime-stock?codes=000001
[返回结果]
用户:查询最新的 ETF 数据
助手:[步骤1] 检查配置文件... ✓ API Token 已配置
[步骤2] 检查 API 接口更新... 发现新的端点:/api/realtime-etf-v2
[步骤3] 使用新端点查询数据
[返回结果]
https://ai.firstindex.cn/api/discovery 返回格式:
{
"name": "Betalpha Gateway",
"description_for_model": "这是一个高性能金融数据网关...",
"endpoints": [
{
"name": "API名称",
"path": "https://ai.firstindex.cn/api/endpoint",
"description": "API描述"
}
]
}
错误:未检测到 API Token
操作:展示小程序码 https://ai.firstindex.cn/qr.jpg
提示:请扫描小程序码获取 API Token
错误:API Token 无效或已过期
操作:提示用户重新获取 Token
提示:您的 Token 可能已过期,请重新扫描小程序码获取
错误:请求频率过高
操作:等待后重试
提示:请求过于频繁,请稍后再试
错误:无法获取 API 端点列表
操作:使用缓存的端点列表(如果有)
提示:API 接口信息可能已过时,但继续尝试查询
~/.config/betalpha/api_key.txt%USERPROFILE%\.config\betalpha\api_key.txt~/.config/betalpha/api_cache.json%USERPROFILE%\.config\betalpha\api_cache.json{
"last_update": "2026-03-17T10:00:00Z",
"endpoints": [
{
"name": "A股实时行情",
"path": "/api/realtime-stock",
"description": "查询股票实时行情"
}
]
}
X-API-Key: {your_api_token}
每次处理请求时,AI 必须确认:
~/.config/betalpha/api_key.txthttps://ai.firstindex.cn/api/discovery获取 API Token 的唯一方式: https://ai.firstindex.cn/qr.jpg
