Skip to content

OpenRouter provider context length uses top_provider.context_length instead of model-level context_length #2796

Description

@orosmatthew

The OpenRouter provider entry for xiaomi/mimo-v2.5 on models.dev reports a context length of 32,000, but the model's true context window is 1,048,576. This appears to be caused by the OpenRouter ingestion scraper reading top_provider.context_length instead of the top-level context_length field from OpenRouter's /api/v1/models endpoint.

OpenRouter's own API returns two different context fields for this model:

{
  "id": "xiaomi/mimo-v2.5",
  "context_length": 1048576, // model's true context window
  "top_provider": {
    "context_length": 32000, // the specific provider serving it
  }
}

The scraper is picking up top_provider.context_length (32,000) instead of the model-level context_length (1,048,576).

This incorrect value propagates downstream to OpenCode (and any other tool consuming models.dev data), causing premature context compaction and rejected prompts that are well within the model's actual capabilities. It likely affects all OpenRouter models where top_provider.context_length < context_length — i.e., any high-context model routed through a provider with lower limits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions