effect-io-ai

Package: @effect/ai-openai-compat
Module: OpenAiError

OpenAiError.OpenAiRateLimitMetadata

OpenAI-specific rate limit metadata fields.

Details

Extends base error metadata with rate limit specific information from OpenAI’s rate limit headers.

Signature

type OpenAiRateLimitMetadata = OpenAiErrorMetadata & {
  /**
   * The rate limit type (e.g. "requests", "tokens").
   */
  readonly limit: string | null
  /**
   * Number of remaining requests in the current window.
   */
  readonly remaining: number | null
  /**
   * Time until the request rate limit resets.
   */
  readonly resetRequests: string | null
  /**
   * Time until the token rate limit resets.
   */
  readonly resetTokens: string | null
}

Source

Since v4.0.0