opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[bug] openrouter not showing

Open akuuly-7 opened this issue 1 year ago • 4 comments

Hey guys,

since some of the last versions, OpenRouter doesn't show up in the model selection.

Tried using the models.dev toml files in providers/ and also in config:

{ "$schema": "http://opencode.ai/config.json", "theme": "tokyonight", "provider": { "openrouter": { "npm": "@openrouter/ai-sdk-provider", "name": "OpenRouter", "options": {}, "models": { "anthropic/claude-sonnet-4": { "name": "Claude 4 Sonnet", "cost": { "input": 3.0, "output": 15.0, "cache_read": 3.75, "cache_write": 0.3 }, "limit": { "context": 200000 } } } } } }

akuuly-7 avatar Jun 19 '25 16:06 akuuly-7

What version of opencode are you using? I couldn't reproduce the bug with your exact same config file. I'm not even able to run opencode (version 0.1.95) with you config I think it's because the output property (in the limit) is missing.

cravenceiling avatar Jun 19 '25 16:06 cravenceiling

can you try a simpler config like this

  "provider": {
    "openrouter": {
      "npm": "@openrouter/ai-sdk-provider",
      "models": {
        "anthropic/claude-sonnet-4": {}
      }
    }
  }

thdxr avatar Jun 19 '25 17:06 thdxr

can you try a simpler config like this

  "provider": {
    "openrouter": {
      "npm": "@openrouter/ai-sdk-provider",
      "models": {
        "anthropic/claude-sonnet-4": {}
      }
    }
  }

Gonna try later when I'm back home

akuuly-7 avatar Jun 19 '25 17:06 akuuly-7

@thdxr added output to the config as per @timetravel-1010 and it showed up :) probably that, don't think you changed something drastically in the last version

akuuly-7 avatar Jun 19 '25 18:06 akuuly-7