_prepare_request() — anthropic-sdk-python Function Reference
Architecture documentation for the _prepare_request() function in _client.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 562c226e_d12f_aba5_59c1_72cf16b01d1f["_prepare_request()"] a885dabd_0206_9ba5_949f_5990703d0a04["AsyncAnthropicVertex"] 562c226e_d12f_aba5_59c1_72cf16b01d1f -->|defined in| a885dabd_0206_9ba5_949f_5990703d0a04 48e11fa3_882f_25cd_4edd_3ada19d59664["_prepare_request()"] 48e11fa3_882f_25cd_4edd_3ada19d59664 -->|calls| 562c226e_d12f_aba5_59c1_72cf16b01d1f d2aca394_7ad5_92b5_38ec_6c25f071ab97["_ensure_access_token()"] 562c226e_d12f_aba5_59c1_72cf16b01d1f -->|calls| d2aca394_7ad5_92b5_38ec_6c25f071ab97 48e11fa3_882f_25cd_4edd_3ada19d59664["_prepare_request()"] 562c226e_d12f_aba5_59c1_72cf16b01d1f -->|calls| 48e11fa3_882f_25cd_4edd_3ada19d59664 26ddfdd3_edf1_2adc_5603_1eed5c624138["_ensure_access_token()"] 562c226e_d12f_aba5_59c1_72cf16b01d1f -->|calls| 26ddfdd3_edf1_2adc_5603_1eed5c624138 style 562c226e_d12f_aba5_59c1_72cf16b01d1f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/vertex/_client.py lines 296–301
async def _prepare_request(self, request: httpx.Request) -> None:
if request.headers.get("Authorization"):
# already authenticated, nothing for us to do
return
request.headers["Authorization"] = f"Bearer {await self._ensure_access_token()}"
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does _prepare_request() do?
_prepare_request() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/vertex/_client.py.
Where is _prepare_request() defined?
_prepare_request() is defined in src/anthropic/lib/vertex/_client.py at line 296.
What does _prepare_request() call?
_prepare_request() calls 3 function(s): _ensure_access_token, _ensure_access_token, _prepare_request.
What calls _prepare_request()?
_prepare_request() is called by 1 function(s): _prepare_request.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free