API Free WeekHundreds of APIs are free to call this week.Browse free APIs

Grok 4.7

x-ai/grok-4.7

Grok 4.7 is xAI's flagship model for coding, agentic tasks, and knowledge work, succeeding Grok 4.6. It is particularly strong at long-running software engineering tasks and verifying its own work, with a 500K-token context window.

Input price
$2.00USD / 1M tokens
Output price
$6.00USD / 1M tokens
Context window
N/A
Max output
450K

Try the model

Playground

Open playground
Input⌘ / Ctrl + Enter

Try a prompt

500K context450K max outputVision
Input$2.00/MOutput$6.00/MCache read$0.50/M
OutputReady

Your response will appear here

Choose an example or write a prompt, then click Run.

Specifications

Pricing

Input
$2 / 1M tokens
Output
$6 / 1M tokens
Billing formula
usage.prompt_tokens >= 200000 ? (usage.prompt_tokens * 4 / 1000000 + usage.completion_tokens * 12 / 1000000 - usage.cached_tokens * 1.5 / 1000000) : (usage.prompt_tokens * 2 / 1000000 + usage.completion_tokens * 6 / 1000000)

Context & modalities

Max output
450,000 tokens
Input
Text, image
Output
Text

Capabilities

Chat
Supported
Vision
Supported
Reasoning
Supported
Structured output
Supported
Function calling
Supported
Audio input
Not supported

Access

Provider
xAI
Model ID
x-ai/grok-4.7
Execution
sync
API
Chat Completions API
Endpoint
/v1/chat/completions

Start building

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Chat Completions API endpoint
https://api.sandbase.ai/v1/chat/completions
Model ID
x-ai/grok-4.7
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
  -X POST "https://api.sandbase.ai/v1/chat/completions" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'SANDBASE_JSON'
{
  "model": "x-ai/grok-4.7",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "max_tokens": 2048
}
SANDBASE_JSON
)
printf '%s\n' "$result"

Choose your model

Compare models

All language models
ModelContextInput / 1MOutput / 1MReleased
xAI: Grok 4.7This model
xAI
—$2.00$6.00Sep 21, 2026
xAI488.3K——Aug 12, 2026
xAI488.3K——Jul 8, 2026
xAI250K——May 20, 2026
xAI1M——Apr 30, 2026
xAI2M——Mar 31, 2026