Skip to content

AuthenticationError

Invalid or missing API key. Not retryable.

new AuthenticationError(provider, cause?): AuthenticationError

string

Error

AuthenticationError

ModelError.constructor

readonly optional cause?: Error

Original error that caused this one, if any.

ModelError.cause


code: string

Machine-readable error code (e.g., “ABORT”, “RATE_LIMIT”, “TOOL_DENIED”).

ModelError.code


readonly provider: string

Provider name (e.g., “anthropic”, “openai”).

ModelError.provider


readonly retryable: boolean

Whether this error can be retried by retry middleware.

ModelError.retryable


readonly optional statusCode?: number

HTTP status code from the provider API, if available.

ModelError.statusCode