/v1/chat/completions endpoint. All conclusions come from hands-on testing against the APIYI gateway on July 13, 2026 (UTC+8).
Basic Chat and Streaming
All six models support the standard OpenAI format and streaming.stream_options: {"include_usage": true} is verified working (the final chunk carries complete usage):
Chain-of-Thought (Reasoning)
This is the most commonly misunderstood billing aspect of the Grok series — read this section in full.Which models emit chain-of-thought
| Model | Reasoning behavior |
|---|---|
grok-4.5 / grok-4.3 / grok-build-0.1 | On by default; responses include reasoning_content; cannot be disabled |
grok-4.20-0309-reasoning | On, includes reasoning_content |
grok-4.20-0309-non-reasoning | Off; reasoning_tokens is 0; answers directly |
grok-4.20-multi-agent-beta-0309 | Internal reasoning not exposed, but reasoning_tokens are still billed |
Reading chain-of-thought and reasoning usage
The reasoning_effort parameter
reasoning_effort (e.g. "low" / "high") is accepted only by grok-4.5; grok-4.20-0309-reasoning explicitly rejects it with a 400 Model ... does not support parameter reasoningEffort. Do not hard-code this parameter in cross-model code.
Structured Outputs
The OpenAI-standardresponse_format: json_schema (strict mode) is supported. Verified passing on grok-4.5 / grok-4.3 / grok-build-0.1 / grok-4.20-0309-reasoning and the multi-agent model — all return JSON strictly conforming to the schema:
Function Calling
The OpenAI-standardtools / tool_choice fields and the full two-round tool-calling flow are supported (verified on grok-4.5 / grok-4.3 / grok-build-0.1):
tool_choice ({"type": "function", "function": {"name": "get_weather"}}) are also verified working.
Vision Input (Image Understanding)
Grok 4.x chat models accept image input (jpg / png, up to 20MiB per image) in the OpenAI Vision format. Verified ongrok-4.5 / grok-4.3 / grok-4.20-0309-non-reasoning — all correctly identified shapes and colors:
Prompt Caching (Automatic)
Grok prefix caching is automatic — zero configuration. In testing, the second same-prefix request onward hit 2688/2735 tokens, billed at the discounted cache rate:FAQ
How do I turn off grok-4.5's chain-of-thought?
How do I turn off grok-4.5's chain-of-thought?
You can’t. Internal reasoning is inherent to
grok-4.5 / grok-4.3 / grok-build-0.1. If you don’t need chain-of-thought and want fast, cheap answers, use grok-4.20-0309-non-reasoning instead.Should reasoning_content go back into the next turn's context?
Should reasoning_content go back into the next turn's context?
No. When replaying history in multi-turn conversations, send back only
content (plus tool-calling fields). reasoning_content is not a standard field — feeding it back just inflates input tokens.How should I set max_tokens?
How should I set max_tokens?
Chain-of-thought consumes the output budget too. If
max_tokens is too small, reasoning can eat the whole budget and truncate the visible answer. For reasoning models, start at 2048 or higher.Do temperature / top_p work?
Do temperature / top_p work?
Yes, they’re accepted normally. Note that reasoning-class models are less sensitive to sampling parameters than traditional models, so tuning value is limited.
Related Docs
Grok Overview
Model lineup, pricing, and capability matrix
Web & X Search
Hands-on with server-side live-search tools