XAI MODEL GUIDE
Grok 4.7 API
Grok 4.7 is xAI's model for software engineering, tool-using agents, and analysis with text or images.
Compare it with Grok 4.6 on accepted patches, tool errors, and total tokens. The listed base rates are the same for both models.
Fixed budgets based on the short-context rate when prompts often reach 200,000 tokens.
Grok API cost estimate
Enter token counts for one representative request; every usage item is multiplied by the request count.
Cost breakdown
Rates are per 1M tokens- LLMFly AI
- $0.8
- Vendor reference
- $2
- Total tokens
- 100,000
- LLMFly AI
- $2.4
- Vendor reference
- $6
- Total tokens
- 10,000
- LLMFly AI
- —
- Vendor reference
- —
- Total tokens
- 0
- LLMFly AI
- $0.2
- Vendor reference
- $0.5
- Total tokens
- 0
Choosing and integrating
Grok 4.7 API pricing breakdown
Grok 4.7 (grok-4.7) is billed by token usage. Prices below are USD per 1M tokens. LLMFly AI rates already include the 0.4x group multiplier; do not apply it again. Provider reference prices are separate. These rates come from the site's Model Plaza snapshot; confirm live catalog and account rates before calling.
Example: a request with 10,000 uncached input tokens and 1,000 output tokens costs approximately $0.0104 in LLMFly AI token charges. This excludes cache writes, tools, retries, and other additional fees.
- Platform and provider prices use their own input-token tiers. Do not apply provider long-context multipliers to platform prices.
- Not listed does not mean free. Account for cache reads, cache writes, and uncached input in their respective billing categories.
- Token cost = tokens in each billing category × its price per million ÷ 1,000,000. Add tools and other charges separately.
| Price source | Input tokens per request | Input | Output | Cache write | Cache read | 1h cache write |
|---|---|---|---|---|---|---|
| LLMFly AI | <200K | $0.8 | $2.4 | Not listed | $0.2 | Not listed |
| LLMFly AI | ≥200K | $1.6 | $4.8 | Not listed | $0.4 | Not listed |
| Provider reference | <200K | $2 | $6 | Not listed | $0.5 | Not listed |
| Provider reference | ≥200K | $4 | $12 | Not listed | $1 | Not listed |
Pricing tiers and additional charges
At 200,000 input tokens or more, the long-context tier applies to the whole request. Check the price after adding conversation history and tool results.
Grok 4.7 capabilities and workloads
- xAI lists function calling and structured outputs. Use one real tool schema and verify that returned arguments pass your validator.
Limits to check before migration
- Recheck reasoning effort, streaming events, and tool arguments when replacing Grok 4.6. Use the output limit documented for your endpoint.
Comparing Grok 4.7 with sibling models
Compare it with Grok 4.6 on accepted patches, tool errors, and total tokens. The listed base rates are the same for both models.
| Model ID | Context / max output | LLMFly AI in / out | Vendor reference in / out |
|---|---|---|---|
| grok-4.7 | 500,000 / Not published | $0.8 / $2.4 | $2 / $6 |
| grok-4.6 | — | $0.8 / $2.4 | $2 / $6 |
| grok-4.5 | 500,000 / Not publicly capped for text output | $0.8 / $2.4 | $2 / $6 |
Use the exact model ID when connecting
Set LLMFLY_API_KEY to a key with access to this model, then send this text request.
- Send a minimal text request and inspect the response and usage.
- Test streaming, tool calls, and structured output separately if your application needs them.
- Check retry behavior and spending limits before increasing traffic.
curl https://app.llmfly.ai/v1/chat/completions \
-H "Authorization: Bearer $LLMFLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.7",
"messages": [
{
"role": "user",
"content": "Reply with OK."
}
],
"stream": false
}'Vendor capability versus gateway access
Grok 4.7 runs under the Grok group (0.4x multiplier) in Model Plaza over the OpenAI-compatible https://app.llmfly.ai/v1/chat/completions endpoint. Validate provider-specific tools or grounding parameters on your route and reconcile billed tokens in your console usage log.
Frequently asked questions
What should I put in the model field?
Use the exact ID grok-4.7, not the display name.
How is the discount calculated?
The current 0.4x multiplier is applied to the base rate, giving 60% off the catalog's official reference. Amounts are shown per million tokens.
Do these prices include every possible fee?
Not necessarily. Check cache-write duration, tools, and other route charges separately. Use the full pricing table and actual usage records to reconcile a bill.
What are the context and output limits?
Vendor documentation lists 500,000 context and Not published maximum output; confirm gateway route limits separately.
Use the Grok 4.7 API
LLMFly AI provides this model. Use the exact ID grok-4.7 and confirm current account pricing in Model Plaza.