Grok 4.7

by xAI
xai/grok-4.7

Grok 4.7 is a text and image-input model by xAI, available through the AgentSky API as xai/grok-4.7 at $2.20 per million input tokens and $6.60 per million output tokens, with a 500K context window.

xAI's latest flagship for coding, agentic tasks, and knowledge work, with four reasoning-effort levels and a 500K-token context.

Run Grok 4.7 with an agent

Each guide pairs this model with a compatible agent and opens the composer with both selected.

Pricing

USD per million tokens, using your plan when signed in. Each request uses the tier matching its full input context, including cached input; output tokens do not choose the tier.
Input context (tokens)Cache modeThinkingInputOutputCache readCache write
Up to 200,000AutomaticStandardPrice: $2.20Price: $6.60Price: $0.55—
200,001–500,000AutomaticStandardPrice: $4.40Price: $13.20Price: $1.10—

Every response carries its own cost. Balance and per-call records: /v1/credits and /v1/generation.

Use it

Point your client at the gateway and pass this model id. Nothing else changes.
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://gateway.agentsky.dev/v1",
  apiKey: process.env.AGENTSKY_API_KEY, // ast_…
});

const completion = await client.chat.completions.create({
  model: "xai/grok-4.7",
  messages: [{ role: "user", content: "Summarise this ticket." }],
});
console.log(completion.usage.cost); // USD, in the response

Questions