DeepSeek API not working #177

Closed
opened 2026-02-16 17:25:35 -05:00 by yindo · 11 comments
Owner

Originally created by @clockmike on GitHub (Jun 20, 2025).

Originally assigned to: @thdxr on GitHub.

Using DeepSeek provider, I get an error "AI_APICallError: Incorrect API key provided: sk-********__. You can find your API key at https://platform.openai.com/account/api-keys.

I have verified the API Key is correct, has credit, and I even tried a new API key.

It does this for every prompt I give it.

v0.1.109

I would guess it's trying to use OpenAI URL instead of DeepSeek's?

It does this on DeepSeek Chat and Reasoner models.

Originally created by @clockmike on GitHub (Jun 20, 2025). Originally assigned to: @thdxr on GitHub. Using DeepSeek provider, I get an error "AI_APICallError: Incorrect API key provided: sk-___********_____. You can find your API key at https://platform.openai.com/account/api-keys. I have verified the API Key is correct, has credit, and I even tried a new API key. It does this for every prompt I give it. v0.1.109 I would guess it's trying to use OpenAI URL instead of DeepSeek's? It does this on DeepSeek Chat and Reasoner models.
yindo closed this issue 2026-02-16 17:25:35 -05:00
Author
Owner

@cravenceiling commented on GitHub (Jun 20, 2025):

Can you share you opencode.json file? And do you have a global openai api key loaded in your env?

@cravenceiling commented on GitHub (Jun 20, 2025): Can you share you `opencode.json` file? And do you have a global openai api key loaded in your env?
Author
Owner

@clockmike commented on GitHub (Jun 20, 2025):

No opencode.json file exists on my entire machine. There's a ~/.opencode/ directory, but no .json files in it.
There's no json file or opencode folders or files in my project directory either.

Doesn't exist: ~/.config/opencode/config.json
Doesn't exist: opencode.json (in project directory or anywhere in my home folder)

env and export does not show any OPENAI* variables.

I made the mistake of adding opencode.ai/opencode a couple weeks ago, so maybe that completely screwed up my settings and scattered crud all over.

@clockmike commented on GitHub (Jun 20, 2025): No opencode.json file exists on my entire machine. There's a ~/.opencode/ directory, but no .json files in it. There's no json file or *opencode* folders or files in my project directory either. Doesn't exist: ~/.config/opencode/config.json Doesn't exist: opencode.json (in project directory or anywhere in my home folder) env and export does not show any OPENAI* variables. I made the mistake of adding opencode.ai/opencode a couple weeks ago, so maybe that completely screwed up my settings and scattered crud all over.
Author
Owner

@douglarek commented on GitHub (Jun 20, 2025):

It's indeed not working, I've tested it

@douglarek commented on GitHub (Jun 20, 2025): It's indeed not working, I've tested it
Author
Owner

@seemikeplay commented on GitHub (Jun 20, 2025):

Yea I tested on my clean install linux box, it gives me the same problem. :-(

@seemikeplay commented on GitHub (Jun 20, 2025): Yea I tested on my clean install linux box, it gives me the same problem. :-(
Author
Owner

@ipfans commented on GitHub (Jun 22, 2025):

It will always attempt to use the OpenAI endpoint rather than Deepseek.

@ipfans commented on GitHub (Jun 22, 2025): It will always attempt to use the OpenAI endpoint rather than Deepseek.
Author
Owner

@cravenceiling commented on GitHub (Jun 23, 2025):

I think it's working now (v0.1.123), can confirm?

@cravenceiling commented on GitHub (Jun 23, 2025): I think it's working now (v0.1.123), can confirm?
Author
Owner

@thdxr commented on GitHub (Jun 23, 2025):

yep should be fixed

@thdxr commented on GitHub (Jun 23, 2025): yep should be fixed
Author
Owner

@ipfans commented on GitHub (Jun 23, 2025):

Thanks, it works

❯ opencode run -m deepseek/deepseek-chat "what's opencode?" 

█▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀
█░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀
▀▀▀▀ █▀▀▀ ▀▀▀ ▀  ▀ ▀▀▀ ▀▀▀▀ ▀▀▀  ▀▀▀

>  what's opencode?

@  deepseek/deepseek-chat

|  webfetch  https://opencode.ai (text/html)
|  Text     opencode is an AI coding agent built for the terminal, featuring a native TUI, LSP support, multi-session capability, and compatibility with 75+ LLM providers. Learn more at [opencode.ai](https://opencode.ai).
@ipfans commented on GitHub (Jun 23, 2025): Thanks, it works ``` ❯ opencode run -m deepseek/deepseek-chat "what's opencode?" █▀▀█ █▀▀█ █▀▀ █▀▀▄ █▀▀ █▀▀█ █▀▀▄ █▀▀ █░░█ █░░█ █▀▀ █░░█ █░░ █░░█ █░░█ █▀▀ ▀▀▀▀ █▀▀▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀ > what's opencode? @ deepseek/deepseek-chat | webfetch https://opencode.ai (text/html) | Text opencode is an AI coding agent built for the terminal, featuring a native TUI, LSP support, multi-session capability, and compatibility with 75+ LLM providers. Learn more at [opencode.ai](https://opencode.ai). ```
Author
Owner

@jensenojs commented on GitHub (Jun 24, 2025):

Not sure if it's related, but after downloading opencode via homebrew and opening it, the following error pops up. I don't know if there's any place in openCode to find more relevant error logs. I searched and didn't seem to find any other related issues, and I haven't had time to try other APIs yet.

Image

by the way

❯ brew list --versions  sst/tap/opencode
opencode 0.1.126
@jensenojs commented on GitHub (Jun 24, 2025): Not sure if it's related, but after downloading opencode via homebrew and opening it, the following error pops up. I don't know if there's any place in openCode to find more relevant error logs. I searched and didn't seem to find any other related issues, and I haven't had time to try other APIs yet. ![Image](https://github.com/user-attachments/assets/ad812cd7-0587-4f43-ba69-82f1133e66a7) by the way ```sh ❯ brew list --versions sst/tap/opencode opencode 0.1.126 ```
Author
Owner

@ipfans commented on GitHub (Jun 24, 2025):

@jensenojs This should be a separate bug, you can open a new issue.

@ipfans commented on GitHub (Jun 24, 2025): @jensenojs This should be a separate bug, you can open a new issue.
Author
Owner

@jensenojs commented on GitHub (Jun 25, 2025):

@jensenojs This should be a separate bug, you can open a new issue.

I upgrade to v0.1.133, and it seems ok, When I encounter this bug again, I'll file a new issue. I'm currently still a Cursor/WindSurf user, but this is a great project. I'm considering gradually migrating my workflow to Neovim. Thank you, this project has given me more confidence.

@jensenojs commented on GitHub (Jun 25, 2025): > [@jensenojs](https://github.com/jensenojs) This should be a separate bug, you can open a new issue. I upgrade to v0.1.133, and it seems ok, When I encounter this bug again, I'll file a new issue. I'm currently still a Cursor/WindSurf user, but this is a great project. I'm considering gradually migrating my workflow to Neovim. Thank you, this project has given me more confidence.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#177