← All Models
Grok 4.7
xAI's model for coding, agentic tasks, and knowledge work. Text and image input, 500K context, configurable reasoning from low to xhigh, function calling, structured outputs, and native web search, X search, and code execution. All token rates double at 200K or more input tokens. Native tools are billed from actual provider usage; X Search charges per fetched post and user profile.
Web Search
X Search
Code Execution
Specifications
| Provider | xAI |
| Category | Text |
| Context window | 500K tokens |
Pricing (Starter tier)
260.00 credits / 1M input tokens
65.00 credits / 1M cached input tokens
780.00 credits / 1M output tokens
At 200K or more input tokens: 2x all token rates
Native tools charged separately from actual usage
Higher tiers get volume discounts. See tiers
Quick Start
curl -N https://query.genx.sh/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4.7","messages":[{"role":"user","content":"Review this function for edge cases: function median(a){a.sort();return a[a.length/2]}"}],"reasoning_effort":"low","stream":true}'
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string | required | — | The input text prompt |
system_prompt |
string | optional | — | System instructions |
image_url |
string | optional | — | Image URL to analyze |
max_tokens |
number | optional | — | Maximum output tokens, including reasoning |
reasoning_effort |
string | optional | high |
low, medium, high, or xhigh |
tools |
array | optional | — | Built-in web_search, x_search, code_execution, or file_search. File search requires collection IDs; attachment search activates automatically for session files. |
Availability
Grok 4.7 is available in the GenX Pro App and via the GenX Router API.