xai/grok-4.7
xAI Grok 4.7 flagship. Strong reasoning, agentic coding and tool use, accepts image input, with a 500K-token context window, served over an OpenAI-compatible protocol.
Cache read $0.075/M · Cache write —/M
| Tier | Input | Cache read | Cache write | Output |
|---|---|---|---|---|
| Standard ≤200K | $0.3 | $0.075 | — | $0.9 |
| Standard >200K | $0.6 | $0.15 | — | $1.8 |
Use either ID to call this model via the API.
xai/grok-4.7You can use these names directly in the request model field.
Replace the ONEHOP_KEY placeholder with your API key. Create one →
from openai import OpenAI
client = OpenAI(
base_url="https://api.onehop.ai/v1",
api_key="<ONEHOP_KEY>",
)
completion = client.chat.completions.create(
model="xai/grok-4.7",
messages=[{"role": "user", "content": "What is the meaning of life?"}],
)
print(completion.choices[0].message.content)