OpenAI Authentication error when computing embeddings via python API
Closed this issue · 3 comments
Hello, I'm getting an authentication error code 401 when computing embeddings via python API. The error mentionned that I have an Incorrect API Key. Actually, I used the same API key to compute openai embeddings via UI and it works.
The used env variables are:
export OPENAI_API_KEY=... export OPENAI_API_TYPE=azure export OPENAI_API_VERSION=2022-12-01 export AZURE_OPENAI_ENDPOINT=https://{...}.openai.azure.com/
Sorry about that! Do you need to define the other API keys, (the type, the endpoint, and the version)? If you remove those, do you still have the same issue?
Also which version are you on? lilac --version
If I remove these env variables, lilac will ask for them so it doesn't work without. OPENAI_API_KEY, OPENAI_API_VERSION, OPENAI_API_TYPE, OPENAI_API_BASE, OPENAI_API_ENGINE_EMBEDDING are mondatory to let lilac call azure openai api. It works fine for me via UI but when using Python API, NO :'(
I'm on lilac 0.2.2