Seedream 5.0 Flash is LIVE — Faster & Cheaper | Try Now →
xai
x-ai/grok-4.7

x-ai/grok-4.7

Release date: 2026-09-22

500,000 context · $1.60/M input tokens · $4.80/M output tokens

Grok 4.7 is xAI’s reasoning model for coding, tool use, and knowledge work. It supports text and image input with a shared 500,000-token context window.

Pricing

Pay-per-use

No upfront costs, pay only for what you use

Input
> 200K $3.20 / M Tokens
Output
> 200K $9.60 / M Tokens
Cache Read
> 200K $0.80 / M Tokens

Try the model

x-ai/grok-4.7
Online
xai
Hi! I am a helpful AI assistant. What can I do for you?
Ready to use this model in a local coding agent?Agent setup

API Usage

Use the following code examples to integrate with our API:

import OpenAI from 'openai';

if (!process.env.WAVESPEED_API_KEY) throw new Error('Set WAVESPEED_API_KEY');
const client = new OpenAI({
  apiKey: process.env.WAVESPEED_API_KEY,
  baseURL: 'https://llm.wavespeed.ai/v1',
  timeout: 120_000,
  maxRetries: 2,
});

try {
  const response = await client.chat.completions.create({
    model: 'x-ai/grok-4.7',
    messages: [{ role: 'user', content: 'Hello!' }],
  });
  console.log(response.choices[0]?.message?.content ?? '');
} catch (error) {
  console.error('LLM request failed:', error);
  process.exitCode = 1;
}

Model Introduction

Grok 4.7

Grok 4.7 supports text and image input, reasoning, function calling, and structured JSON output.

  • Context: 500,000 tokens shared by input and output.
  • Maximum output: 450,000 tokens, subject to remaining context.
  • Reasoning effort: low, medium, high (default), xhigh. Reasoning cannot be disabled.

Pricing

USD per million tokens:

Input lengthInputOutputCached input
Below 200,000 tokens$1.60$4.80$0.40
200,000 tokens and above$3.20$9.60$0.80

Web search, when used, costs $0.005 per search.

API example

from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://llm.wavespeed.ai/v1")
response = client.chat.completions.create(
    model="x-ai/grok-4.7",
    messages=[{"role": "user", "content": "Explain binary search in one sentence."}],
    max_tokens=2048,
    reasoning_effort="low",
)
print(response.choices[0].message.content)

Info

Providerxai
Typellm

Supported Functionality

Input
TextImage
Output
Text
Context500,000
Max Output450,000
Vision✓ Supported
Function Calling✓ Supported

API Access Guide

Base URLhttps://llm.wavespeed.ai/v1
API Endpointchat/completions
Model IDx-ai/grok-4.7

Grok 4.7 API

x-ai/grok-4.7

Grok 4.7 is xAI’s reasoning model for coding, tool use, and knowledge work. It supports text and image input with a shared 500,000-token context window.

Input

$1.6 /M

Output

$4.8 /M

Context

500K

Max Output

450K

Vision

Supported

Tool Use

Supported

Try Grok 4.7 on WaveSpeedAI

Access Grok 4.7 through our unified API — OpenAI-compatible, no cold starts, transparent pricing.

Frequently Asked Questions about Grok 4.7

How much does Grok 4.7 cost via the API?+

Pricing on WaveSpeedAI: $1.60 per million input tokens and $4.80 per million output tokens. Prompt caching and batch processing are billed separately and reduce effective cost on long, repetitive workloads.

What is the context window of Grok 4.7?+

Grok 4.7 supports up to 500K tokens of context with up to 450K tokens of output per request.

Is Grok 4.7 OpenAI-compatible?+

WaveSpeedAI exposes Grok 4.7 at https://llm.wavespeed.ai/v1 through the OpenAI-compatible Chat Completions interface. Most OpenAI SDK clients work by changing the base URL and API key; optional fields depend on the selected model.

How do I get started with Grok 4.7?+

Sign in to WaveSpeedAI, create an API key in Access Keys, then send a request to https://llm.wavespeed.ai/v1/chat/completions with the model id shown above. Check the current model catalog for availability, capabilities, and pricing.

Related LLM APIs