Skip to content

OpenAiError.ts

OpenAI-specific error metadata fields.

Since v4.0.0



OpenAI-specific error metadata fields.

Signature

type OpenAiErrorMetadata = {
/**
* The OpenAI error code returned by the API.
*/
readonly errorCode: string | null
/**
* The OpenAI error type returned by the API.
*/
readonly errorType: string | null
/**
* The unique request ID for debugging with OpenAI support.
*/
readonly requestId: string | null
}

Source

Since v4.0.0

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