class

Anthropic::APIError

Inherits Exception < Reference < Object

Base error class for all Anthropic API errors

error_type reflects the error.type field from the API's error payload (e.g., "invalid_request_error", "rate_limit_error", "overloaded_error", "billing_error"). It is populated whenever the response body parses as JSON and carries a nested error.type.

Constructors

new(message : String, status : Int32 | Nil = nil, body : String | Nil = nil, headers : HTTP::Headers | Nil = nil, error_type : String | Nil = nil, cause : Exception | Nil = nil)
Source

Instance methods

body
Source
error_type
Source
headers
Source
status
Source