Home / Class/ APIStatusError Class — anthropic-sdk-python Architecture

APIStatusError Class — anthropic-sdk-python Architecture

Architecture documentation for the APIStatusError class in _exceptions.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  f2b4a800_fc6e_a4b1_452a_a707d6a71c8c["APIStatusError"]
  8072012e_af1e_a492_c4c9_62780dfef308["APIError"]
  f2b4a800_fc6e_a4b1_452a_a707d6a71c8c -->|extends| 8072012e_af1e_a492_c4c9_62780dfef308
  b3e43638_c882_dccb_b00e_ddc6b5147130["_exceptions.py"]
  f2b4a800_fc6e_a4b1_452a_a707d6a71c8c -->|defined in| b3e43638_c882_dccb_b00e_ddc6b5147130
  66539421_8a82_cea4_464a_a6e3fd6922e0["__init__()"]
  f2b4a800_fc6e_a4b1_452a_a707d6a71c8c -->|method| 66539421_8a82_cea4_464a_a6e3fd6922e0

Relationship Graph

Source Code

src/anthropic/_exceptions.py lines 57–68

class APIStatusError(APIError):
    """Raised when an API response has a status code of 4xx or 5xx."""

    response: httpx.Response
    status_code: int
    request_id: str | None

    def __init__(self, message: str, *, response: httpx.Response, body: object | None) -> None:
        super().__init__(message, response.request, body=body)
        self.response = response
        self.status_code = response.status_code
        self.request_id = response.headers.get("request-id")

Extends

Frequently Asked Questions

What is the APIStatusError class?
APIStatusError is a class in the anthropic-sdk-python codebase, defined in src/anthropic/_exceptions.py.
Where is APIStatusError defined?
APIStatusError is defined in src/anthropic/_exceptions.py at line 57.
What does APIStatusError extend?
APIStatusError extends APIError.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free