Overview
Grok 4.7 is an xAI reasoning model with a 500,000-token context window. Use grok-4.7 through MuleRouter's OpenAI-compatible Chat Completions or Responses API. Both endpoints support streaming and non-streaming requests.
Supported Endpoints
| Endpoint | Path |
|---|
| Chat Completions | /vendors/openai/v1/chat/completions |
| Responses | /vendors/openai/v1/responses |
The playground uses Chat Completions.
Chat Completions
Send a messages array. Set reasoning_effort to low, medium, high (default), or xhigh.
{
"model": "grok-4.7",
"messages": [
{"role": "user", "content": "Explain binary search briefly."}
],
"reasoning_effort": "low",
"stream": false
}
Responses
Send input as a string or an array of input items. Responses uses reasoning.effort with the same effort levels.
{
"model": "grok-4.7",
"input": "Explain binary search briefly.",
"reasoning": {"effort": "low"},
"stream": false
}
Set stream to true for incremental output on either endpoint.
Web Search
Use the Responses endpoint with the web_search tool to let the model search the web.
{
"model": "grok-4.7",
"input": "Find the latest xAI product announcements and cite your sources.",
"tools": [{"type": "web_search"}],
"reasoning": {"effort": "low"},
"stream": false
}
Web Search costs $0.005 per actual search call ($5.00 per 1,000 calls), in addition to token charges. One response can make multiple searches. Declaring the tool alone does not incur a search fee; requests that do not execute a search have no search charge. The search rate is the same in both context tiers.
Pricing
Prompt tokens, including cached input, select the price tier for the entire request. Prompts with fewer than 200,000 tokens use the lower tier; prompts with exactly 200,000 tokens or more use the higher tier for input, cached input, and output. Cached tokens use the cached input rate instead of the regular input rate. Reasoning is billed at the output rate.
Pricing