Skip to content

OpenRouterReasoning missing latest OpenRouter effort levels #4708

@majdalsado

Description

@majdalsado

Initial Checks

Description

OpenRouterReasoning.effort is missing three valid values: xhigh, minimal, and none. The current type is Literal['high', 'medium', 'low'], but the OpenRouter API docs show six valid values: xhigh, high, medium, low, minimal, and none.

This isn't a critical bug as the code runs fine at runtime, only throwing errors for typecheckers.

Minimal, Reproducible Example

from pydantic_ai.models.openrouter import OpenRouterModelSettings

# All three produce pyright errors:
#   Type "Literal['xhigh']" is not assignable to type "Literal['high', 'medium', 'low']"
settings: OpenRouterModelSettings = {'openrouter_reasoning': {'effort': 'xhigh'}}

settings2: OpenRouterModelSettings = {'openrouter_reasoning': {'effort': 'minimal'}}

settings3: OpenRouterModelSettings = {'openrouter_reasoning': {'effort': 'none'}}

Logfire Trace

No response

Python, Pydantic AI & LLM client version

  • Python: 3.13
  • Pydantic AI: 1.69.0
  • LLM provider SDK: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReport that something isn't working, or PR implementing a fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions