Skip to content

Add Grok 4.5 model support to xAI provider #866

Description

@navedmerchant

Name of model: Grok 4.5 (grok-4.5)
Model creator: xAI (SpaceXAI)
Link to model: https://docs.x.ai/developers/grok-4-5

Model Details

Grok 4.5 was publicly released on July 9, 2026. It is xAI's flagship model built for coding, agentic tasks, and knowledge work.

Property Value
Model name grok-4.5
Context window 500,000 tokens
Input price $2.00 / 1M tokens
Cached input $0.50 / 1M tokens
Output price $6.00 / 1M tokens
Reasoning Low, medium, or high (default high)
APIs Responses API, Chat Completions
Modalities Text, Image

Source: xAI Docs - grok-4.5, xAI Pricing

What needs to change

  1. Add grok-4.5 model definition in packages/types/src/providers/xai.ts with the correct context window, pricing, and reasoning support.
  2. Update xaiDefaultModelId from grok-4.20 to grok-4.5 (it's the new flagship).
  3. Fix reasoning format bug in src/api/providers/xai.ts — the xAI Responses API expects reasoning: { effort: "high" } but the handler was passing reasoning: { reasoning_effort: "high" } (Chat Completions format). This latent bug affects grok-3-mini and would break grok-4.5's configurable reasoning.
  4. Update tests to cover the reasoning format fix and grok-4.5 reasoning support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    modelProvider model

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions