Skip to content

Commit

Permalink
✨ Enhance API request handling: add O3 model support and custom API k…
Browse files Browse the repository at this point in the history
…ey authorization
  • Loading branch information
yym68686 committed Feb 1, 2025
1 parent c3e66c2 commit 1e2d9d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ async def process_request(request: Union[RequestModel, ImageGenerationRequest, A
and "gpt" not in original_model \
and "deepseek" not in original_model \
and "o1" not in original_model \
and "o3" not in original_model \
and "gemini" not in original_model \
and "learnlm" not in original_model \
and "grok" not in original_model \
Expand Down
3 changes: 3 additions & 0 deletions request.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ async def get_openrouter_payload(request, engine, provider):
if provider.get("api"):
headers['Authorization'] = f"Bearer {await provider_api_circular_list[provider['provider']].next(model)}"

elif provider['provider'].startswith("sk-"):
headers['Authorization'] = f"Bearer {provider['provider']}"

url = provider['base_url']

messages = []
Expand Down

0 comments on commit 1e2d9d0

Please sign in to comment.