If the number of your requests exceeds the capacity allocated to process
requests, then error code `429` is returned. The following table displays the
error message generated by each type of quota framework:

| Quota framework | Message |
|---|---|
| Pay-as-you-go | `Resource exhausted, please try again later.` |
| Provisioned Throughput | `Too many requests. Exceeded the Provisioned Throughput.` |

With a Provisioned Throughput subscription, you can reserve an
amount of throughput for specific generative AI models. If you don't have a
Provisioned Throughput subscription and resources aren't available
to your application, then an error code `429` is returned. Although you don't
have reserved capacity, you can try your request again. However, the request
isn't counted against your error rate as described in your [service level
agreement (SLA)](https://cloud.google.com/vertex-ai/generative-ai/sla).

For projects that have purchased Provisioned Throughput,
Gemini Enterprise Agent Platform measures a project's throughput and reserves the purchased
amount of throughput for the project's actual usage.

For standard Provisioned Throughput, when you use less than your
purchased amount, errors that might otherwise be `429` are returned as `5XX` and
count toward the SLA error rate. For Single Zone Provisioned Throughput,
when you use less than your purchased amount, capacity-related `429` errors are
treated as `5XX` but don't count toward the SLA error rate. When you exceed your
purchased amount, the additional requests are processed on-demand as pay-as-you-go.

## Pay-as-you-go

On the pay-as-you-go quota framework, you have the following options for
resolving `429` errors:

- Use the [global endpoint](https://docs.cloud.google.com/gemini-enterprise-agent-platform/resources/locations.md.txt#global-endpoint) instead of a regional endpoint whenever possible.
- Implement a [retry strategy](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/retry-strategy.md.txt) by using truncated exponential backoff.
- If your model uses quotas, you can submit a Quota Increase Request (QIR). If your model uses [Standard pay-as-you-go](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/standard-paygo.md.txt), smoothing traffic and reducing large spikes can help.
- You may encounter `429` errors because of acceleration limits if your project has a sharp increase in usage. To avoid hitting acceleration limits, ramp up your traffic gradually and maintain consistent usage patterns.
- Subscribe to Provisioned Throughput for a more consistent level of service. For more information, see [Provisioned Throughput](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/provisioned-throughput.md.txt).
- To see which seconds and which models received `429` errors, turn on [inference request metadata logs](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/inference-metadata-logging.md.txt) and run the [error rate query](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/inference-metadata-logging.md.txt#query-errors).

## Provisioned Throughput

To correct the 429 error generated by Provisioned Throughput, do the
following:

- Use the [Default behavior
  example](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/provisioned-throughput#default), which doesn't set a header in prediction requests. Any overages are processed on-demand and billed as pay-as-you-go.
- Increase the number of GSUs in your Provisioned Throughput subscription.
- To see which seconds and which models received `429` errors, turn on [inference request metadata logs](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/inference-metadata-logging.md.txt) and run the [error rate query](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/inference-metadata-logging.md.txt#query-errors). To see which requests spilled over, run the [spillover by minute query](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/inference-metadata-logging.md.txt#query-spillover).

## What's next

- To learn more about Standard pay-as-you-go, see [Standard pay-as-you-go](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/standard-paygo.md.txt).
- To learn more about Provisioned Throughput, see [Provisioned Throughput](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/provisioned-throughput.md.txt).
- To learn about quotas and limits for generative AI on Agent Platform, see [Quotas and system limits](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/quotas.md.txt).
- To learn more about Google Cloud quotas and system limits, see the [Cloud Quotas documentation](https://docs.cloud.google.com/docs/quotas/overview.md.txt).