{"id":24782608,"url":"https://github.com/Oaklight/onehub_prices","last_synced_at":"2025-10-12T05:31:39.329Z","repository":{"id":272620327,"uuid":"917215864","full_name":"Oaklight/siliconflow_prices","owner":"Oaklight","description":"fetch siliconflow prices via api","archived":false,"fork":false,"pushed_at":"2025-01-15T15:38:48.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-15T17:22:09.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oaklight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-15T15:19:28.000Z","updated_at":"2025-01-15T15:38:49.000Z","dependencies_parsed_at":"2025-01-15T17:22:14.505Z","dependency_job_id":"70e6510a-1e71-41df-9ea0-0374113ae032","html_url":"https://github.com/Oaklight/siliconflow_prices","commit_stats":null,"previous_names":["oaklight/siliconflow_prices"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fsiliconflow_prices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fsiliconflow_prices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fsiliconflow_prices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oaklight%2Fsiliconflow_prices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oaklight","download_url":"https://codeload.github.com/Oaklight/siliconflow_prices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236169067,"owners_count":19106105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-29T11:18:17.075Z","updated_at":"2025-10-12T05:31:39.324Z","avatar_url":"https://github.com/Oaklight.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# onehub_prices 🚀\n\n[![Stars](https://img.shields.io/github/stars/Oaklight/onehub_prices?style=flat-square)](https://github.com/Oaklight/onehub_prices/stargazers)\n[![Forks](https://img.shields.io/github/forks/Oaklight/onehub_prices?style=flat-square)](https://github.com/Oaklight/onehub_prices/network/members)\n[![Last Commit](https://img.shields.io/github/last-commit/Oaklight/onehub_prices?style=flat-square)](https://github.com/Oaklight/onehub_prices/commits/master)\n[![License](https://img.shields.io/github/license/Oaklight/onehub_prices?style=flat-square)](LICENSE)\n\n## 🌟 新功能上线\n\n**GitHub Pages 现已支持价格展示与搜索功能！访问 [https://oaklight.github.io/onehub_prices/](https://oaklight.github.io/onehub_prices/) 体验直观的价格对比和搜索** 🔍\n\n## 📜 项目简介\n\n本项目管理多个 AI 供应商的价格信息，支持自动获取和手动维护多种来源的价格数据。包含以下价格表：\n\n1. **oneapi_prices.json**: 适用于 one-hub 的完整价格表，包含所有供应商\n2. **onehub_only_prices.json**: 仅包含供应商 id \u003c= 1000 的核心供应商价格表\n3. **siliconflow_prices.json**: 来自 siliconflow 官方的原始价格数据\n4. **openrouter_prices.json**: 来自 openrouter 官方的原始价格数据\n\n所有价格数据每 6 小时自动更新，确保信息及时准确。为了保持整洁，目前的 JSON 格式的价格和 ownedby 更新结果均已迁移至 prices 分支。请关注价格表最末尾的更新时间提示图标。\n\n项目维护者：[Oaklight](https://github.com/Oaklight)\n\n## 目录\n\n1. [主要文件说明](#主要文件说明)\n2. [价格同步指导](#价格同步指导)\n   - [通过 OneHub 运营界面更新](#通过-onehub-运营界面更新)\n   - [通过 OneHub API 脚本更新](#通过-onehub-api-脚本更新-推荐)\n\n## 主要文件说明\n\n**重要提示**：\n\n- 价格表与供应商 JSON 结果均已迁移至**prices 分支**，使用前请注意更新 url 路径\n- 使用任何价格表前，请务必检查[ownedby.json](https://raw.githubusercontent.com/Oaklight/onehub_prices/prices/ownedby.json) ([jsDelivr CDN](https://cdn.jsdelivr.net/gh/Oaklight/onehub_prices@prices/ownedby.json)，[jsDelivr Mirror](https://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@prices/ownedby.json)) 以确保供应商 ID 与本项目版本一致\n- 如需使用除了 onehub 默认定义的供应商之外的价格，请确保你的`模型归属`页面与 ownedby.json 中的定义一致\n\n根据不同的使用场景选择相应的价格表：\n\n1. **完整价格表** (oneapi_prices.json)\n\n   - 包含所有供应商的价格信息\n   - 适用于需要完整价格数据的场景\n   - 地址:\n     - GitHub Raw: \u003chttps://raw.githubusercontent.com/Oaklight/onehub_prices/prices/oneapi_prices.json\u003e\n     - jsDelivr CDN: \u003chttps://cdn.jsdelivr.net/gh/Oaklight/onehub_prices@prices/oneapi_prices.json\u003e\n     - jsDelivr Mirror: \u003chttps://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@prices/oneapi_prices.json\u003e\n\n2. **核心供应商价格表** (onehub_only_prices.json)\n\n   - 仅包含供应商 id \u003c= 1000 的核心供应商\n   - 适用于只需要核心供应商价格的场景\n   - 地址:\n     - GitHub Raw: \u003chttps://raw.githubusercontent.com/Oaklight/onehub_prices/prices/onehub_only_prices.json\u003e\n     - jsDelivr CDN: \u003chttps://cdn.jsdelivr.net/gh/Oaklight/onehub_prices@prices/onehub_only_prices.json\u003e\n     - jsDelivr Mirror: \u003chttps://cdn.jsdmirror.com/npm/onehub_prices@prices/onehub_only_prices.json\u003e\n\n3. **Siliconflow 原始价格表** (siliconflow_prices.json)\n\n   - 来自 Siliconflow 官方的原始价格数据\n   - 适用于需要原始价格数据的场景\n   - 地址:\n     - GitHub Raw: \u003chttps://raw.githubusercontent.com/Oaklight/onehub_prices/prices/siliconflow_prices.json\u003e\n     - jsDelivr CDN: \u003chttps://cdn.jsdelivr.net/gh/Oaklight/onehub_prices@prices/siliconflow_prices.json\u003e\n     - jsDelivr Mirror: \u003chttps://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@prices/siliconflow_prices.json\u003e\n\n4. **OpenRouter 原始价格表** (openrouter_prices.json)\n   - 来自 OpenRouter 官方的原始价格数据\n   - 适用于需要原始价格数据的场景\n   - 地址:\n     - GitHub Raw: \u003chttps://raw.githubusercontent.com/Oaklight/onehub_prices/prices/openrouter_prices.json\u003e\n     - jsDelivr CDN: \u003chttps://cdn.jsdelivr.net/gh/Oaklight/onehub_prices@prices/openrouter_prices.json\u003e\n     - jsDelivr Mirror: \u003chttps://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@prices/openrouter_prices.json\u003e\n\n### 价格同步指导\n\n#### 通过 OneHub 运营界面更新\n\n**核对模型归属**：\n\n1. 进入`运营 -\u003e 模型归属`\n2. 对比`ownedby.json`文件，手工增删查改模型归属信息\n\n**更新模型价格**：\n\n1. 进入`运营 -\u003e 模型价格 -\u003e 更新价格`\n2. 根据需求选择上述价格表地址填入\n3. 点击`获取数据`\n4. 按需选择`覆盖数据`或`仅添加新增`\n\n#### 通过 OneHub API 脚本更新 (推荐)\n\n[`sync_pricing.py`](src/sync_pricing.py) 是一个用于同步价格数据的脚本。可选择 json 文件或 url 地址作为数据源。\n\n#### 使用步骤\n\n1. 确保已安装依赖项：\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. 运行脚本以同步 ownedby 数据：\n\n   ```bash\n   python src/sync_ownedby.py [--source_json SOURCE_JSON] [--source_url SOURCE_URL] [--manual_json MANUAL_JSON] [--manual_url MANUAL_URL]\n   ```\n\n   示例：\n\n   ```bash\n   python src/sync_ownedby.py --source_json=ownedby.json --manual_url=https://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@master/ownedby_manual.json\n   ```\n\n   如果未指定 `--json_file` 或 `--json_url` 参数，脚本将默认加载 `./ownedby.json`。\n\n3. 检查生成的 ownedby 表文件是否更新成功。\n\n4. 运行脚本以同步价格数据：\n\n   ```bash\n   python src/sync_pricing.py [--json_file JSON_FILE] [--json_url JSON_URL]\n   ```\n\n   示例：\n\n   ```bash\n   python src/sync_pricing.py --json_url=https://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@prices/oneapi_prices.json\n   ```\n\n   如果未指定 `--json_file` 或 `--json_url` 参数，脚本将默认加载 `./oneapi_prices.json`。\n\n5. 检查生成的价格表文件是否更新成功。\n\n#### 注意事项\n\n- 请确保网络连接正常，以便脚本能够访问外部 API。\n- 如果需要手动调整价格数据，请编辑 `manual_prices/` 目录中的 YAML 文件。\n- `sync_pricing.py` 脚本支持通过以下环境变量进行配置，并支持以下参数：\n  - `--json_file`: 指定 JSON 文件路径\n  - `--json_url`: 指定 JSON 数据的 URL\n  - 优先使用 url，其次使用文件\n  - `ONEHUB_URL`: API 基础 URL\n  - `ONEHUB_ADMIN_TOKEN`: 管理员认证令牌\n  - `SYNC_PRICE_OVERWRITE`: 是否覆盖现有价格（默认为 `True`）\n\n例如\n\n```bash\nexport ONEHUB_URL=\"https://onehub.your.link\" # 仅基础url,不要附带api subpath\nexport ONEHUB_ADMIN_TOKEN=\"your_admin_token\" # 网页管理后台获得\nexport SYNC_PRICE_OVERWRITE=True # 是否覆盖现有价格\n\npython src/sync_pricing.py [--json_file=./oneapi_prices.json] [--json_url=https://cdn.jsdmirror.com/gh/Oaklight/onehub_prices@prices/oneapi_prices.json]\n```\n\n## 更新说明\n\n近期主要更新包括：\n\n1. **增添 CDN 链接**:\n   - 添加 jsdelivr 链接\n   - 添加 jsdmirror 链接\n2. **自动刷新间隔调整为每 6 小时**：github action 的运行时间从原来的每天一次改为每 6 小时一次。\n3. **新增供应商支持**：添加了 Coreshub, Pollinations.AI, OpenRouter, Moonshot 等新供应商的价格支持\n4. **脚本改进**：\n   - 新增 `get_ownedby.py` 用于获取供应商归属信息\n   - 改进 `get_siliconflow_prices.py` 的模型排序逻辑\n   - 优化 `merge_prices.py` 生成 `onehub_only_prices.json`\n   - 新增 `sync_pricing.py` 用于同步价格数据，支持通过 JSON 文件或 URL 数据源\n   - 新增 `sync_ownedby.py` 用于同步 ownedby 数据，支持通过 JSON 文件或 URL 数据源\n5. **价格表维护**：\n   - 新增多个供应商的手动价格配置\n   - 优化价格合并逻辑，确保数据一致性\n6. **自动化流程**：\n   - 每日自动更新价格数据\n   - 自动生成核心供应商价格表\n   - 自动验证数据完整性\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOaklight%2Fonehub_prices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOaklight%2Fonehub_prices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOaklight%2Fonehub_prices/lists"}