Skip to content

OpenAiError

OpenAI error metadata augmentation.

Provides OpenAI-specific metadata fields for AI error types through module augmentation, enabling typed access to OpenAI error details.

2 exports Added in v4.0.0 Source

Models

OpenAiErrorMetadata type

Added in v4.0.0 Source

OpenAI-specific error metadata fields.

Signature

type OpenAiErrorMetadata = {
  readonly errorCode: string | null;
  readonly errorType: string | null;
  readonly requestId: string | null;
};

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 & {
  readonly limit: string | null;
  readonly remaining: number | null;
  readonly resetRequests: string | null;
  readonly resetTokens: string | null;
};