close() — anthropic-sdk-python Function Reference
Architecture documentation for the close() function in _base_client.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 68646c0e_7a37_2971_5977_d7bb4119303e["close()"] 4b46ed95_ff71_ea5d_7534_6929dc929bdb["SyncAPIClient"] 68646c0e_7a37_2971_5977_d7bb4119303e -->|defined in| 4b46ed95_ff71_ea5d_7534_6929dc929bdb 1127f58a_e7fd_1e8a_59e4_cf1d6031ac4c["__exit__()"] 1127f58a_e7fd_1e8a_59e4_cf1d6031ac4c -->|calls| 68646c0e_7a37_2971_5977_d7bb4119303e 0e13a01b_fec2_4139_7de2_ed2a384e3e75["close()"] 0e13a01b_fec2_4139_7de2_ed2a384e3e75 -->|calls| 68646c0e_7a37_2971_5977_d7bb4119303e 0e13a01b_fec2_4139_7de2_ed2a384e3e75["close()"] 68646c0e_7a37_2971_5977_d7bb4119303e -->|calls| 0e13a01b_fec2_4139_7de2_ed2a384e3e75 style 68646c0e_7a37_2971_5977_d7bb4119303e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/_base_client.py lines 963–971
def close(self) -> None:
"""Close the underlying HTTPX client.
The client will *not* be usable after this.
"""
# If an error is thrown while constructing a client, self._client
# may not be present
if hasattr(self, "_client"):
self._client.close()
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does close() do?
close() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_base_client.py.
Where is close() defined?
close() is defined in src/anthropic/_base_client.py at line 963.
What does close() call?
close() calls 1 function(s): close.
What calls close()?
close() is called by 2 function(s): __exit__, close.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free