Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

OpenAiError unstable

OpenAI error metadata augmentation.

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

3 exports Since v4.0.0 Source

Models

Since v4.0.5

OpenAI-specific content policy metadata fields.

Details

Extends base error metadata with the names of decisions that OpenAI refused to answer.

Signature

type OpenAiContentPolicyMetadata = OpenAiErrorMetadata & {
readonly refusedDecisions?: Array<string>;
}

OpenAiErrorMetadata

type unstable
Since v4.0.0

OpenAI-specific error metadata fields.

Signature

type OpenAiErrorMetadata = {
readonly errorCode: string | null;
readonly errorType: string | null;
readonly requestId: string | null;
}
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 & {
readonly limit: string | null;
readonly remaining: number | null;
readonly resetRequests: string | null;
readonly resetTokens: string | null;
}