Grok 4.7

Write and review code, plan multi-step work and analyze long documents with xAI's reasoning model: text and image input, 500K-token context and private mode.

Grok 4.7 is xAI's reasoning model for coding and knowledge work. Send a prompt, or a chat history in messages, and get a text answer: write and review code, plan multi-step work, draft and edit documents, pull facts out of contracts and reports, or explain a screenshot, chart or photo (images go in messages as image_url parts). Its 500K-token context window fits long documents and large codebases in one request.

Grok always reasons before it answers. Set reasoning_effort to low for quick replies, medium, high (the default) for harder problems, or xhigh for the most thorough work; system_prompt, temperature, top_p and max_tokens work as usual. Call it through the FlyMyAI API or the OpenAI-compatible Chat Completions endpoint with the official OpenAI SDK. Set private_mode to true to keep the prompt and the answer out of FlyMyAI storage and logs (synchronous calls only); xAI processes the request under its own data policy.

Price per 1M tokens: $2.00 input, $0.50 cached input, $6.00 output. Reasoning counts as output, and repeated prompt prefixes are cached automatically. Prompts of 200K tokens or more are billed at $4.00, $1.00 and $12.00 per 1M. Grok 4.7 answers in text. On the OpenAI-compatible endpoint it also takes function tools and response_format (json_schema or json_object for JSON answers); it has no live web or X search. Use the image, video and audio models to create media.

Price: $2.00 per 1M input tokens, $6.00 per 1M output tokens, cached input $0.50 per 1M.

Run Grok 4.7 via API

curl -X POST https://api.flymy.ai/api/v1/flymyai/grok-4_7/predict \
  -H "X-API-KEY: $FLYMYAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Explain in two sentences why the sky is blue.","reasoning_effort":"low"}'

OpenAI-compatible API

Grok 4.7 also speaks the OpenAI Chat Completions protocol: use the official OpenAI SDK with base URL https://api.flymy.ai/api/v1/flymyai/grok-4_7/openai/v1 and your FlyMy.AI API key.

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.flymy.ai/api/v1/flymyai/grok-4_7/openai/v1", api_key=os.environ["FLYMYAI_API_KEY"])
response = client.chat.completions.create(
    model="flymyai/grok-4_7",
    messages=[{"role": "user", "content": "What is a vector database?"}],
)
print(response.choices[0].message.content)

OpenAI-compatible API docs

API documentation · Create a free account · Pricing

Related models