feat(api): add unified Models API endpoint

- Add models_service.py with model query logic and caching
- Add models.py unified endpoint supporting Claude/OpenAI/Gemini formats
- Auto-detect API format based on request headers
- Support /v1/models and /v1beta/models (Gemini) paths
- Update route registration and comments
This commit is contained in:
fawney19
2025-12-14 20:01:19 +08:00
parent 21eedbe331
commit beae7a2616
7 changed files with 864 additions and 10 deletions

View File

@@ -3,6 +3,8 @@ Claude API 端点
- /v1/messages - Claude Messages API
- /v1/messages/count_tokens - Token Count API
注意: /v1/models 端点由 models.py 统一处理,根据请求头返回对应格式
"""
from fastapi import APIRouter, Depends, Request