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
| Item | Per 1M tokens |
|---|---|
| Input | Official |
| Output | Official |
| Cache read | Official |
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 ID | grok-4.7 |
| Provider | xAI |
| Context window | 500K tokens |
| Endpoints | Chat Completions, Responses, Anthropic Messages |
| Capabilities | Reasoning, 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 keyTested 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.
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 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 guideOther xAI models
- Grok 4.3 API: $0.50 input, $1.00 output per 1M tokens
- Grok Build 0.1 API: $0.30 input, $0.60 output per 1M tokens
- Grok 4.5 API: $0.70 input, $2.10 output per 1M tokens
- Grok 4.6 API: $0.70 input, $2.10 output per 1M tokens
- Grok 4.20 Non-Reasoning API: $0.50 input, $1.00 output per 1M tokens
- Grok 4.20 Reasoning API: $0.50 input, $1.00 output per 1M tokens
- Grok 4.20 Multi-Agent Beta API: $0.50 input, $1.00 output per 1M tokens