Grok 4.7 API pricing and code examples

Grok 4.7 is a xAI model you can call through LivRouter's OpenAI-compatible endpoint. There is no separate xAI account and no separate invoice: one LivRouter API key reaches Grok 4.7 alongside every other model on the platform, billed per token from prepaid credits.

Grok 4.7 API at a glance

Compare Grok 4.7 API pricing, model ID, and OpenAI-compatible examples through LivRouter.

Model ID
grok-4.7
Provider
xAI
API format
OpenAI-compatible
Billing
Per token from LivRouter credits
Common integration focus
xAI API integrations

Grok 4.7 pricing

Rates are in USD per 1M tokens. The reference row is the provider base rate recorded in LivRouter's catalog; the plan rows show the published rates for each eligible plan.

PlanInput / 1MOutput / 1MCached input / 1M
Reference (xAI)$2.00$6.00$0.50
Max Grok−84%$0.32$0.96$0.08
Pro Grok−77%$0.46$1.38$0.115

Lowest listed LivRouter rate for Grok 4.7: $0.32 per 1M input tokens on the Max Grok plan — about 84% below the xAI reference rate. See every plan and rate.

Source: LivRouter model catalog. Catalog checked .

What does a Grok 4.7 request cost?

One million uncached input tokens plus 100,000 output tokens at the listed Max Grok rates cost $0.416. This example excludes subscription fees and assumes the selected plan is active. Actual charges depend on input, output, and cached-token usage.

Compare plan fees and credit allowances

Call Grok 4.7 with the OpenAI SDK

Grok 4.7 follows the OpenAI chat completions format, so existing OpenAI client code keeps working — change the base URL and the model name.

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.livrouter.com/v1",
  apiKey: process.env.LIVROUTER_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "grok-4.7",
  messages: [{ role: "user", content: "Hello" }],
});

console.log(completion.choices[0].message.content);

Prefer plain HTTP? The same request over curl:

curl https://api.livrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LIVROUTER_API_KEY" \
  -d '{
    "model": "grok-4.7",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Frequently asked questions about Grok 4.7

How much does grok-4.7 cost through LivRouter?

grok-4.7 is metered per token. The xAI reference rate is $2.00 per 1M input tokens and $6.00 per 1M output tokens. On the Max Grok plan LivRouter charges $0.32 per 1M input tokens, about 84% below the xAI reference rate. Cached input is $0.08 per 1M tokens.

Can I call grok-4.7 with the OpenAI SDK?

Yes. grok-4.7 is reachable through the OpenAI-compatible endpoint at https://api.livrouter.com/v1. Keep your existing OpenAI client code and change the base URL and the model name to "grok-4.7".

Do I need a separate xAI account?

No. LivRouter routes the request for you. You only need a LivRouter API key and credits — no separate xAI subscription.

Is grok-4.7 available on the Start tier?

grok-4.7 is not part of the Start tier group. It is available on the paid plans listed above.

Other xAI models on LivRouter

View all model pricingxAI API overviewQuickstart guide