> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos/rate-limits.md).

# Rate Limits

The <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> offers scalable access to inference features like Chat Completions, Image Generation, and Embeddings through an OpenAI-compatible API. The API enforces rate limits on all incoming requests to ensure performance, fairness, and availability.

This article is intended to help both developers and technical decision-makers understand

* The benefits of rate limits for <code class="expression">space.vars.ionos\_cloud</code> and its customers,
* The types and values of rate limits applied,
* What happens when limits are exceeded?
* And how to track them effectively.

## Benefits of Rate Limits

Rate limits protect system integrity and ensure a reliable experience for all users by:

* **Preventing resource monopolization**: Limits prevent users or applications from consuming disproportionate resources.
* **Mitigating misuse and abuse**: They deter malicious activities such as scraping, brute-force attacks, or spamming.
* **Stabilizing performance under load**: During traffic spikes, limits help maintain responsiveness and availability.
* **Supporting long-term scalability**: Predictable request patterns enable better infrastructure planning and resource allocation.

## IONOS CLOUD AI Model Hub Rate Limits

The <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> enforces different rate limits:

| Endpoint/Scope    | Base Limit        | Burst Limit        | Notes                                     |
| ----------------- | ----------------- | ------------------ | ----------------------------------------- |
| General API Usage | 5 requests/second | 10 requests/second | Applies across all endpoints per contract |
| Image Generation  | 10 images/minute  | 20 images/minute   | Additional limit specifically for images  |

### Scopes Explained

* **General API Usage**: Applies to all requests across Chat Completions, Image Generation, Embeddings, and Predictions.
* **Image Generation**: Due to higher compute demands, image endpoints have a stricter, more conservative rate limit.

{% hint style="info" %}
**Contract-based enforcement:** Rate limits are enforced per <code class="expression">space.vars.ionos\_cloud</code> contract, not per user or endpoint. All activity under the same contract counts toward shared quotas.
{% endhint %}

### Understanding the Two-Tiered Rate Limit Model

<code class="expression">space.vars.ionos\_cloud</code> applies a two-tiered rate-limiting system consisting of a **base limit** and a **burst limit**.

* **Base limit**: The sustained request rate you are allowed to maintain over time. Staying within this rate ensures uninterrupted access.
* **Burst limit**: The maximum number of requests allowed within a 2-second window, accommodating sudden traffic spikes that exceed the sustained rate. Example: 20 requests in a 2-second burst.

**How it works:**

* The base limit of 5 requests/second is continuously replenished.
* You can temporarily exceed this rate by making up to 10 requests in a 2-second window, using the burst allowance.
* After using a full burst (e.g., 10 requests at once), you must wait for the base tokens to replenish at 5 requests per second, so it takes 2 seconds to regain the full burst capacity.
* The **X-RateLimit-Remaining-Requests** header shows how many requests are still available in the current window. For more information, see [<mark style="color:blue;">IONOS CLOUD AI Model Hub rate limits</mark>](#ionos-cloud-ai-model-hub-rate-limits).

This tiered model balances flexibility and fairness by allowing short bursts without compromising system stability.

## Hitting Rate Limits

When rate limits are exceeded, the API returns an `HTTP 429 Too Many Requests` response.

Additionally, every API response includes headers that provide real-time information about your current rate limit usage:

| Header                           | Description                                                                                               |
| -------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `X-RateLimit-Limit-Requests`     | The maximum number of requests allowed in the current window. The actual value depends on your contract.  |
| `X-RateLimit-Remaining-Requests` | The number of requests remaining in the current window. This value resets when the window expires.        |
| `Retry-After`                    | The number of seconds to wait before retrying. This header appears on `529` responses only, not on `429`. |
| `X-Request-Id`                   | Identifier for this request, mirroring `X-Trace-ID`. Include it when reporting a problem to support.      |
| `X-Gateway-Version`              | The build version of the API that served the response.                                                    |

{% hint style="info" %}
**Note:** The rate limit headers appear only on responses that were counted against a limit. A request rejected as malformed does not carry them.
{% endhint %}

Example response headers:

```bash
X-RateLimit-Limit-Requests: 300
X-RateLimit-Remaining-Requests: 299
X-Gateway-Version: 1.4.0
```

By monitoring these headers, clients can adjust their request rates dynamically and avoid unintentionally breaching limits.

## Service Protection During High Demand (HTTP 529)

To protect system integrity when overall demand for a model is exceptionally high across all customers, the <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> can temporarily shed load on the platform side. In this case, the API returns an `HTTP 529 Site is Overloaded` response instead of processing the request.

Unlike a `429` response, a `529` response does not mean your contract has exceeded its quota or that your requests alone caused the overload. It means the platform is protecting overall service stability for all customers. Retry the request after the indicated delay.

Every `529` response includes a `Retry-After` header and an error body in the OpenAI-compatible error format:

```json
{
  "error": {
    "type": "server_overloaded",
    "code": "server_overloaded",
    "message": "The service is temporarily overloaded. Please try again shortly."
  }
}
```

| `error.type` / `error.code` | Meaning                                                                                                                         |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `user_overloaded`           | Your traffic pattern is contributing to the overload; reduce your request rate in addition to retrying.                         |
| `server_overloaded`         | The platform is out of capacity for the requested model, independent of your traffic; retrying later is the only action needed. |

Use `error.code` to decide how to react: back off for `user_overloaded`, or back off and consider failing over to a different model for `server_overloaded`.

{% hint style="info" %}
**Note:** The `message` field is intentionally generic and doesn't include timing information; always rely on the `Retry-After` header to know how long to wait.
{% endhint %}

## Mitigation Strategies and Best Practices

To avoid hitting rate limits and ensure smoother operation of your applications, consider the following mitigation strategies and best practices:

**1. Monitor quota in real time**

* Use rate limit headers to track your remaining quota.
* Distribute requests evenly rather than sending them all at once.

**2. Implement client-side throttling**

* Limit outgoing requests based on rate thresholds.
* Use algorithms like token bucket or leaky bucket to space out requests.

**3. Back off after a `429` or `529`**

* A `529` response carries a `Retry-After` header. Wait the number of seconds it gives before resubmitting, rather than a delay of your own choosing, so that clients do not all retry at the same moment.
* A `429` response carries no `Retry-After`. Use an exponential backoff strategy, increasing the delay after each rejection, and use `X-RateLimit-Remaining-Requests` on successful responses to slow down before you reach the limit.
* A `529` is a platform-side signal rather than a quota issue. Reducing your request rate does not clear it, so retry only after the indicated delay.

**4. Build in resilience**

* Log failed and retried requests to detect rate-limit issues and system bottlenecks.
* Ensure your system can gracefully handle rate-limiting responses and temporary interruptions.

**5. Perform load testing**

* Simulate production traffic to identify potential rate-limit issues.
* Validate throttling and retry logic under high load conditions.

## Summary

Rate limits are essential for maintaining the reliability and scalability of your AI-powered applications. By understanding how the <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> enforces these limits, you can optimize usage, plan for peak loads, and build resilient integrations.

For more, explore the official API documentation or consider integrating real-time quota monitoring into your observability stack.

* [<mark style="color:blue;">AI Model Hub API Documentation</mark>](https://api.ionos.com/docs/inference-modelhub/v1/)
* [<mark style="color:blue;">AI Model Hub OpenAI-comp. API Documentation</mark>](https://api.ionos.com/docs/inference-openai/v1/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos/rate-limits.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
