Skip to content

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

Closed

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 20, 2026
  2. cbangera2 commented on Feb 20, 2026

    @cbangera2
    Author

    Please let me know if I need to provide more information for this issue. I also put up a fix for this :) . Its probably a niche edge case and there's a work around of just throwing the cost info into the opencode.jsonc but imo this is easier and cleaner

    My current local workaround (have to do for every model)

      "cost": {
                "input": 3,
                "output": 15,
                "cache_read": 0.30,
                "cache_write": 3.75
              },
    
  3. github-actions commented on Apr 21, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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