"AI_APICallError: No auth credentials found" despite providing credentials #1118

Closed
opened 2026-02-16 17:29:31 -05:00 by yindo · 4 comments
Owner

Originally created by @t3dotgg on GitHub (Aug 5, 2025).

Originally assigned to: @thdxr on GitHub.

I have provided the key using opencode auth login, here's the state of my auth.json file

Image

And here's what happens when I try any openrouter model

Image
Originally created by @t3dotgg on GitHub (Aug 5, 2025). Originally assigned to: @thdxr on GitHub. I have provided the key using `opencode auth login`, here's the state of my auth.json file <img width="971" height="408" alt="Image" src="https://github.com/user-attachments/assets/597f5296-490e-4e5d-93c8-f48e18189677" /> And here's what happens when I try any openrouter model <img width="1912" height="1237" alt="Image" src="https://github.com/user-attachments/assets/15385c3d-e133-4750-b423-e55ede00add6" />
yindo closed this issue 2026-02-16 17:29:31 -05:00
Author
Owner

@thdxr commented on GitHub (Aug 6, 2025):

if you do opencode auth list what does it print

@thdxr commented on GitHub (Aug 6, 2025): if you do `opencode auth list` what does it print
Author
Owner

@kvnpmz commented on GitHub (Aug 15, 2025):

Seems like this is happening with me too. Doesn't matter which OpenRouter model I pick.

kevin@ubuntu:~/
$ opencode auth list

┌ Credentials ~/.local/share/opencode/auth.json

● Google api

● OpenRouter api

● OpenAI api

└ 3 credentials

@kvnpmz commented on GitHub (Aug 15, 2025): Seems like this is happening with me too. Doesn't matter which OpenRouter model I pick. kevin@ubuntu:~/ $ opencode auth list ┌ Credentials ~/.local/share/opencode/auth.json │ ● Google api │ ● OpenRouter api │ ● OpenAI api │ └ 3 credentials
Author
Owner

@blankbash commented on GitHub (Sep 26, 2025):

Namespace conflict: change your variable name from OPENROUTER_API_KEY to OPENROUTER_KEY and you are good to go.

@blankbash commented on GitHub (Sep 26, 2025): Namespace conflict: change your variable name from `OPENROUTER_API_KEY` to `OPENROUTER_KEY` and you are good to go.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1118