diff --git a/README.md b/README.md index eee06acd9..837a9f8af 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,10 @@ This is useful if you want to use a different shell than your default system she "openrouter": { "apiKey": "your-api-key", "disabled": false + }, + "xai": { + "apiKey": "your-api-key", + "disabled": false } }, "agents": { @@ -270,6 +274,14 @@ OpenCode supports a variety of AI models from different providers: - Gemini 2.5 - Gemini 2.5 Flash +### XAI + +- Grok 3 Beta +- Grok 3 Mini Beta +- Grok 3 Fast Beta +- Grok 3 Mini Fast Beta +- Grok 4 0709 + ## Usage ```bash diff --git a/internal/llm/models/xai.go b/internal/llm/models/xai.go index 00caf3b89..5dbd308b0 100644 --- a/internal/llm/models/xai.go +++ b/internal/llm/models/xai.go @@ -7,6 +7,7 @@ const ( XAIGrok3MiniBeta ModelID = "grok-3-mini-beta" XAIGrok3FastBeta ModelID = "grok-3-fast-beta" XAiGrok3MiniFastBeta ModelID = "grok-3-mini-fast-beta" + XAIGrok40709 ModelID = "grok-4-0709" ) var XAIModels = map[ModelID]Model{ @@ -58,4 +59,16 @@ var XAIModels = map[ModelID]Model{ ContextWindow: 131_072, DefaultMaxTokens: 20_000, }, + XAIGrok40709: { + ID: XAIGrok40709, + Name: "Grok 4 0709", + Provider: ProviderXAI, + APIModel: "grok-4-0709", + CostPer1MIn: 3.0, + CostPer1MInCached: 0.75, + CostPer1MOut: 15.0, + CostPer1MOutCached: 0.75, + ContextWindow: 256_000, + DefaultMaxTokens: 20_000, + }, } diff --git a/opencode-schema.json b/opencode-schema.json index 406c75f8c..94a0fed09 100644 --- a/opencode-schema.json +++ b/opencode-schema.json @@ -173,6 +173,7 @@ "openrouter.claude-3.7-sonnet", "openrouter.gpt-4.5-preview", "grok-3-mini-beta", + "grok-4-0709", "claude-3.7-sonnet", "gemini-2.0-flash", "openrouter.deepseek-r1-free",