Skip to content

AgentPrismRateLimitOptions

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Rate-limit settings applied to AgentPrism endpoints.

public sealed class AgentPrismRateLimitOptions

objectAgentPrismRateLimitOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Read from the AgentPrism:RateLimit configuration section.

Off by default. It has no way of knowing a library consumer’s traffic; a default that comes on would silently answer an upgrading setup’s live traffic with 429. Recommended values are documented in the README.

Rate limiting is not a quota: it smooths out sudden load at the second/minute scale and lives in memory. Total-consumption limiting at the day/month scale is done with AgentPrismQuotaOptions and counted in the database.

public AgentPrismRateLimitOptions()

The configuration section name.

public const string SectionName = "AgentPrism:RateLimit"

string

Whether rate limiting is enabled. Default false.

public bool Enabled { get; set; }

bool

Which key the limit is partitioned by. Default is per tenant.

public RateLimitPartitionKind Partition { get; set; }

RateLimitPartitionKind

The number of requests allowed within a window.

public int PermitLimit { get; set; }

int

The number of requests to queue once the limit is exceeded. If 0, a request gets 429 immediately.

public int QueueLimit { get; set; }

int

The length of the window.

public TimeSpan Window { get; set; }

TimeSpan