Introduction
An OpenAI-compatible chat endpoint for xAI's Grok 4.6, where a screenshot and the question about it travel in the same user turn.
Grok 4.6 comes from xAI and answers at POST https://api.spicyapi.ai/v1/chat/completions under the model name xai/grok-4.6. The request surface is the familiar one: a messages array of at most 256 ordered turns, an output cap, two sampling dials, a tool list, a response format, and reasoning_effort to say how hard the model should work before it writes. The window holds 500,000 tokens and a single reply can take 450,000 of them, so the larger share of the budget can sit on the answer side rather than the prompt side. Message content accepts text parts and image_url parts; there is no file or PDF part on this endpoint, and the modality is text and images in, text out.
Key features & highlights
A picture and the sentence about it, in one turn
Content may be a plain string or an array of parts, and an image part carries a url plus a detail hint of auto, low or high. The capture and the question about it arrive together, so the model reads the pixels instead of your description of them, which is the whole difference whenever the answer hangs on a mislabelled axis, a stack trace cut off at the edge, or a layout that only breaks at one width. Image content is metered inside the 500,000-token window rather than beside it, so several large captures and a long history compete for the same budget.
Almost the entire budget can go to the answer
Grok 4.6 accepts a visible-reply limit up to 450,000 tokens; leaving it at 4,096 can cut a long technical report short. SpicyAPI’s recorded Grok 4.6 check used effort high and a cap of 800, yet measured 18,339 output tokens: billable reasoning can exceed the visible-reply allowance. For a Grok 4.6 budget comparison, lower reasoning_effort as well as setting the visible-reply limit.
For Grok 4.6 technical analysis, choose low, medium, high or xhigh; the default is high. Deliberation adds billable output tokens. The visible-answer max_tokens control is not a ceiling on that reasoning usage in the recorded SpicyAPI tests.
Nothing of ours sits in the path
We add no content classifier of our own between you and this model. What it declines to write is its own behaviour rather than a layer inserted here, and what you send is not scanned, scored or rewritten on the way through. You hold the rights to the material you send, and you answer for what is done with the reply.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | Send a diagram as |
reasoning_effort | No | low, medium, high or xhigh. High is the default; effort is spent in output tokens. |
max_tokens | No | Grok 4.6 accepts a visible-reply limit up to 450,000 tokens; leaving it at 4,096 can cut a long technical report short. |
temperature | No | Grok 4.6 starts at temperature 0.7 and permits 0–2. Hold it at 0 when testing how a changed diagram affects the technical answer. |
top_p | No | Grok 4.6 |
tools | No | Expose calculators and evidence retrieval to Grok 4.6 through at most 128 function schemas; a generated call is a request for your application to execute. at most 128 items |
parallel_tool_calls | No | Keep true for Grok 4.6 investigations with independent evidence sources. Default: |
tool_choice | No | For a Grok 4.6 investigation, auto lets the model decide when a calculation is useful. |
response_format | No | Have Grok 4.6 return a JSON object when an engineering analysis needs separate values for assumptions, evidence and conclusions. |
Pricing
Input $2 / Output $6 per 1 million tokens; Prompts of 200K tokens or more: Input $4 / Output $12
For Grok 4.6, diagrams and source material share the input count that selects the price tier. A total including cached input of 200,000 tokens or more selects long-context rates for input, cache and output throughout the call; smaller requests stay on standard rates. Reasoning is output usage, and the cache-free hold is adjusted to the measured bill.
Use cases
Triage a capture instead of describing it
Send the screenshot at detail high beside the question in one user message and the model works from the pixels: the axis label that is wrong, the row that disappeared, the frame cut off at the edge. Two captures an hour apart in the same turn let you ask which number moved, rather than asking about a summary you typed out by hand.
Write something book-length in a single call
Raise max_tokens toward 450,000 and the migration guide, the long report or the whole test suite comes back as one response instead of a chain of continuations, each of which loses a little of the thread. Turn on stream: true and the text lands while it is still being written.
Keep a tool loop readable
Declare up to 128 function definitions, pair them with tool_choice, and hand each result back as a tool-role message on the following turn. Hold reasoning_effort steady for the whole loop and the only thing that varies between iterations is the conversation itself, which is what makes a trace worth reading when the loop goes wrong.
Hand the answer to code, not to a person
Ask for a JSON object through response_format and drop temperature to 0, and the reply comes back as a structure your parser can take. Pair that with an image part and you have extraction straight from a receipt, a chart or a form capture, with no transcription step in between.
Prompt guide & pro tips
Put the image where the question is
Keep the text part and the image parts inside the same user message rather than sending the picture first and the question afterwards. Say what you want read out of it, whether that is a number, a difference or a verdict, and name the panel when there is more than one: detail high buys resolution, not attention.
POST https://api.spicyapi.ai/v1/chat/completions
{
"model": "xai/grok-4.6",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "These two captures are an hour apart on the same dashboard. Which metric regressed, and what in the second image explains it?"},
{"type": "image_url", "image_url": {"url": "https://cdn.spicyapi.ai/models/examples/inputs/c681580c3c6a0b63.jpeg", "detail": "high"}},
{"type": "image_url", "image_url": {"url": "https://cdn.spicyapi.ai/models/examples/inputs/59f0bc6291069978.jpeg", "detail": "high"}}
]
}
],
"reasoning_effort": "high",
"max_tokens": 4000
}
Spend effort where it changes the answer
reasoning_effort begins at high, so an omitted field already buys the careful setting and the output tokens that come with it. Keep xhigh for work that has to be right the first time, use medium for ordinary review, and drop to low for short mechanical turns. Effort is billed as output, so it shares a ceiling with the reply itself, and a generous cap at xhigh is a large request in both senses.
Check which tier the request lands in
Input and cached input are added together, and from 200,000 tokens the whole request prices on the long-context rate, not only the part above the line. Trimming a history from 210,000 tokens down to 190,000 therefore changes more than the cost of the tokens you removed. The hold taken before the call assumes no cache savings at all and settlement refunds the difference against measured usage, so the figure you see up front is a ceiling rather than the price.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "xai/grok-4.6/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.













