[GH-ISSUE #104] OpenAI API Key seems to not be read by AnythingLLM #70

Closed
opened 2026-02-22 18:17:46 -05:00 by yindo · 4 comments
Owner

Originally created by @pligor on GitHub (Jun 22, 2023).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/104

I tried to type the open ai key in the .env file with three different ways:

  1. OPEN_AI_KEY=xxxxxxxx
  2. OPEN_AI_KEY='xxxxxxxx'
  3. OPEN_AI_KEY="xxxxxxxx"

I do not think it makes a difference but every time we see this error in Anything LLM:

image and also cannot send prompts to anythingllm

Note that in addition ChromaDB server is up and running at localhost:8000 (pinecone and lancedb are disabled)

Any ideas of what is wrong ? How exactly to write the Open AI Api key in the .env file ?

Originally created by @pligor on GitHub (Jun 22, 2023). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/104 I tried to type the open ai key in the .env file with three different ways: 1) OPEN_AI_KEY=xxxxxxxx 2) OPEN_AI_KEY='xxxxxxxx' 3) OPEN_AI_KEY="xxxxxxxx" I do not think it makes a difference but every time we see this error in Anything LLM: <img width="668" alt="image" src="https://github.com/Mintplex-Labs/anything-llm/assets/1448173/29b10cfe-8165-44a8-ac9e-fe48e8d99206"> and also cannot send prompts to anythingllm Note that in addition ChromaDB server is up and running at localhost:8000 (pinecone and lancedb are disabled) Any ideas of what is wrong ? How exactly to write the Open AI Api key in the .env file ?
yindo added the wontfixDocker labels 2026-02-22 18:17:46 -05:00
yindo closed this issue 2026-02-22 18:17:46 -05:00
Author
Owner

@vikaskesamreddy commented on GitHub (Jun 23, 2023):

did you rebuild the docker after changing the environment variables?
you should rebuild the docker and try again!
hope it works.

@vikaskesamreddy commented on GitHub (Jun 23, 2023): did you rebuild the docker after changing the environment variables? you should rebuild the docker and try again! hope it works.
Author
Owner

@hillct commented on GitHub (Jun 23, 2023):

The .env.example file erroneously has quotes around variable values which causes problems in cases like the Dockerfile groupadd command which uses GID='1000' interpreted without shell substitutions so groupadd fails saying "'1000' is no a valid GID (number)" and likewise, The OpenAI API key must be added to the .env file without quotes, that's no he only issue here, unfortunately. I seems there's an underlying parsing issue as well.

@hillct commented on GitHub (Jun 23, 2023): The .env.example file erroneously has quotes around variable values which causes problems in cases like the Dockerfile groupadd command which uses GID='1000' interpreted without shell substitutions so groupadd fails saying "'1000' is no a valid GID (number)" and likewise, The OpenAI API key must be added to the .env file without quotes, that's no he only issue here, unfortunately. I seems there's an underlying parsing issue as well.
Author
Owner

@iguy0 commented on GitHub (Jun 23, 2023):

@hillct Did you manage to get it resolved ? I saw here: https://github.com/Mintplex-Labs/anything-llm/issues/96 that you're having the same issue.

@iguy0 commented on GitHub (Jun 23, 2023): @hillct Did you manage to get it resolved ? I saw here: [https://github.com/Mintplex-Labs/anything-llm/issues/96](url) that you're having the same issue.
Author
Owner

@pligor commented on GitHub (Jun 23, 2023):

hi @vikas94 fyi I am in Macbook M2 Pro
The README notes should mention that the full rebuild is with this:
docker-compose down && docker-compose build --no-cache && docker-compose up -d
And by removing all double or single quotes that where wrapping the values, things seems to be working ok now

However.. cannot create a new workspace. Now I have zero workspaces.
see error message in this photo:
image

And an example of my .env file can be seen below:

SERVER_PORT=3001
OPEN_AI_KEY=sk-AAAAAAAAAAAAAAAAAAAA
OPEN_MODEL_PREF=gpt-3.5-turbo
CACHE_VECTORS=true

# Enable all below if you are using vector database: Chroma.
VECTOR_DB=chroma
CHROMA_ENDPOINT=http://localhost:8000

# Enable all below if you are using vector database: Pinecone.
# VECTOR_DB=pinecone
# PINECONE_ENVIRONMENT=
# PINECONE_API_KEY=
# PINECONE_INDEX=

# Enable all below if you are using vector database: LanceDB.
# VECTOR_DB=lancedb

# CLOUD DEPLOYMENT VARIRABLES ONLY
# AUTH_TOKEN="hunter2" # This is the password to your application if remote hosting.
# JWT_SECRET="my-random-string-for-seeding" # Only needed if AUTH_TOKEN is set. Please generate random string at least 12 chars long.
# STORAGE_DIR="./server/storage"
# GOOGLE_APIS_KEY=
UID=1000
GID=1000

Could you help ? Cannot understand why is not working

@pligor commented on GitHub (Jun 23, 2023): hi @vikas94 fyi I am in Macbook M2 Pro The README notes should mention that the full rebuild is with this: `docker-compose down && docker-compose build --no-cache && docker-compose up -d` And by removing all double or single quotes that where wrapping the values, things seems to be working ok now However.. cannot create a new workspace. Now I have zero workspaces. see error message in this photo: <img width="1870" alt="image" src="https://github.com/Mintplex-Labs/anything-llm/assets/1448173/0cc13842-660f-4aea-8399-5b5fb3aadf8d"> And an example of my .env file can be seen below: ``` SERVER_PORT=3001 OPEN_AI_KEY=sk-AAAAAAAAAAAAAAAAAAAA OPEN_MODEL_PREF=gpt-3.5-turbo CACHE_VECTORS=true # Enable all below if you are using vector database: Chroma. VECTOR_DB=chroma CHROMA_ENDPOINT=http://localhost:8000 # Enable all below if you are using vector database: Pinecone. # VECTOR_DB=pinecone # PINECONE_ENVIRONMENT= # PINECONE_API_KEY= # PINECONE_INDEX= # Enable all below if you are using vector database: LanceDB. # VECTOR_DB=lancedb # CLOUD DEPLOYMENT VARIRABLES ONLY # AUTH_TOKEN="hunter2" # This is the password to your application if remote hosting. # JWT_SECRET="my-random-string-for-seeding" # Only needed if AUTH_TOKEN is set. Please generate random string at least 12 chars long. # STORAGE_DIR="./server/storage" # GOOGLE_APIS_KEY= UID=1000 GID=1000 ``` Could you help ? Cannot understand why is not working
yindo changed title from OpenAI API Key seems to not be read by AnythingLLM to [GH-ISSUE #104] OpenAI API Key seems to not be read by AnythingLLM 2026-06-05 14:33:19 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#70