Skip to content

Custom model id override loses cost/limit data when id doesn't exist in models.dev #14361

@cbangera2

Description

@cbangera2

Description

When a model config uses id to map to a variant, and that id doesn't exist in models.dev but the config key does, cost/limit/capability data is not inherited

Plugins

No response

OpenCode version

1.2.9

Steps to reproduce

  1. In your provider config, add a model entry like:
"base-model-key": {
  "id": "custom-variant-id"
}

wwhere "base-model-key" exists in models.dev but "custom-variant-id" does not.
2. Use this model in a request.

Screenshot and/or share link

{
  "$schema": "https://opencode.ai/config.json",
  "enabled_providers": [
    "amazon-bedrock"
  ],
  "provider": {
    "amazon-bedrock": {
      "models": {
        "anthropic.claude-sonnet-4-5-20250929-v1:0": {
          "id": "us-gov.anthropic.claude-sonnet-4-5-20250929-v1:0",
          "name": "Claude Sonnet 4.5 GovCloud",
        }
      }
    }
  }
}

Operating System

macOS 26.3

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions