Skip to main content

QuotaDecision

@retinue/monorepo


@retinue/monorepo / backend/src / QuotaDecision

Type Alias: QuotaDecision

QuotaDecision = { admitted: true; usage: UsageTotals; warnings: readonly QuotaWarning[]; } | { admitted: false; dimension: QuotaDimension; limit: number; message: string; modelId?: string; retryAfter: string; used: number; }

Defined in: backend/src/usage/quota.ts:192

The admission answer.

A union, so "refused" has no allowed shape to hide in: a caller cannot read a refusal as a permissive default, which for a spend limit is the failure that costs money.

Union Members​

Type Literal​

{ admitted: true; usage: UsageTotals; warnings: readonly QuotaWarning[]; }


Type Literal​

{ admitted: false; dimension: QuotaDimension; limit: number; message: string; modelId?: string; retryAfter: string; used: number; }

admitted​

readonly admitted: false

dimension​

readonly dimension: QuotaDimension

limit​

readonly limit: number

message​

readonly message: string

modelId?​

readonly optional modelId?: string

Present when the limit that refused is scoped to one model — #182.

retryAfter​

readonly retryAfter: string

used​

readonly used: number