Files
tokens-reef/docs/MERGE_QUICKREF.md
User d96a9f384a
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled
feat: merge sub2apipro features and add Chinese model pricing
## Merged Features from sub2apipro
- Sora video generation integration (OpenAI Sora API)
- Group management enhancements
- Usage log improvements
- Security headers middleware

## Chinese Model Pricing Updates
- GLM-5, GLM-5-Turbo, GLM-5.1, GLM-4.7, GLM-4.5-Air
- Baichuan4, Baichuan4-Turbo, Baichuan4-Air, Baichuan-M3-Plus
- DeepSeek-V3, DeepSeek-V3.2, DeepSeek-R1
- Qwen3-8B (free), Qwen2.5-72B-Instruct

## URL Whitelist Additions
- api.baichuan-ai.com (百川智能)
- api.siliconflow.cn (硅基流动)
- api.z.ai (智谱国际)
- api.groq.com (Groq加速推理)

## Documentation
- Added merge guide (docs/MERGE_GUIDE.md)
- Added quick reference (docs/MERGE_QUICKREF.md)
- Added review reports (docs/reviews/)
2026-04-15 12:02:07 +08:00

1.7 KiB

合并快速参考

一键合并命令

# 标准合并流程
git fetch upstream && git merge upstream/main && cd backend && go build ./cmd/server

必须保留的本地功能

1. 国内模型定价 (billing_service.go)

  • initFallbackPricing() - 所有国内模型fallback定价
  • getFallbackPricing() - 国内模型匹配逻辑

2. 定价数据 (model_prices_and_context_window.json)

  • GLM系列、通义千问、Kimi、MiniMax、豆包、百川、DeepSeek

3. URL白名单 (config.go)

  • 所有国内模型API域名

冲突解决优先级

  1. 官方代码 → 基础逻辑
  2. 本地定价 → 国内模型支持
  3. 合并双方 → URL白名单、配置

验证命令

# 编译验证
go build ./cmd/server

# JSON验证
python -c "import json; json.load(open('resources/model-pricing/model_prices_and_context_window.json', encoding='utf-8'))"

# 测试验证
go test ./... -v -count=1

定价更新来源

厂商 URL
智谱 open.bigmodel.cn/pricing
通义 help.aliyun.com/zh/dashscope
Kimi platform.moonshot.cn/docs/pricing
MiniMax platform.minimaxi.com/pricing
豆包 volcengine.com/docs/82379/1290310
DeepSeek api-docs.deepseek.com/quick_start/pricing
百川 platform.baichuan-ai.com/prices
硅基流动 siliconflow.cn/pricing

回滚命令

# 合并前回滚
git merge --abort

# 合并后回滚
git reset --hard HEAD~1

完整检查清单

  • git fetch upstream
  • git merge upstream/main
  • 解决冲突(保留国内模型配置)
  • go build ./cmd/server
  • JSON格式验证
  • 国内模型定价完整
  • URL白名单完整
  • git commit && git push