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 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Note that reasoning is not exposed, reasoning cannot be disabled, and the reasoning effort cannot be specified. Pricing increases once the total tokens in a given request is greater than 128k tokens. See more details on the [xAI docs](https://docs.x.ai/docs/models/grok-4-0709)

๐Ÿ’ฐ
Price Ranking
#1178 lowest price among 1240 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: 1.0M

๐Ÿš€ 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)