DeepSeek API not working
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.
Can you share you opencode.json file? And do you have a global openai api key loaded in your env?
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.
It's indeed not working, I've tested it
Yea I tested on my clean install linux box, it gives me the same problem. :-(
It will always attempt to use the OpenAI endpoint rather than Deepseek.
I think it's working now (v0.1.123), can confirm?
yep should be fixed
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).
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.
by the way
❯ brew list --versions sst/tap/opencode
opencode 0.1.126
@jensenojs This should be a separate bug, you can open a new issue.
@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.