[GH-ISSUE #438] BUG (LocalAI): API KEY not getting passed with Model Endpoint Request #247

Closed
opened 2026-02-22 18:18:33 -05:00 by yindo · 4 comments
Owner
Originally created by @lunamidori5 on GitHub (Dec 13, 2023). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/438 The API key is not getting pasted with the model endpoint request. AnythingLLM WebUI - https://tea-cup.midori-ai.xyz/download/194f5aac-52de-402c-b41b-7d8aab4c1e9a-chrome_iA1fkmVQjf.png AnythingLLM Docker - https://tea-cup.midori-ai.xyz/download/a3e43ba8-88d5-4262-9308-19fc10a711c8-chrome_OjTBcLreiT.png Localai Docker - https://tea-cup.midori-ai.xyz/download/2dd29c56-b2a7-4b58-86b0-c2996ce8d5c3-Docker_Desktop_wwvzVr9xv6.png
yindo added the bug label 2026-02-22 18:18:33 -05:00
yindo closed this issue 2026-02-22 18:18:33 -05:00
Author
Owner

@timothycarambat commented on GitHub (Dec 13, 2023):

Closing as unable to replicate.

  • I have a LocalAI instance running on LAN and i connect to it via NGROK. I start the container using the -e "API_KEY=sk-secret123" env parameter in docker startup command.
  • I then try to visit https://localaiURL/v1/models in browser and receive a 401 status code as expected
  • In AnythingLLM i put in https://localaiURL/v1 as my endpoint URL and click off the input and AnythingLLM backend reports a 401 status code as well as the LocalAI logs for /models endpoint
  • In AnythingLLM i then put sk-secret123 into the LocalAI API key field and click off the input and all my models now appear in my dropdown.
  • I then save config & send a chat and get a streamed response from my model successfully.

Possible configuration issue with API_KEY environment variable in LocalAI docker container?

@timothycarambat commented on GitHub (Dec 13, 2023): Closing as unable to replicate. - I have a LocalAI instance running on LAN and i connect to it via NGROK. I start the container using the `-e "API_KEY=sk-secret123"` env parameter in docker startup command. - I then try to visit `https://localaiURL/v1/models` in browser and receive a 401 status code as expected - In AnythingLLM i put in `https://localaiURL/v1` as my endpoint URL and click off the input and AnythingLLM backend reports a 401 status code as well as the LocalAI logs for /models endpoint - In AnythingLLM i then put `sk-secret123` into the LocalAI API key field and click off the input and all my models now appear in my dropdown. - I then save config & send a chat and get a streamed response from my model successfully. Possible configuration issue with API_KEY environment variable in LocalAI docker container?
Author
Owner

@lunamidori5 commented on GitHub (Dec 13, 2023):

@timothycarambat it must be that I am updating the .env and reinstalling, ill try using the GUI, bug is still there tho. and you did show it...

@lunamidori5 commented on GitHub (Dec 13, 2023): @timothycarambat it must be that I am updating the .env and reinstalling, ill try using the GUI, bug is still there tho. and you did show it...
Author
Owner

@lunamidori5 commented on GitHub (Dec 13, 2023):

Closing as unable to replicate.

  • I have a LocalAI instance running on LAN and i connect to it via NGROK. I start the container using the -e "API_KEY=sk-secret123" env parameter in docker startup command.
  • I then try to visit https://localaiURL/v1/models in browser and receive a 401 status code as expected
  • In AnythingLLM i put in https://localaiURL/v1 as my endpoint URL and click off the input and AnythingLLM backend reports a 401 status code as well as the LocalAI logs for /models endpoint

Bug found and replicated... So I do not understand...

@lunamidori5 commented on GitHub (Dec 13, 2023): > Closing as unable to replicate. > > * I have a LocalAI instance running on LAN and i connect to it via NGROK. I start the container using the `-e "API_KEY=sk-secret123"` env parameter in docker startup command. > * I then try to visit `https://localaiURL/v1/models` in browser and receive a 401 status code as expected > * In AnythingLLM i put in `https://localaiURL/v1` as my endpoint URL and click off the input and AnythingLLM backend reports a 401 status code as well as the LocalAI logs for /models endpoint Bug found and replicated... So I do not understand...
Author
Owner

@timothycarambat commented on GitHub (Dec 13, 2023):

Closing as unable to replicate.

  • I have a LocalAI instance running on LAN and i connect to it via NGROK. I start the container using the -e "API_KEY=sk-secret123" env parameter in docker startup command.
  • I then try to visit https://localaiURL/v1/models in browser and receive a 401 status code as expected
  • In AnythingLLM i put in https://localaiURL/v1 as my endpoint URL and click off the input and AnythingLLM backend reports a 401 status code as well as the LocalAI logs for /models endpoint

Bug found and replicated... So I do not understand...

you forgot the new two steps that proved the key does work!

  • In AnythingLLM i then put sk-secret123 into the LocalAI API key field and click off the input and all my models now appear in my dropdown.
  • I then save config & send a chat and get a streamed response from my model successfully.

You need to put in the key + API endpoint in their respective inputs and the dropdown will populate. Only one or the other and it wont. I dont understand the confusion?

@timothycarambat commented on GitHub (Dec 13, 2023): > > Closing as unable to replicate. > > > > * I have a LocalAI instance running on LAN and i connect to it via NGROK. I start the container using the `-e "API_KEY=sk-secret123"` env parameter in docker startup command. > > * I then try to visit `https://localaiURL/v1/models` in browser and receive a 401 status code as expected > > * In AnythingLLM i put in `https://localaiURL/v1` as my endpoint URL and click off the input and AnythingLLM backend reports a 401 status code as well as the LocalAI logs for /models endpoint > > Bug found and replicated... So I do not understand... you forgot the new two steps that proved the key **does** work! > - In AnythingLLM i then put sk-secret123 into the LocalAI API key field and click off the input and all my models now appear in my dropdown. > - I then save config & send a chat and get a streamed response from my model successfully. You need to put in the key + API endpoint in their respective inputs and the dropdown will populate. Only one or the other and it wont. I dont understand the confusion?
yindo changed title from BUG (LocalAI): API KEY not getting passed with Model Endpoint Request to [GH-ISSUE #438] BUG (LocalAI): API KEY not getting passed with Model Endpoint Request 2026-06-05 14:34:16 -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#247