Skip to content

AnthropicError

Anthropic error metadata augmentation.

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

2 exports Added in v4.0.0 Source

Models

Anthropic-specific error metadata fields.

Details

Contains the Anthropic error type and request identifier copied from provider error responses when available. Either field may be null when Anthropic does not include it or the response cannot be decoded.

See

Signature

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

Anthropic-specific rate limit metadata fields.

Details

Extends base error metadata with rate limit-specific information from Anthropic's rate limit headers.

Signature

type AnthropicRateLimitMetadata = AnthropicErrorMetadata & {
  readonly requestsLimit: number | null;
  readonly requestsRemaining: number | null;
  readonly requestsReset: string | null;
  readonly tokensLimit: number | null;
  readonly tokensRemaining: number | null;
  readonly tokensReset: string | null;
};