Grok 4.7 API: pricing and how to call it

Grok 4.7 has the model ID grok-4.7. On MYUSAPI it costs $0.70 per 1M input tokens and $2.10 per 1M output tokens, prepaid and charged by usage. The model is never swapped or downgraded, and you are billed by the usage the upstream reports.

Grok 4.7 API pricing

ItemPer 1M tokens
InputOfficial$2.00, our price$0.70
OutputOfficial$6.00, our price$2.10
Cache readOfficial$0.50, our price$0.175

USD. The struck figure is xAI’s official standard list price; bold is ours, with input and output at 35% of list. Source of the list price

Example: a job that uses 1M input tokens and 200K output tokens costs $1.12 at our rates and $3.20 at list price.

Official rates: Official standard prices checked on 2026-11-08. When a prompt reaches 200K tokens, the entire request uses long-context rates: $4 input, $1 cached input, and $12 output per million tokens.

Specifications

Model IDgrok-4.7
ProviderxAI
Context window500K tokens
EndpointsChat Completions, Responses, Anthropic Messages
CapabilitiesReasoning, Tools, JSON

A reasoning model for coding, agentic tasks, and knowledge work, with function calling and structured outputs.

How to call the Grok 4.7 API

Sign up, add credit and put your key in the MYUSAPI_API_KEY environment variable.

Sign up and get an API key

Tested 2026-11-12: the cURL requests on this page answered for grok-4.7. The Python samples were not run.

OpenAI SDK (Python, Chat Completions)

A project already on the OpenAI SDK changes only base_url (https://myusapi.com/v1) and the model ID.

Python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://myusapi.com/v1",
    api_key=os.environ["MYUSAPI_API_KEY"],
)

reply = client.chat.completions.create(
    model="grok-4.7",
    messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

Chat Completions (cURL)

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

Whether your key can call it now is what GET https://myusapi.com/v1/models returns.

Use Grok 4.7 in OpenAI-compatible clients

OpenAI-compatible clients such as Cherry Studio and Cline work: in the connection guide choose your tool and grok-4.7, then copy the generated setup.

Open the connection guide

Other xAI models

All models and prices