Grok 4

xAI chatvisionreasoningtool_use Long

API ID: x-ai/grok-4-07-09

Input Price
$3.00
/1M tokens
Output Price
$15.00
/1M tokens

About Grok 4

Grok 4 represents xAI's frontier model, pushing the boundaries of AI capability while maintaining the distinctive Grok personality. The model delivers exceptional performance on complex reasoning, coding, and creative tasks, competing with the best models available. Grok 4 features advanced reasoning capabilities, extended context handling, and real-time knowledge access through X integration. It demonstrates strong performance on challenging benchmarks and excels at tasks requiring deep analytical thinking. For users seeking maximum AI capability with Grok's engaging style, Grok 4 offers xAI's most powerful offering. It's particularly valuable for demanding applications in research, development, and creative work.

๐Ÿ’ฐ
Price Ranking
#921 lowest price among 950 Chat models

Model Specifications

Context Length
256k
Max Output
โ€”
Release Date
2025-07-09
Capabilities
chat vision reasoning tool_use
Input Modalities
imagetext
Output Modalities
text

Best For

  • Complex reasoning, math problems, multi-step logic
  • Image analysis, document understanding, visual Q&A
  • Conversations, content writing, general assistance

Consider Alternatives For

  • Simple Q&A (cheaper models available)

๐Ÿ’ฐ Real-World Cost Examples

Estimated monthly costs for common use cases

Personal AI Assistant
$5.85
/month
50 conversations/day, ~500 tokens each
Customer Service Bot
$180.00
/month
1000 tickets/day, ~800 tokens each
Data Analysis Pipeline
$247.50
/month
500 analyses/day, ~2k tokens each

xAI Model Lineup

Compare all models from xAI to find the best fit

Model Input Output Context Capabilities
Grok 4 Current Free Free 256k chat vision reasoning tool_use
Grok 2 Vision 1212 Free Free 33k chat vision
Grok 2 Vision 1212 Free Free 33k chat vision
Grok Vision Beta Free Free 8k chat vision
Grok Vision Beta Free Free 8k chat vision
Grok 2 Free Free 33k chat

Similar Models from Other Providers

Cross-brand alternatives with similar capabilities

Perplexity Sonar Pro
Input: $3.00
Output: $15.00
Context: 200k
Perplexity Sonar Pro Search
Input: $3.00
Output: $15.00
Context: 200k
Anthropic Claude Sonnet 4.5
Input: $3.00
Output: $15.00
Context: 1.0M
Anthropic Claude Sonnet 4
Input: $3.00
Output: $15.00
Context: 200k

๐Ÿš€ Quick Start

Get started with Grok 4 API

OpenAI-compatible SDK
from openai import OpenAI

client = OpenAI(
    base_url="https://api.provider.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="x-ai/grok-4-07-09",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)
print(response.choices[0].message.content)