> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/es/api/rate-limiting.md).

# Limitación de tasa

{% hint style="info" %}
La limitación de velocidad requiere una [licencia](https://store.devolutions.net/package#psu).
{% endhint %}

PowerShell Universal le permite limitar la velocidad de las solicitudes realizadas al servidor web. Puede configurar la limitación de velocidad por endpoint y por periodo. De forma predeterminada, la dirección IP del cliente limita la velocidad de los clientes.

Los datos de configuración de los límites de velocidad se almacenan en el fichero `ratelimits.ps1`.

## Configurar la limitación de velocidad

Para configurar la limitación de velocidad, visite la página APIs / Rate Limiting. Haga clic en el botón Add y defina una nueva regla de límite de velocidad.

{% hint style="warning" %}
La limitación de velocidad afecta a todas las URL del servidor. Si aplica una limitación de velocidad que no está correctamente configurada, puede afectar negativamente a la API de gestión.
{% endhint %}

### Método

El método es el método HTTP para esta regla. Si utiliza `*`, esta regla afecta a todos los métodos HTTP. También puede seleccionar un único método eligiéndolo en la lista desplegable.

### Endpoint

El endpoint es la URL a la que está aplicando la limitación de velocidad. Puede limitar la velocidad de todas las URL utilizando `*`. Puede definir URL específicas definiendo la ruta relativa: `/api/user`.

### Límite

Este es el número de solicitudes en el intervalo de tiempo antes de que se active la limitación de velocidad.

### Periodo

Este es el periodo durante el cual se cuenta el límite de velocidad. Por ejemplo, si selecciona un periodo de 10 minutos y un límite de 100, entonces se pueden realizar hasta 100 solicitudes al método y al endpoint que haya seleccionado.

## Listas de permitidos

Para desactivar la limitación de velocidad para determinadas direcciones IP, clientes y endpoints, añádalos a las listas de permitidos de la limitación de velocidad. Puede encontrarlas haciendo clic en el botón de configuración.

El ejemplo siguiente evita que se aplique limitación de velocidad al adaptador de bucle invertido.

```powershell
Set-PSUSetting -RateLimitIpAddressAllowList @("127.0.0.1")
```

## Ejemplo: limitar una API personalizada

Limita a los llamantes del endpoint `/api/users` a 100 solicitudes por minuto.

```powershell
New-PSURateLimit -Endpoint "GET|/api/users" -TimeSpan "00:01:00" -Limit 100
```

## Ejemplo: limitar la API de gestión

Limita a los llamantes de la API de gestión a 100 solicitudes por segundo.

```powershell
New-PSURateLimit -Endpoint "*|/api/v1/*" -TimeSpan "00:00:01" -Limit 100
```

## API

* [New-PSURateLimit](/powershell-universal/es/comandos-de-powershell/new-psuratelimit.md)
* [Set-PSUSetting](/powershell-universal/es/comandos-de-powershell/set-psusetting.md)


---

# 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.devolutions.net/powershell-universal/es/api/rate-limiting.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.
