AnthropicError.ts
AnthropicError.ts overview
Section titled “AnthropicError.ts overview”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
AnthropicRateLimitMetadatafor rate-limit responses that also include parsed Anthropic rate-limit headers
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”models
Section titled “models”AnthropicErrorMetadata (type alias)
Section titled “AnthropicErrorMetadata (type alias)”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
AnthropicRateLimitMetadatafor rate-limit responses that also include parsed Anthropic rate-limit headers
Signature
type AnthropicErrorMetadata = { /** * The Anthropic error type returned by the API. */ readonly errorType: string | null /** * The unique request ID for debugging with Anthropic support. */ readonly requestId: string | null}Since v4.0.0
AnthropicRateLimitMetadata (type alias)
Section titled “AnthropicRateLimitMetadata (type alias)”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 & { /** * Number of requests allowed in the current period. */ readonly requestsLimit: number | null /** * Number of requests remaining in the current period. */ readonly requestsRemaining: number | null /** * Time when the request rate limit resets. */ readonly requestsReset: string | null /** * Number of tokens allowed in the current period. */ readonly tokensLimit: number | null /** * Number of tokens remaining in the current period. */ readonly tokensRemaining: number | null /** * Time when the token rate limit resets. */ readonly tokensReset: string | null}Since v4.0.0