# Rate Limiting

Rate limiting in digiRunner controls the number of API requests allowed within a specific time frame, ensuring system stability and preventing abuse. The rate limiting configuration can be applied to individual clients or groups based on their API access levels.

In digiRunner, rate limiting is implemented through adjustments to the **API Quota** and **TPS/Node** settings.

## Configuring Rate Limiting

### Access API Client Management

Go to **Client Management** > **API Client** to manage clients subject to rate limits. You can either create a new client or update an existing one.

### Create Client

Click **Create** to access the client creation page.

<div align="left"><figure><img src="/files/cn6YgU5rKWR6zJGCAU4z" alt=""><figcaption></figcaption></figure></div>

For more information about client creation, please refer to[ API Client](/guide/client-management/api-client.md).

### Update Client

Search for the client to modify, and click on the ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeZycHkdRryqca_lkujtBDVseqKHwx8DBbx_9u4ntCk7vtxwXiRM4r_FLL3DEpjtXI-_qSSlICfPnjqq_KV05gehAQ1QLbhvBSTGG5GNtPwSf56C691e6JyyYur6ONjsCTyaWu4zozGZUGX6BcT5wh0p5VKqN-FzdPOifVNpRRnq9jj6KlgDw?key=Htu5XB0igYspg1DPgDLD5A) icon to access the update page.

<figure><img src="/files/zcUSv3LOj886WScaFEIJ" alt=""><figcaption></figcaption></figure>

### Set Limits

When creating or updating an API client, configure the **API Quota** and **TPS/Node** (Transactions per second) settings.

* **API Quota:** Specifies the total number of API calls the client can make without restriction. If the same API was pressed repeatedly 10 times, it also counts as 10 times.

{% hint style="warning" %}
If set to 0, it means there are no limits.
{% endhint %}

* **TPS/Node (Default 10):** Specifies the number of times this client can call the API per second. The default for this field is 10, meaning that the API will be called 10 times per second.\
  For example, if both the **TPS/Node** and **API Quota** are set to 10, the user can make 10 API calls per second. However, once the user reaches a total of 10 calls for the day, further API access will be denied.

{% hint style="warning" %}
If set to 0, it means there are no limits.
{% endhint %}

<div align="left"><figure><img src="/files/ZiypowuvFx983JLbSxwN" alt=""><figcaption></figcaption></figure></div>

## Testing Rate Limiting

### Create an API Group and Add Clients

1. Go to **Client Management** > **API Group**.&#x20;
2. Create a new group for clients to which you want to apply rate limiting.
3. Add the desired API to this group, which will apply the rate limiting rules.
4. Assign the clients to the group so that they inherit the rate limiting settings for this API.

For more information, please refer to [API Group](/guide/client-management/api-group.md).

### Run API Test

1. Go to **API Management** > **API Test** to test the API with the rate-limited group.
2. Send requests to the API via the **API Test** feature to verify that rate limiting is enforced.

For more information, please refer to [API Test](/guide/api-management/api-test.md).

### Monitor Responses

Observe API responses; if the rate limit is exceeded, the server will return an HTTP **429 (Too Many Requests)** error.


---

# Agent Instructions: 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:

```
GET https://docs.tpi.dev/get-started/rate-limiting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
