Grok 4 Fast

Model details

Grok 4 Fast

Model
grok-4-fast
Provider
xai
API
openai-completions
Base URL
https://api.x.ai/v1
Input
text, image
Reasoning
Yes
Context window
2,000,000
Max tokens
30,000
Cost / million input
$0.2
Cost / million output
$0.5
Cost / million cache read
$0.05
Cost / million cache write
$0
Model config JSON
{
  "providers": {
    "xai": {
      "apiKey": "YOUR_API_KEY",
      "models": [
        {
          "id": "grok-4-fast",
          "name": "Grok 4 Fast",
          "reasoning": true,
          "input": [
            "text",
            "image"
          ],
          "contextWindow": 2000000,
          "maxTokens": 30000,
          "cost": {
            "input": 0.2,
            "output": 0.5,
            "cacheRead": 0.05,
            "cacheWrite": 0
          }
        }
      ],
      "api": "openai-completions",
      "baseUrl": "https://api.x.ai/v1"
    }
  }
}