impulse

Grok 4

Frontier lab
API id grok-4
A newer model in this line is out: Grok 4.7, released 21 Sep 2026.
Azure AI Foundry retires it on 31 Jan 2027 (in 74 days). 3 hosts keep serving it.
Input / 1M
$3.00
at Azure AI Foundry
Output / 1M
$15.00
at Azure AI Foundry
Context window
262K
tokens
Max output
8K
tokens per reply
Hosts
4
4 listings
Released
-
date not published

Pricing

List prices at Azure AI Foundry, in US dollars per million tokens.

TierInput / 1MOutput / 1M
Standard$3.00$15.00

What it costs a month

At Azure AI Foundry list prices, 30 days.

  • Chat assistant5,000 requests a day, 2K in / 0.5K out$2,025
  • RAG over documents2,000 requests a day, 8K in / 0.6K out$1,980
  • Coding agent1,000 requests a day, 40K in / 2K out$4,500
  • Overnight batch20,000 requests a day, 4K in / 0.4K out$10,800
Use your own numbers

Where to run it

4 hosts serve Grok 4. The comparison is on blended price, 3 parts input to 1 part output.

HostIn / out per 1M
grok-4
$3.00 / $15.00
Retires 31 Jan 2027
xai.grok-4
$3.00 / $15.00
grok-4
$3.00 / $15.00
ReplicateInference
grok-4
$7.20 / $36.00
+140% vs headline

Capabilities

Core

  • Streaming
  • Function calling
  • JSON mode
  • Structured outputs

Multimodal

  • Vision
  • Image input
  • Audio
  • Image generation
  • Video

Advanced

  • Reasoning
  • Tool calling
  • MCP
  • Prompt caching
  • Batch API
  • Embeddings
Takes in
Text
Produces
Text
Features
Built-in web search

Cheaper alternatives

Current models that cost less and keep most of what this one can do: tools, vision, reasoning, structured output, caching and enough context.

Same model, cheaper host

No host sells it for less than Azure AI Foundry.

Smaller xAI models

  • Grok 4.7
    xAI · on xAI
    $2.00 / $6.00
    Has every key capability
    50% less
  • Grok Build 0.1
    xAI · on xAI
    $1.00 / $2.00
    Has every key capability
    79% less
  • Grok Build
    xAI · on xAI
    $2.00 / $6.00
    Has every key capability
    50% less

Other frontier labs

  • GPT-5.3 Codex
    OpenAI · on OpenAI
    $1.75 / $14.00
    Has every key capability
    20% less
  • Gemini 4 Carbon
    Google · on Google AI Studio
    $2.00 / $10.00
    Has every key capability
    33% less
  • Claude Sonnet 5.5
    Anthropic · on Anthropic
    $2.00 / $10.00
    Has every key capability
    33% less
  • GPT-6.2 Sol
    OpenAI · on OpenAI
    $2.00 / $10.00
    Has every key capability
    33% less

Open-weight picks

  • Command A Plus
    Cohere · on AIHubMix
    $2.50 / $10.00
    Has every key capability
    27% less
  • Kimi K3.1 Pro
    Moonshot AI · on Databricks
    $2.00 / $10.00
    Has every key capability
    33% less
  • Qwen3.8.2 4T A95B
    Alibaba Qwen · on DeepInfra
    $2.00 / $6.00
    Has every key capability
    50% less
  • Inkling
    Independent · on DeepInfra
    $0.95 / $4.05
    Has every key capability
    71% less

Benchmarks

Scores published on the model card.

  • Aider Polyglot79.6%

Model line

Newer and older versions, at each lab's own price.

  1. Sep 2026Grok 4.7Latest$2.00 / $6.00
  2. Sep 2026Grok4.7$2.00 / $6.00
  3. Aug 2026Grok 4.6$2.00 / $6.00
  4. Aug 2026Grok4.6$2.00 / $6.00
  5. Jul 2026Grok 4.5$2.00 / $6.00
  6. Apr 2026Grok 4.3$1.25 / $2.50
  7. Mar 2026Grok 4.20$1.25 / $2.50
  8. UndatedGrok 4This page$3.00 / $15.00

Call it

Using Azure AI Foundry's API.

Python
from litellm import completion

response = completion(
    model="azure_ai/grok-4",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Quick answers

How much does Grok 4 cost?

On Azure AI Foundry, Grok 4 costs $3.00 per million input tokens and $15.00 per million output tokens.

Which APIs offer Grok 4?

Grok 4 runs on 4 APIs: Azure AI Foundry, Oracle OCI, Vercel AI Gateway and Replicate.

What is Grok 4's context window?

262K tokens, with up to 8K tokens in one reply.

Is Grok 4 being retired?

Azure AI Foundry retires it on 31 Jan 2027. 3 hosts keep serving it.

Is there a newer version of Grok 4?

Yes. Grok 4.7 is the newest model in this line, released on 21 Sep 2026.

What are cheaper alternatives to Grok 4?

Models that cost less and keep most of what it can do: Grok 4.7 on xAI (50% less), GPT-5.3 Codex on OpenAI (20% less), Gemini 4 Carbon on Google AI Studio (33% less) and Command A Plus on AIHubMix (27% less). Savings are on a mix of 3 input tokens to 1 output token.

What is Grok 4's API model id?

Use grok-4 with Azure AI Foundry. Other hosts use their own ids: xai.grok-4 on Oracle OCI.

Sources

Raw catalog entry for grok-4 on Azure AI Foundry
{
  "deprecation_date": "2027-01-31",
  "deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
  "successor_model": "azure_ai/grok-4.3",
  "input_cost_per_token": 0.000003,
  "litellm_provider": "azure_ai",
  "max_input_tokens": 262000,
  "max_output_tokens": 8192,
  "mode": "chat",
  "output_cost_per_token": 0.000015,
  "source": "https://learn.microsoft.com/en-us/azure/foundry/foundry-models/concepts/models-sold-directly-by-azure",
  "supports_function_calling": true,
  "supports_pdf_input": false,
  "supports_response_schema": true,
  "supports_tool_choice": true,
  "supports_web_search": true
}