Agent API: xai/grok-4.6 runs end "incomplete" (max_output_tokens) after ~4–6k output tokens, with or without a budget

Hi Perplexity API team,

We’re seeing Agent API runs served by xai/grok-4.6 stop partway through the final answer. They end with status “incomplete” and incomplete_details.reason “max_output_tokens”, after only about 4,200–5,700 output tokens. This happens whether max_output_tokens is set or omitted. The same requests on xai/grok-4.7 complete every time. Is this a known issue?

SUMMARY

- Endpoint: POST /v1/responses with background=true, polled with GET /v1/responses/{id}.

  • Each affected run ends with:

  • status = “incomplete”

  • incomplete_details = {“reason”: “max_output_tokens”}

  • error = null

  • the answer cut off mid-sentence

  • usage.output_tokens between about 4,200 and 5,700

- It happens with max_output_tokens omitted (the stored response shows max_output_tokens: null), and with 100000, 1000000 and 2147483647 (the int32 maximum). The size of the budget makes no difference.

- The cut almost always comes when the answer is written straight after a fetch_url step.

- We first saw it in production on 2026-11-10 (UTC), around the “Automatic output-token limits” changelog entry (November 2026).

REQUEST SHAPE

{

  "models": \["xai/grok-4.6"\],

  "reasoning": {"effort": "medium"},

  "instructions": "<short research-analyst instruction asking for cited, source-grounded answers>",

  "input": "<question>",

  "tools": \[

    {"type": "web_search", "search_context_size": "medium"},

    {"type": "fetch_url", "max_urls": 10}

  \],

  "max_steps": 6,

  "background": true

}

Variants tested: max_output_tokens omitted, 100000, 1000000 and 2147483647; max_steps 3 or 6; web_search + fetch_url, or fetch_url only.

A simple repro question (fetch_url only, max_steps 3):

“Read RFC 9000: QUIC: A UDP-Based Multiplexed and Secure Transport in full (do not run any web searches; fetch only that URL) and write an exhaustive technical report of at least 4,000 words on QUIC as specified there: connection establishment and 0-RTT, every packet type, a table listing every frame type with its purpose, loss recovery hooks, connection migration, flow control, error handling, and security considerations. Cite section numbers.”

RESULTS (same requests, only the model and max_output_tokens changed)

Model max_output_tokens Tools / max_steps Ended “incomplete”
xai/grok-4.6 set (100000 / 1000000 / 2147483647) 3 steps, answer written right after a fetch_url step 9 of 15
xai/grok-4.6 omitted 3 steps, answer written right after a fetch_url step 1 of 9
xai/grok-4.6 omitted web_search + fetch_url, 6 steps 8 of 12
xai/grok-4.7 100000 3 and 6 steps as above, plus one 10-step high-effort run 0 of 19
xai/grok-4.7 omitted 3 and 6 steps as above 0 of 14

Completed grok-4.6 runs of the same requests produced about 13,700–18,800 output tokens. So the cut-off is well below what the model normally writes, and far below any budget we set.

EXAMPLE RESPONSE IDS (all from 2026-11-13 UTC)

grok-4.6, max_output_tokens omitted, same RFC question and same fetched page:

  • cut at 4,383 output tokens: resp_328958b6-66ae-4339-a2bc-2986f8e9da82

  • completed with 18,799 output tokens: resp_cca0f4d7-b68a-4301-af74-6adc82a249f4

grok-4.6, max_output_tokens = 2147483647, cut at 4,484 output tokens:

  • resp_3b849660-135e-4cac-9426-772f36385196

grok-4.6, max_output_tokens omitted, web_search + fetch_url, max_steps 6:

  • cut at 5,689 output tokens: resp_84bf821b-d1b2-4a71-bfe1-72abd3983418

  • cut at 5,642 output tokens: resp_3ca6d646-5db7-4e5e-b4d2-b6e37db9235f

grok-4.7, max_output_tokens = 100000, same question as the two above, completed:

  • 14,171 output tokens: resp_87b7fbab-71ca-463b-905f-72827920d64b

EXPECTED

With max_output_tokens omitted, each generation should be able to produce up to 128,000 output tokens (capped by the model’s limit), as the docs describe. With an explicit budget, the run should stop only when that budget is actually used up. In both cases, incomplete_details.reason = “max_output_tokens” should only appear when an output limit has really been reached.

QUESTIONS

1. Is this a known issue with xai/grok-4.6 on the Agent API? If so, is a fix planned?

2. Is there a per-generation output limit for grok-4.6 (around 4–6k tokens after a fetch_url step) that isn’t covered in the docs?

3. Until it’s fixed, do you recommend xai/grok-4.7 instead of grok-4.6?

For now we’ve moved our traffic to xai/grok-4.7, which hasn’t shown the problem. We can share more response ids or exact request bodies privately if that helps.

Thanks,

Yujia

Hi Yujia,

Thanks for the detailed report. The response IDs and the comparison table made this quick to dig into.

We’ve reproduced it on our side. To answer your questions:

  1. Yes, it’s a known issue now, and we’re working on a fix. It affects xai/grok-4.6 only.

  2. No, there’s no hidden per-generation limit around 4–6k tokens. When you omit max_output_tokens, each generation can still go up to 128,000 output tokens, as the docs say. Your requests are set up correctly, and the max_output_tokens reason on these runs doesn’t mean you hit a real limit.

  3. Yes, staying on xai/grok-4.7 is a good call for now. We haven’t seen the problem there.

I’ll post an update here once the fix is out. No need to send more request bodies yet. If we need specific runs, I’ll ask.

Albert