Repository navigation
Closed
Labels
Description
Description
Get "missing api key" error when using any non free model in Opencode zen
This is result of opencode auth list
❯ opencode auth list
┌ Credentials ~/.local/share/opencode/auth.json
│
● Anthropic oauth
│
● moonshot api
│
● Groq api
│
● OpenCode Zen api
│
└ 4 credentials
┌ Environment
│
● Groq GROQ_API_KEY
│
● DeepSeek DEEPSEEK_API_KEY
│
● Google GEMINI_API_KEY
│
● OpenRouter OPENROUTER_API_KEY
│
└ 4 environment variables
When I try doing opencode run hello --print-logs, there is actually results, but the missing API key log comes from title generation (I presume)
❯ opencode run hello --print-logs
INFO 2025-11-08T04:42:25 +163ms service=default version=1.0.45 args=["run","hello","--print-logs"] opencode
INFO 2025-11-08T04:42:25 +1ms service=project directory=/Users/jaw/Projects/personal/stuffspace fromDirectory
INFO 2025-11-08T04:42:25 +101ms service=config path=/Users/jaw/.config/opencode/config.json loading
INFO 2025-11-08T04:42:25 +0ms service=config path=/Users/jaw/.config/opencode/opencode.json loading
INFO 2025-11-08T04:42:25 +5ms service=config path=/Users/jaw/.config/opencode/opencode.jsonc loading
INFO 2025-11-08T04:42:25 +1ms service=config path=/Users/jaw/Projects/personal/stuffspace/opencode.json loading
INFO 2025-11-08T04:42:25 +2ms service=config path=/Users/jaw/.config/opencode/opencode.jsonc loading
INFO 2025-11-08T04:42:25 +0ms service=config path=/Users/jaw/.config/opencode/opencode.json loading
INFO 2025-11-08T04:42:25 +0ms service=bun cmd=["/Users/jaw/.opencode/bin/opencode","add","@opencode-ai/[email protected]","--exact"] cwd=/Users/jaw/.config/opencode running
INFO 2025-11-08T04:42:25 +23ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
installed @opencode-ai/[email protected]
[13.00ms] done
stderr=Saved lockfile
done
INFO 2025-11-08T04:42:25 +0ms service=plugin path=file:///Users/jaw/.config/opencode/plugin/notification.js loading plugin
INFO 2025-11-08T04:42:25 +6ms service=plugin [email protected] loading plugin
INFO 2025-11-08T04:42:25 +4ms service=plugin [email protected] loading plugin
INFO 2025-11-08T04:42:25 +28ms service=bus type=* subscribing
INFO 2025-11-08T04:42:25 +0ms service=bus type=session.updated subscribing
INFO 2025-11-08T04:42:25 +0ms service=bus type=message.updated subscribing
INFO 2025-11-08T04:42:25 +0ms service=bus type=message.part.updated subscribing
INFO 2025-11-08T04:42:25 +0ms service=format init
INFO 2025-11-08T04:42:25 +0ms service=bus type=file.edited subscribing
INFO 2025-11-08T04:42:25 +0ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls, lua-ls enabled LSP servers
INFO 2025-11-08T04:42:25 +1ms service=bus type=command.executed subscribing
INFO 2025-11-08T04:42:25 +16ms service=server method=POST path=/session request
INFO 2025-11-08T04:42:25 +3ms service=session id=ses_59e3a2cf7ffetP64Kg3041WMVE version=1.0.45 projectID=cefeddf1acef2e07f77ad31bad0ade49e1a8bd45 directory=/Users/jaw/Projects/personal/stuffspace title=New session - 2025-11-08T04:42:25.929Z time={"created":1762576945929,"updated":1762576945929} created
INFO 2025-11-08T04:42:25 +0ms service=bus type=session.created publishing
INFO 2025-11-08T04:42:25 +1ms service=bus type=session.updated publishing
INFO 2025-11-08T04:42:25 +0ms service=server duration=4 response
INFO 2025-11-08T04:42:25 +2ms service=server method=GET path=/config request
INFO 2025-11-08T04:42:25 +0ms service=server duration=0 response
INFO 2025-11-08T04:42:25 +1ms service=server method=GET path=/event request
INFO 2025-11-08T04:42:25 +0ms service=server event connected
INFO 2025-11-08T04:42:25 +1ms service=bus type=* subscribing
INFO 2025-11-08T04:42:25 +1ms service=server duration=2 response
INFO 2025-11-08T04:42:25 +1ms service=server method=POST path=/session/ses_59e3a2cf7ffetP64Kg3041WMVE/message request
INFO 2025-11-08T04:42:25 +1ms service=session.prompt session=ses_59e3a2cf7ffetP64Kg3041WMVE prompt
INFO 2025-11-08T04:42:25 +0ms service=server duration=1 response
INFO 2025-11-08T04:42:25 +7ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:25 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:25 +1ms service=bus type=session.updated publishing
INFO 2025-11-08T04:42:25 +21ms service=models.dev file={} refreshing
INFO 2025-11-08T04:42:25 +3ms service=provider init
INFO 2025-11-08T04:42:25 +1ms service=provider providerID=groq found
INFO 2025-11-08T04:42:25 +0ms service=provider providerID=deepseek found
INFO 2025-11-08T04:42:25 +0ms service=provider providerID=openrouter found
INFO 2025-11-08T04:42:25 +0ms service=provider providerID=opencode found
INFO 2025-11-08T04:42:25 +0ms service=provider providerID=anthropic found
INFO 2025-11-08T04:42:25 +0ms service=provider providerID=opencode modelID=big-pickle getModel
INFO 2025-11-08T04:42:25 +0ms service=provider status=started providerID=opencode getSDK
INFO 2025-11-08T04:42:26 +60ms service=provider status=completed duration=60 providerID=opencode getSDK
INFO 2025-11-08T04:42:26 +0ms service=provider providerID=opencode modelID=big-pickle found
INFO 2025-11-08T04:42:26 +0ms service=session.lock sessionID=ses_59e3a2cf7ffetP64Kg3041WMVE locked
INFO 2025-11-08T04:42:26 +0ms service=session.prompt session=ses_59e3a2cf7ffetP64Kg3041WMVE sessionID=ses_59e3a2cf7ffetP64Kg3041WMVE locking
INFO 2025-11-08T04:42:26 +17ms service=mcp key=zen type=local found
INFO 2025-11-08T04:42:26 +2ms service=mcp key=context7 type=remote found
INFO 2025-11-08T04:42:26 +0ms service=mcp key=shadcn type=local found
INFO 2025-11-08T04:42:27 +1118ms service=mcp key=context7 transport=StreamableHTTP connected
INFO 2025-11-08T04:42:27 +426ms service=mcp key=shadcn toolCount=7 create() successfully created client
INFO 2025-11-08T04:42:27 +374ms service=mcp key=context7 toolCount=2 create() successfully created client
INFO 2025-11-08T04:42:28 +179ms service=mcp key=zen toolCount=9 create() successfully created client
INFO 2025-11-08T04:42:28 +271ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:28 +6ms service=session.prompt session=ses_59e3a2cf7ffetP64Kg3041WMVE process
INFO 2025-11-08T04:42:28 +1ms service=provider providerID=opencode modelID=claude-haiku-4-5 getModel
INFO 2025-11-08T04:42:28 +0ms service=provider status=started providerID=opencode getSDK
INFO 2025-11-08T04:42:28 +12ms service=provider status=completed duration=12 providerID=opencode getSDK
INFO 2025-11-08T04:42:28 +0ms service=provider providerID=opencode modelID=claude-haiku-4-5 found
INFO 2025-11-08T04:42:28 +7ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:28 +2ms service=bus type=session.updated publishing
INFO 2025-11-08T04:42:28 +0ms service=bus type=session.diff publishing
ERROR 2025-11-08T04:42:29 +841ms service=acp-command promise={} reason=Missing API key. Unhandled rejection
ERROR 2025-11-08T04:42:29 +0ms service=default e=Missing API key. rejection
ERROR 2025-11-08T04:42:29 +0ms service=session.prompt session=ses_59e3a2cf7ffetP64Kg3041WMVE error=Missing API key. model=claude-haiku-4-5 failed to generate title
INFO 2025-11-08T04:42:41 +12391ms service=snapshot hash=caba1da78cbd12df8c8cd276148241ee1207671e
cwd=/Users/jaw/Projects/personal/stuffspace git=/Users/jaw/.local/share/opencode/snapshot/cefeddf1acef2e07f77ad31bad0ade49e1a8bd45 tracking
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
Hello! I'm here to help you with your stuffspace project. What would you like to work on today?
INFO 2025-11-08T04:42:41 +37ms service=snapshot hash=caba1da78cbd12df8c8cd276148241ee1207671e
cwd=/Users/jaw/Projects/personal/stuffspace git=/Users/jaw/.local/share/opencode/snapshot/cefeddf1acef2e07f77ad31bad0ade49e1a8bd45 tracking
INFO 2025-11-08T04:42:41 +1ms service=bus type=message.part.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:41 +28ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:41 +4ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=bus type=message.updated publishing
INFO 2025-11-08T04:42:41 +0ms service=session.compaction pruning
INFO 2025-11-08T04:42:41 +0ms service=session.lock sessionID=ses_59e3a2cf7ffetP64Kg3041WMVE unlocked
INFO 2025-11-08T04:42:41 +0ms service=session.prompt session=ses_59e3a2cf7ffetP64Kg3041WMVE sessionID=ses_59e3a2cf7ffetP64Kg3041WMVE unlocking
INFO 2025-11-08T04:42:41 +2ms service=bus type=session.idle publishing
INFO 2025-11-08T04:42:41 +37ms service=default directory=/Users/jaw/Projects/personal/stuffspace disposing instance
INFO 2025-11-08T04:42:41 +0ms service=state key=/Users/jaw/Projects/personal/stuffspace waiting for state disposal to complete
INFO 2025-11-08T04:42:41 +0ms service=state key=/Users/jaw/Projects/personal/stuffspace state disposal completed
OpenCode version
1.0.45
Steps to reproduce
No response
Screenshot and/or share link
Operating System
macof 26.0.1
Terminal
Ghostty
Activity
github-actions commentedon Nov 8, 2025
This issue might be a duplicate of existing issues. Please check:
small_modelis set to unenabled provider #1643: Error state ifsmall_modelis set to unenabled provider - specifically mentions title generation failing with authentication issues when the title generation model provider isn't properly configuredThe core issue appears to be related to title generation in v1.0+ trying to use a model (claude-haiku-4-5) that doesn't have proper authentication configured, even when OpenCode Zen credentials are set up for the main model.
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Nov 8, 2025
hm do u have a paid zen account that you are authed for? Kimi k2 isnt a free model
Jawkx commentedon Nov 8, 2025
I turned off auto reload, but from zen dashboard I still have 13 dollar left and a card associated with my account.
I know k2 is not a free model.
ps: also just created and added a new key in case my default API key have any error. Still show the same error.
rekram1-node commentedon Nov 8, 2025
Hmm okay
rekram1-node commentedon Nov 8, 2025
@Jawkx can u show me output of:
opencode run hello --print-logs --model opencode/kimi-k2Do you have "model" or "small_model" configured anywhere? Im just trying to figure out what could be causing this
Jawkx commentedon Nov 9, 2025
@rekram1-node
opencode.json, I don't have anysmall_modelconfigured any where I thinkJawkx commentedon Nov 9, 2025
Ok I'm so sorry @rekram1-node hope you didn't waste too much time on this.
I found out I have another
opencode.jsonin my repo (I normally launch it from other directory) which is a opencode config that I suppose to run on CI.That one will check for env variable to get opencode key instead. Sorry for wasting your time on this.
rekram1-node commentedon Nov 9, 2025
no problem