opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Improve invalid/missing api key response

Open jakob1379 opened this issue 1 day ago • 0 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I have this opencode.jsonc

{
  "$schema": "https://opencode.ai/config.json",
   "provider": {
    "deepseek": {
      "options": {
        "apiKey": "{env:DEEPSEEK_API_KEY}",
        "baseURL": "https://api.deepseek.com/v1
      }
    }
  },
  "model": "deepseek/deepseek-reasoner"
}

In my environment I forgot to export the environment variable DEEPSEEP_API_KEY and got the obscure error message:

Unauthorized: Authentication Fails (governor)

It would be nice, now that we can ask for env variables getting a clearer messages stating "envrinment variable DEEPSEEK_API_KEY is not set" or similar.

jakob1379 avatar Jan 15 '26 11:01 jakob1379