Skip to content

An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.

feat: add support for xAI Grok 4 model (#950)

Ben Vargas699e9eefb5d6
diff --git a/.changeset/grok-4-support.md b/.changeset/grok-4-support.md
new file mode 100644
index 00000000..9b6ef526
--- /dev/null
+++ b/.changeset/grok-4-support.md
@@ -0,0 +1,9 @@
+---
+"task-master-ai": minor
+---
+
+Add support for xAI Grok 4 model
+
+- Add grok-4 model to xAI provider with $3/$15 per 1M token pricing
+- Enable main, fallback, and research roles for grok-4
+- Max tokens set to 131,072 (matching other xAI models)
\ No newline at end of file
diff --git a/docs/models.md b/docs/models.md
index 3e3c23c5..75a1893e 100644
--- a/docs/models.md
+++ b/docs/models.md
@@ -40,6 +40,7 @@
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
| xai | grok-3 | — | 3 | 15 |
| xai | grok-3-fast | — | 5 | 25 |
+| xai | grok-4 | — | 3 | 15 |
| ollama | devstral:latest | — | 0 | 0 |
| ollama | qwen3:latest | — | 0 | 0 |
| ollama | qwen3:14b | — | 0 | 0 |
@@ -107,6 +108,7 @@
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
| xai | grok-3 | — | 3 | 15 |
| xai | grok-3-fast | — | 5 | 25 |
+| xai | grok-4 | — | 3 | 15 |
| groq | llama-3.3-70b-versatile | 0.55 | 0.59 | 0.79 |
| groq | llama-4-scout | 0.45 | 0.11 | 0.34 |
| groq | llama-4-maverick | 0.52 | 0.5 | 0.77 |
@@ -149,6 +151,7 @@
| perplexity | sonar-reasoning | 0.211 | 1 | 5 |
| xai | grok-3 | — | 3 | 15 |
| xai | grok-3-fast | — | 5 | 25 |
+| xai | grok-4 | — | 3 | 15 |
| ollama | devstral:latest | — | 0 | 0 |
| ollama | qwen3:latest | — | 0 | 0 |
| ollama | qwen3:14b | — | 0 | 0 |
diff --git a/scripts/modules/supported-models.json b/scripts/modules/supported-models.json
index c0458ad9..9db7cd82 100644
--- a/scripts/modules/supported-models.json
+++ b/scripts/modules/supported-models.json
@@ -394,6 +394,17 @@
},
"allowed_roles": ["main", "fallback", "research"],
"max_tokens": 131072
+ },
+ {
+ "id": "grok-4",
+ "name": "Grok 4",
+ "swe_score": null,
+ "cost_per_1m_tokens": {
+ "input": 3,
+ "output": 15
+ },
+ "allowed_roles": ["main", "fallback", "research"],
+ "max_tokens": 131072
}
],
"ollama": [