[Bug] Error API Endpoint usage #2171
Unanswered
Lostsite
asked this question in
General Question | 普通问题
Replies: 2 comments
-
I have figure out the problem.... It won't read the api key and endpoint from ".env" file, It needs to be maunally set inside the "Language Model" section. I changed the ".env" settings. But been overwritten by "Language Model" section. Expect: |
Beta Was this translation helpful? Give feedback.
0 replies
-
you can reset your local setting config in the setting -> common page. the env override order is :
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
💻 系统环境
Windows
📦 部署环境
Other
🌐 浏览器
Firefox
🐛 问题描述
I have 2 api endpoints set in ".env"
and the model list
However, when I choose "gpt-4-turbo-2024-04-09" as my model number in chart, it actually use the
OPENROUTER_API_KEY
(I can see usage on the openrouter, not theOPENAI_API_KEY
(No usage from openai).🚦 期望结果
Based on the model list I provide (
OPENROUTER_MODEL_LIST
vsOPENAI_MODEL_LIST=
), use different API key and end point. (If both model list have same model, choose API endpoint and key from the selection (In the chart, I can select model from OpenAI or OpenRouter))📷 复现步骤
git clone
Edit
.env
Set
OPENAI_API_KEY=sk-xxxx
andOPENROUTER_API_KEY
Set
OPENROUTER_MODEL_LIST
andOPENAI_MODEL_LIST=
Set
OPENAI_PROXY_URL
to OpenRouter's API endpoint (I did this before OpenRouter become part of official support)Call the "GPT-4" from Openai (doesn't matter, since
OPENAI_PROXY_URL
been set to OpenRouter, it will go to OpenRouter anyway).Remove
OPENAI_PROXY_URL
froom.env
Call the "GPT-4" from Openai once again --- This request went to OpenRouter, not OpenAI
📝 补充信息
I use "Local Development" as my usage case (git clone + $ pnpm install + $ pnpm dev) on windows.
Beta Was this translation helpful? Give feedback.
All reactions