---
title: "Grok Context Window: Limits by Model and Plan (2026)"
description: "Grok context window limits range from 256,000 to 1 million tokens shared across prompt, chat history, and replies."
url: https://www.activepieces.com/blog/grok-context-window-limits-by-model-and-plan-2026
updated: 2026-12-06
---

> Every page on www.activepieces.com is available as markdown: add `.md` to the URL, or send `Accept: text/markdown`. Site index: https://www.activepieces.com/llms.txt

# Grok Context Window: Limits by Model and Plan (2026)

By Margit Solheim · December 6, 2026 · 14 min read · Filed under [Automation thoughts](https://www.activepieces.com/blog/category/automation-thoughts)

**Summary**

Grok context windows of 256K–1M tokens are shared by prompt, history and reply; one team's batch job silently truncated contracts after 02:14 when history grew, leaving no space for output.

- Grok 4.7, xAI's current flagship, lists 500,000 tokens; older Grok 4.3 and 4.20 were listed at 1,000,000.
- Nightly batch job began truncating supplier-contract summaries at 02:14 without returning errors.
- Five hours lost to truncated summaries that looked complete but contained incomplete data.

Grok models carry context windows from **256,000 to 1,000,000 tokens**, and that figure is one budget shared by your prompt, the conversation history and the reply, whether you call the model directly or through a workflow tool like [Activepieces](https://www.activepieces.com). It's not a file-size limit.

![One wide horizontal bar split into three adjacent segments for the prompt, the conversation history and the reply, all…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/86e02a6b-2589-4e62-a21c-04608e91511b/grok-context-window-limits-by-model-and-plan-202-4599441d.webp)

A token is a chunk of text, **roughly three-quarters of an English word**. The context window is the most tokens the model can hold at once, input and output together.

A 500K window given a 450K-token file leaves about 50K for instructions, history and the answer.

## Context window limits per Grok model

### Table of current models and limits

Size a batch to the row's window, not to the largest number. [models.dev](http://models.dev/providers/xai/) lists Grok 4.7, xAI's current flagship, at 500K; older models were listed at 1,000K (Grok 4.3 and Grok 4.20), 500K (Grok 4.6 and 4.5) and 256K (Grok Build 0.1).

[AI Studio's context-window list](https://aistudio.quest/context-windows) matches these for the 4.x models. Rate limits, prices and resets weren't found on a page I could verify, so they read "not published".

| Model | Context window (tokens) | Rate limits (requests, tokens per minute) | Price per million tokens | Reset window |
|---|---|---|---|---|
| Grok 4.3 | 1,000K | not published | not published | not published |
| Grok 4.20 (Reasoning and Non-Reasoning) | 1,000K | not published | not published | not published |
| Grok 4.7 | 500K | not published | not published | not published |
| Grok 4.6 | 500K | not published | not published | not published |
| Grok 4.5 | 500K | not published | not published | not published |
| Grok Build 0.1 | 256K | not published | not published | not published |

![A simple chart of Grok models: stacked horizontal bars, Grok 4.3 longest, Grok 4.7 half as long, Grok Build 0.1 shortest…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/294a89ac-9e7c-4913-a34c-3dd19f979e5c/grok-context-window-limits-by-model-and-plan-202-bfcea82e.webp)

_Prices and plan limits checked against [docs.claude.com](https://docs.claude.com/en/docs/about-claude/models/overview) and [claude.com](https://claude.com/pricing) and [openai.com](https://openai.com/chatgpt/pricing) and [gemini.google](https://gemini.google/subscriptions) on December 5, 2026._

Every cell marked "not published" is a limit you'll find by hitting it. Expect an HTTP 429 with no warning of the ceiling, so load-test a small batch first.

## Grok summary cutoff mid-contract

At 02:14 a nightly Grok job began cutting supplier-contract summaries short. The contract text, the running history and the summary all drew on one budget, and a workflow inherits the model's limits.

This is an illustrative case built from published limits, not a client's real log.

### Grok batch job setup and context use

To have summaries waiting each morning, a small operations team scheduled a batch for 23:00. It called Grok 4.7 through the API, and each call carried the full contract text plus the instructions and the conversation so far.

![Context window across current Grok API models](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/18568053-5518-47b4-b4d9-0b9000669bab/grok-context-window-limits-by-model-and-plan-202-4747969e.svg "Source: models.dev")

The team had read the headline context-window figure as the size of file the job could take, so nobody had tested a long contract against it.

### 02:14: the first failed call

For hours the job ran cleanly, because early contracts were short. Once a long one arrived, the history had grown and the input left little room for the reply. **The model ran out of space mid-summary** instead of refusing the file.

![A printed contract summary page whose last sentence stops mid-line at the bottom edge, beside a tall stack of contract…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/2fdac0d1-c4d4-40ca-a6f4-cfd9f3393fb5/grok-context-window-limits-by-model-and-plan-202-7b896606.webp)

| Time | What the job did | What the log showed | Who noticed |
|---|---|---|---|
| 23:00 | Job starts, works through contracts in order | Normal completions | Nobody, no one watching |
| 02:14 | Returns a summary that ends mid-sentence | A completed call, no error | Nobody; the truncation looked like success |
| 02:15 | Next call fails | The first error entry | Nobody; no alert was attached |
| 07:45 | Still failing or retrying | A run of errors after 02:15 | A team member opening the output folder |

### Truncated Grok summaries found in the log

In this illustrative case, the team would have gone through the log by 08:30 and found that every contract after 02:14 was either cut off or missing, roughly five hours of lost work.

**The cut-off summaries were the worse problem**: they read as finished documents, so someone could have acted on half a contract.

## Cost of truncated Grok summaries

Three things were lost, and all of them can be counted: records with no summary or a truncated one, hours of manual redo, and tokens billed for calls we threw away. It also pushed the renewal review past its date.

> The cut-off summaries were the worse problem: they read as finished documents, so someone could have acted on half a contract.

| Row | Count | Formula | Result |
|---|---|---|---|
| Records unsummarised | Records submitted minus records with any output | Submitted − returned | Records to rerun in full |
| Records cut short | Returned records whose finish reason says the length limit was hit | Count of truncated finishes | Records that look done but aren't, so they need review |
| Manual redo hours | Unsummarised plus cut short, times minutes per record | (Unsummarised + cut short) × minutes ÷ 60 | Staff hours lost |
| Tokens billed for discarded calls | Input and output tokens on every call whose result was thrown away | Sum across discarded calls | Spend with nothing to show |
| Cost at published price | Tokens billed for discarded calls | Tokens × published per-token price | The invoice line to explain |
| Slipped renewal review | Days between the planned review and the finished rerun | Rerun date − planned date | Days the decision was late |

Start with the truncated records, not the missing ones. A missing record is visible.

**A cut-short one passes a count check and fails only when someone reads it, so a "complete" batch can still hide the worst rows.** Filter on the finish reason before you trust any total.

Add both categories together to get redo time, but expect cut-short records to cost more per row. Time a small sample by hand and use that figure, not an estimate.

### Tokens billed for discarded work

Every failed or truncated call still consumed input tokens, and xAI billed the output it produced too.

Multiply the summed tokens by the published price to get the cost. That figure will be small next to the hours, which is why the review date, not the invoice, is the loss worth escalating.

## Sources consuming the context window

The contract was never the only thing in the window. The system prompt, the resent history, the model's reasoning tokens and the reply all drew on the same budget, so a file well under the headline number still overflowed.

### Input, history and output share one budget

The symptom: requests were truncated or rejected on files that looked small. Each call carries the instructions again, the conversation so far, the contract and room for the answer, as the bar below shows for one request.

Headline figures also move with the product. [OpenAI's ChatGPT pricing page](https://openai.com/chatgpt/pricing) lists Go and Plus at 54 – 256 K tokens and Pro at 128 – 400 K, depending on mode.

Plan and mode can change the usable window by a factor of about five, so a single quoted number isn't one you can plan a batch around.

### Context window versus rate limit

The context window caps one request. The rate limit, the small gauge beside the bar, caps how many tokens or requests you send per minute across all requests.

A job can fit the window on every call and still get refused, because a hundred correct requests in a minute exhaust the gauge.

The error is different too: an oversize request fails on its own size, while a rate-limit failure returns a 429 and clears if you wait.

Working from published limits, the team made three errors that more room wouldn't have cured:

1. They compared file length to the window and ignored the shared budget, so **the reply had no space left**.
2. They resent the full history on every call, so each request was larger than the last.
3. They never ran the batch at full size in a test environment, so the first real test was overnight.

Measure the full request, history and reply allowance included, before trusting any batch.

## Rules for guarding context windows

Every call gets the same checks, in the same order, because the overnight failure came from skipping the first one.

1. Count tokens for the whole request before each call.
2. Set a hard cap on input plus reply, and refuse to send anything over it.
3. Chunk the contract instead of sending it whole.
4. Trim history to what the next answer needs.
5. Use cached input or batch only where xAI's documentation covers your model.
6. Pick the model that fits the job.
7. Escalate tier last.

Each rule is explained below. I haven't tested any of them against your workload. Reproduce the failure in a small run first.

Count the system prompt, history, file text and reply allowance together. If the total passes your cap, the job stops and logs the overrun, and nothing's truncated silently.

Activepieces lets you build that check and the model call as one flow. The cap check is a fixed-rule step, the Grok call is an Agent step sitting beside it, and the run trace records a single execution from the check to the reply.

A refused contract and a truncated summary both land in that one record, rather than being split between a workflow tool and an agent framework joined by a callback. MoneyGram and Moneypenny run Activepieces in production.

### Chunk, trim and cache Grok context

Split a long document at natural boundaries such as clauses or sections, and send each integration with only the context it needs.

Trim history the same way: keep the last few exchanges and a short summary, and drop the rest.

Cached input and batch pricing may cut cost on repeated prefixes or non-urgent work. Confirm both on xAI's own pricing and docs pages for the exact model before you plan around them.

### When to change model or tier instead

If a chunked, trimmed request still fails the cap, **the work doesn't fit the model you chose**. Try another model before paying more: Grok 4.7 is xAI's flagship for code and chat, so check its limits against your task first.

A higher tier is the honest answer only when the request is already tight and you're being rate-limited, not when it's bloated.

## Activepieces workflow for Grok with retries and delays

Rebuilt in Activepieces, the job loops over the contracts, checks size before every call, spaces the calls out, retries on a 429, and pages a person after two failures. It handles rate limits. It doesn't widen the context window.

This order puts the size check ahead of the model call so that the overnight failure cannot recur unnoticed:

1. Trigger: a schedule starts the run overnight.
2. Loop over the contracts in the queue.
3. Token check: estimate input plus the room needed for output, and skip anything that won't fit.
4. Grok step, using the team's own xAI API key.
5. Delay before the next contract.
6. 429 retry path.
7. Alert after two failures.

Steps 3 and 6 are separate because they guard against different limits, and the sections below show why.

### Own API key, loop and delay

Store the xAI key as a connection in Activepieces, so usage lands on the team's own xAI account and shows in the console you already check.

The loop passes one contract per iteration. A contract that fails the token check goes to a "too large" list for chunking, and the run continues.

The delay is a plain pause after each call, which keeps requests from bunching into a burst. Reproduce this with a small test batch before trusting it overnight.

### Retry on 429 and alert on repeat failure

When a 429 comes back, it means too many requests in a period, so waiting and trying again is the right response. Route that error to a longer delay, then repeat the Grok call once.

If the second attempt also fails, send the alert with the contract name and the logged token counts, and stop that item.

Retrying can't rescue an oversized prompt, because the window is a size limit, not a pacing limit.

- Confirm the connection uses the team's own xAI key.
- Run a small test batch with one deliberately oversized contract.
- Check that the oversized one was skipped, not retried.
- Force a 429 and watch the retry path fire.
- Confirm the alert reaches a person.

## Frequently asked questions

Five questions stay open after the body, and the table below gives short answers to them, each with the xAI page to verify it against. Treat any answer marked "check" as something to reproduce in a test run before an overnight job depends on it.

| Question | Short answer | xAI page | Date checked |
|---|---|---|---|
| App and API share a window? | Not assumed; the API's window is set per model | Models page | 2026-12-05 |
| Memory beyond the window? | Memory features don't enlarge the window | Models page | 2026-12-05 |
| Reasoning tokens counted? | Check usage output; plan for them as output | API docs | 2026-12-05 |
| Counting before sending? | Use the usage fields and test with a sample | API docs | 2026-12-05 |
| Bigger window, higher price? | Check the model's pricing row | Models page | 2026-12-05 |

The failed batch started from exactly this kind of assumption, so each answer is expanded below.

### App versus API windows

Whether the Grok app has the same context window as the API is not something to assume.

The documented window belongs to the model as served through the API, so a prompt that worked when pasted into the app proves nothing about an automated call. Reproduce the job through the API with a realistic sample before trusting it.

### Memory and earlier chats

If you are wondering whether Grok remembers earlier chats beyond the context window, it does not in the sense that matters here. Any saved memory or chat history feature is a product behaviour, not extra window.

Whatever the model actually reads on a given turn still has to fit in the one budget, so a long history leaves less room for your file and the answer.

### Reasoning tokens and counting

Plan as though reasoning tokens count against the Grok context window. Reasoning is generated text, and it consumes output capacity and is reported in usage.

A job sized to the input alone can fail when the model spends its budget thinking, which is the shape of the overnight failure.

Before you send a prompt to Grok, run a small representative sample first and read the usage figures the API returns, then scale up with a margin. Counting only the file undercounts: history, instructions and the reply all draw on the same budget.

### Window size and price

You should expect a larger Grok context window to cost more per token, depending on the model. Read the pricing row for the model you're calling, and test a long request to see what it actually bills.

![OpenAI provider configuration showing selectable AI models with pricing and capabilities filtering](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/79f90e63-e9fa-44a2-ac86-8f8caec78b2e/how-much-does-xai-grok-api-cost-pricing-in-2026-42d8bbed.webp)

A bigger window isn't a free upgrade, and a full one is the slowest, costliest way to run a batch.

## Related reading

- [Claude Context Window: Size and Limits (2026 Guide)](https://www.activepieces.com/blog/claude-context-window-size-and-limits-2026-guide)
- [Gemini Context Window: Size, Limits and Cost (2026)](https://www.activepieces.com/blog/gemini-context-window-size-limits-and-cost-2026)
- [GLM 5.3 Prime: Pricing, Benchmarks & Context Window](https://www.activepieces.com/blog/glm-53-prime-pricing-benchmarks-context-window)

## References

- [models.dev](http://models.dev/providers/xai/)
- [OpenAI](https://openai.com/chatgpt/pricing)
- [AI Studio context windows](https://aistudio.quest/context-windows)
