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

**URL:** <https://community.perplexity.ai/t/agent-api-xai-grok-4-6-runs-end-incomplete-max-output-tokens-after-4-6k-output-tokens-with-or-without-a-budget/6631>\
**Category:** Bug Reports\
**Tags:** api\
**Created:** [November 13, 2026, 8:28pm UTC](https://community.perplexity.ai/t/agent-api-xai-grok-4-6-runs-end-incomplete-max-output-tokens-after-4-6k-output-tokens-with-or-without-a-budget/6631 "2026-11-13T20:28:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yujia\_at\_Spectrum](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/yujia_at_spectrum/32/3816_2.png) [@Yujia\_at\_Spectrum](https://community.perplexity.ai/u/Yujia_at_Spectrum)\
**Post date:** [November 13, 2026, 8:28pm UTC](https://community.perplexity.ai/t/agent-api-xai-grok-4-6-runs-end-incomplete-max-output-tokens-after-4-6k-output-tokens-with-or-without-a-budget/6631/1 "2026-11-13T20:28:21Z")

</div>

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

```auto
{

  "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](https://www.rfc-editor.org/rfc/rfc9000.html) 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

---

<div class="post-metadata">

**Author:** ![albert\_pplx](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@albert\_pplx](https://community.perplexity.ai/u/albert_pplx)\
**Post date:** [November 13, 2026, 11:05pm UTC](https://community.perplexity.ai/t/agent-api-xai-grok-4-6-runs-end-incomplete-max-output-tokens-after-4-6k-output-tokens-with-or-without-a-budget/6631/2 "2026-11-13T23:05:18Z")

</div>

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
