Skip to content

Commit 5432fa2

Browse files
carlessoEnrico Carlessoroomote
authored
feat: migrate xAI provider to Responses API with reusable transform utils (#11962)
Co-authored-by: Enrico Carlesso <ecarlesso@twitter.com> Co-authored-by: Roo Code <roomote@roocode.com>
1 parent eafed97 commit 5432fa2

7 files changed

Lines changed: 1223 additions & 547 deletions

File tree

packages/types/src/providers/xai.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type { ModelInfo } from "../model.js"
33
// https://docs.x.ai/docs/api-reference
44
export type XAIModelId = keyof typeof xaiModels
55

6-
export const xaiDefaultModelId: XAIModelId = "grok-4.20-beta-0309-reasoning"
6+
export const xaiDefaultModelId: XAIModelId = "grok-4.20"
77

88
export const xaiModels = {
9-
"grok-4.20-beta-0309-reasoning": {
9+
"grok-4.20": {
1010
maxTokens: 65_536,
1111
contextWindow: 2_000_000,
1212
supportsImages: true,
@@ -15,21 +15,7 @@ export const xaiModels = {
1515
outputPrice: 6.0,
1616
cacheWritesPrice: 0.5,
1717
cacheReadsPrice: 0.5,
18-
description:
19-
"xAI's Grok 4.20 reasoning model with 2M context. Reasoning is internal (not exposed via Chat Completions API).",
20-
includedTools: ["search_replace"],
21-
excludedTools: ["apply_diff"],
22-
},
23-
"grok-4.20-beta-0309-non-reasoning": {
24-
maxTokens: 65_536,
25-
contextWindow: 2_000_000,
26-
supportsImages: true,
27-
supportsPromptCache: true,
28-
inputPrice: 2.0,
29-
outputPrice: 6.0,
30-
cacheWritesPrice: 0.5,
31-
cacheReadsPrice: 0.5,
32-
description: "xAI's Grok 4.20 non-reasoning model - faster inference with 2M context.",
18+
description: "xAI's flagship Grok 4.20 model with 2M context and reasoning support via Responses API.",
3319
includedTools: ["search_replace"],
3420
excludedTools: ["apply_diff"],
3521
},

0 commit comments

Comments
 (0)