opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[Issue] Custom provider baseurl, return opencode.json is invalid Required provider.anthropic.models

Open tomsun28 opened this issue 1 month ago • 3 comments

Description

Hi Team,

Thanks for the great product. I use the config in doc show to custom base url. In the old release, it works. But when i upgrade to the latest version 0.3.133 , it error Error: Config file at /Users/gongchao/.config/opencode/opencode.json is invalid ↳ Required provider.anthropic.models

Image
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.anthropic.com/v1"
      }
    }
  }
}

I have been using this method, hoping it can be fix. Thanks a lot.

OpenCode version

0.3.133

Steps to reproduce

  1. vim the opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.anthropic.com/v1"
      }
    }
  }
}
  1. Run the opencode

Screenshot and/or share link

Image

Operating System

macOS

Terminal

iTerm2

tomsun28 avatar Dec 12 '25 09:12 tomsun28

This appears to be a configuration validation regression where the models field is incorrectly required for provider configurations. Users should be able to customize just the baseURL option without specifying models. This is likely a schema validation issue introduced in the recent version update.

github-actions[bot] avatar Dec 12 '25 09:12 github-actions[bot]

@tomsun28 you said upgrade to latest:

But when i upgrade to the latest version 0.3.133

Uhh that's not latest? Latest is 1.0.152 which is much more recent

rekram1-node avatar Dec 13 '25 01:12 rekram1-node

This issue shouldn't happen on latest

rekram1-node avatar Dec 13 '25 01:12 rekram1-node

Hi, sorry that was my mistake. The latest version is fine 👍

tomsun28 avatar Dec 13 '25 04:12 tomsun28