“Gemini token limit” does not refer to one universal number. For a production request, identify the product and model, then distinguish request/context capacity from a response that reaches its output cap or an API rate limit. For example, Google documents a 1,048,576-token shared input-and-output context window for the Gemini API model gemini-4-argon; that figure does not apply to every Gemini model or product. (Gemini 4 Argon model documentation)
What does “Gemini token limit” mean?
A token is a unit the model processes. A context window is the token capacity available to a model for a request and response. An API request can also be limited by rate or throughput—how much you can send over time—even if each individual request fits the model’s context window. Gemini API rate limits include requests per minute (RPM), input tokens per minute (TPM), and requests per day (RPD), and are applied per project. (Gemini API token guide; rate limits)
| Possible limit | What to check | First step |
|---|---|---|
| Request/context capacity | The exact model’s context limit and the full request’s token count | Count the input for that model; reduce or split it if it exceeds the applicable capacity. |
| Response capacity | The response’s completion reason, output setting, and model’s output limit | If generation stopped at the token cap, adjust the output allowance within the model’s documented limits—or request a shorter, split response. |
| API rate or throughput | The error and your project’s active RPM, TPM, or RPD limits | Check the project’s limits. For an error documented as retryable, use exponential backoff rather than immediately resending repeatedly. |
This is a diagnostic starting point, not a claim that every error uniquely identifies its cause. Check the product documentation and full error details before changing production behavior.
Which token limit applies to a Gemini API model?
The limit depends on the specific model and product. As one documented Gemini API example, gemini-4-argon has a 1,048,576-token unified context limit. Its maximum output is 65,536 tokens for synchronous generation by default, or up to 1,048,576 tokens with long decode. For Argon, input, thinking, and output share the context window, so all three must fit within it. (Gemini 4 Argon model documentation)
Worked example: If an Argon request has 900,000 input tokens, 148,576 tokens remain in the shared context window. That does not guarantee a response of that length: the default synchronous output cap is lower, and thinking tokens also use the shared window. Check the model’s limits and the output setting in your request. (Gemini 4 Argon model documentation)
Google’s long-context documentation says that if the requested output allowance plus input exceeds Argon’s shared context, the API caps the output allowance to the space remaining after input. Do not assume this behavior or Argon’s limits apply to another model or product; check that model’s own documentation. (Gemini API long-context guide)
This numerical example is for the Gemini API only. Google describes Gemini Enterprise Agent Platform as an evolution of Vertex AI, and its catalog lists token limits for models available on that platform. That supports using the catalog for a model served through Agent Platform; it does not establish that its route applies to every existing Vertex AI deployment or endpoint. For an existing deployment, confirm the applicable Vertex AI documentation for its deployed model and endpoint before relying on a catalog figure. (Agent Platform overview; Google models catalog)
How to troubleshoot a Gemini token-limit problem
- Identify the product. Is the request running in the Gemini app, Gemini API, or Vertex AI? An app allowance is not a production API model’s context limit.
- Record the exact model ID and version. Find it in your request or deployment configuration, then look up that model—not just “Gemini.” For Gemini API, use Google’s model metadata reference to check the named API model. For a model served through Gemini Enterprise Agent Platform, the Google models catalog provides model pages and token-limit entries. Google describes Agent Platform as an evolution of Vertex AI, but this catalog route is not established here for every existing Vertex AI deployment; check the documentation applicable to your deployed model and endpoint.
- Check the input size. For the Gemini API,
count_tokenscounts input tokens only. The API token guide also describes response usage metadata for input, output, thinking, and total tokens. Multimodal input is tokenized too, so a text-only estimate may not reflect the full request. (Gemini API token guide) - If a response stops early, inspect its completion reason. In a Gemini API
generateContentresponse, check the candidate’sfinishReason.MAX_TOKENSindicates generation stopped at the token ceiling; it can return truncated or empty output. Also check the response’s usage information and themaxOutputTokenssetting (calledmax_output_tokensin some documentation and SDK examples). If that setting is below the model’s supported maximum, raise it only as far as the model permits and, for a shared-context model such as Argon, the remaining context allows. Otherwise ask for a shorter response or split the requested output into smaller parts. (Gemini API generation guide) - If the input is too large, reduce or divide it deliberately. Remove irrelevant material, shorten repeated instructions, or split a long document into sections. When related files are split across requests, carry forward the facts or summaries needed to connect them. Recount each revised input before sending it. (Gemini API token guide)
- If the request returns an API error, diagnose it separately from a truncated response. Check the status and error details against the API’s error guidance. Google recommends exponential backoff for errors identified as retryable, such as
429 RESOURCE_EXHAUSTEDor503 UNAVAILABLE; it advises against retrying client errors such as 400, 402, or 403 as if they were transient. A 429 is not, by itself, proof that the prompt exceeded the model’s context window. (Gemini API troubleshooting guide)
Gemini app, Gemini API, and Vertex AI: don’t mix their limits
The Gemini app, Gemini API, and Vertex AI are different product surfaces. An in-app usage allowance is not the same as an API model’s context or output limit. For production, check the documentation and quotas for the service your application actually calls. The Argon figures above are specifically for the Gemini API. Google describes Gemini Enterprise Agent Platform as an evolution of Vertex AI, and its model catalog documents limits for models available through Agent Platform; however, this article has not established that catalog route for every existing Vertex AI deployment or endpoint. (Agent Platform overview; Google models catalog)
Bottom line: First determine whether the problem is request/context capacity, an output that reached its token cap, or API throughput. Then check the exact model’s documentation, measure input using the matching product’s documented method, and apply the remedy for that failure. There is no single Gemini token-limit number that applies to every app, API, and Vertex AI case.
Sources
Understand and count tokens — Gemini API
Troubleshooting guide — Gemini API
Generate content: thinking — Gemini API
