SyncClient — anthropic-sdk-python Architecture
Implementation of the blocking Anthropic client using HTTPX.
Entity Profile
Dependency Diagram
graph TD subdomain_AnthropicClient_SyncClient["SyncClient"] f149cd45_fc79_6848_c11d_fb6c6c87a64a["_types.py"] subdomain_AnthropicClient_SyncClient --> f149cd45_fc79_6848_c11d_fb6c6c87a64a 6dd4ce6f_8db3_efaf_b5af_af83dc189691["foundry.py"] subdomain_AnthropicClient_SyncClient --> 6dd4ce6f_8db3_efaf_b5af_af83dc189691 1b8d6d03_dbf8_7993_64e0_2d6465f0f594["_qs.py"] subdomain_AnthropicClient_SyncClient --> 1b8d6d03_dbf8_7993_64e0_2d6465f0f594 ef392463_3286_0c12_f6d4_4bd3f21a9a3e["_resource.py"] subdomain_AnthropicClient_SyncClient --> ef392463_3286_0c12_f6d4_4bd3f21a9a3e eefce75c_4e32_6afb_2dcc_5a91b820bdec["beta.py"] subdomain_AnthropicClient_SyncClient --> eefce75c_4e32_6afb_2dcc_5a91b820bdec 21bc92b5_1a3b_b0f4_9692_03f55dd3f883["_resources_proxy.py"] subdomain_AnthropicClient_SyncClient --> 21bc92b5_1a3b_b0f4_9692_03f55dd3f883 5f5faee1_5e95_f701_9917_b4f546bd7134["_streams.py"] subdomain_AnthropicClient_SyncClient --> 5f5faee1_5e95_f701_9917_b4f546bd7134 8970d3f3_0f4a_bb4f_d2e7_1779d721da0a["parsed_beta_message.py"] subdomain_AnthropicClient_SyncClient --> 8970d3f3_0f4a_bb4f_d2e7_1779d721da0a ac6ea9a3_58f1_5f0c_52b0_65f07b1c8766["_json.py"] subdomain_AnthropicClient_SyncClient --> ac6ea9a3_58f1_5f0c_52b0_65f07b1c8766 ffc958ef_c0b6_2ec6_4f02_315febddedc7["test_client.py"] subdomain_AnthropicClient_SyncClient --> ffc958ef_c0b6_2ec6_4f02_315febddedc7 9fb932a1_93df_0335_eee0_945a67108504["completions.py"] subdomain_AnthropicClient_SyncClient --> 9fb932a1_93df_0335_eee0_945a67108504 b816976e_26cb_0c66_3616_ca36993ea7c2["_files.py"] subdomain_AnthropicClient_SyncClient --> b816976e_26cb_0c66_3616_ca36993ea7c2 c93149f4_1fef_7df2_3583_785d1eb6e828["_utils.py"] subdomain_AnthropicClient_SyncClient --> c93149f4_1fef_7df2_3583_785d1eb6e828 c3e95a38_e848_a7f2_e310_17ffa329bbe9["__init__.py"] subdomain_AnthropicClient_SyncClient --> c3e95a38_e848_a7f2_e310_17ffa329bbe9 style subdomain_AnthropicClient_SyncClient fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Domain
Functions
- Base64FileInput()
- DefaultAsyncHttpxClient()
- DefaultHttpxClient()
- GenericModel()
- GenericModel()
- NoneType()
- PYDANTIC_V1()
- RootModel()
- SequenceNotStr()
- _DefaultAioHttpClient()
- _TYPE_ALIAS_TYPES()
- __aenter__()
- __aenter__()
- __aenter__()
- __aexit__()
- __aexit__()
- __aexit__()
- __aiter__()
- __aiter__()
- __aiter__()
- __anext__()
- __as_proxied__()
- __await__()
- __bool__()
- __bool__()
- __bool__()
- __class__()
- __contains__()
- __del__()
- __del__()
- __dir__()
- __enter__()
- __enter__()
- __enter__()
- __exit__()
- __exit__()
- __exit__()
- __get__()
- __get_proxied__()
- __getattr__()
- __getitem__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __init__()
- __instancecheck__()
- __instancecheck__()
- __iter__()
- __iter__()
- __iter__()
- __len__()
- __load__()
- __load__()
- __name()
- __next__()
- __repr__()
- __repr__()
- __repr__()
- __repr__()
- __repr__()
- __repr__()
- __repr__()
- __reversed__()
- __set__()
- __set_name__()
- __str__()
- __str__()
- __str__()
- __str__()
- __stream__()
- __stream__()
- _aiter_chunks()
- _api_key_auth()
- _api_key_auth()
- _async_collect_files()
- _async_format_data()
- _async_transform_file()
- _async_transform_recursive()
- _async_transform_typeddict()
- _basic_config()
- _bearer_auth()
- _bearer_auth()
- _build_discriminated_union_meta()
- _build_headers()
- _build_request()
- _calculate_nonstreaming_timeout()
- _calculate_retry_timeout()
- _client()
- _client()
- _collect_files()
- _construct_field()
- _enforce_trailing_slash()
- _extract_field_schema_pv2()
- _extract_items()
- _format_data()
- _from_unix_seconds()
- _get_annotated_type()
- _get_azure_ad_token()
- _get_azure_ad_token()
- _get_extra_fields_type()
- _get_numeric()
- _get_open_connections()
- _get_page()
- _get_page_items()
- _get_page_items()
- _get_page_items()
- _get_page_items()
- _get_page_items()
- _get_page_items()
- _get_page_items()
- _get_params()
- _idempotency_key()
- _info_to_options()
- _iter_chunks()
- _iter_events()
- _iter_events()
- _low_retry_timeout()
- _make_sse_decoder()
- _make_status_error()
- _make_status_error()
- _make_status_error()
- _make_status_error_from_response()
- _make_sync_iterator()
- _maybe_override_cast_to()
- _maybe_transform_key()
- _merge_mappings()
- _merge_output_configs()
- _models()
- _models()
- _models()
- _no_transform_needed()
- _params_from_url()
- _parse()
- _parse()
- _parse_retry_after_header()
- _parse_timezone()
- _prepare_options()
- _prepare_options()
- _prepare_options()
- _prepare_options()
- _prepare_request()
- _prepare_request()
- _prepare_url()
- _primitive_value_to_str()
- _process_response()
- _process_response()
- _process_response_data()
- _request_api_list()
- _request_api_list()
- _serialize_multipartform()
- _set_private_attributes()
- _set_private_attributes()
- _should_retry()
- _should_stream_response_body()
- _sleep()
- _sleep()
- _sleep_for_retry()
- _sleep_for_retry()
- _stringify_item()
- _strip_raw_response_header()
- _transform_file()
- _transform_recursive()
- _transform_typeddict()
- _utils()
- _validate_headers()
- _validate_headers()
- _validate_headers()
- _validate_output_config_conflict()
- _warn_output_format_deprecated()
- aclose()
- add_request_id()
- aiter_bytes()
- aiter_bytes()
- aiter_bytes()
- aiter_lines()
- aiter_raw()
- aiter_text()
- aread()
- assert_is_file_content()
- assert_signatures_in_sync()
- astream_to_file()
- async_files_from_dir()
- async_maybe_transform()
- async_read_file_content()
- async_to_custom_raw_response_wrapper()
- async_to_custom_streamed_response_wrapper()
- async_to_httpx_files()
- async_to_raw_response_wrapper()
- async_to_raw_response_wrapper()
- async_to_streamed_response_wrapper()
- async_transform()
- asyncify()
- auth_headers()
- auth_headers()
- auth_headers()
- base_url()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- beta()
- beta()
- beta()
- beta()
- beta()
- beta()
- beta()
- beta()
- build()
- build()
- cached_property()
- cancel()
- cancel()
- cancel()
- cancel()
- charset_encoding()
- client()
- close()
- close()
- close()
- close()
- close()
- close()
- close()
- coerce_boolean()
- coerce_float()
- coerce_integer()
- completions()
- completions()
- completions()
- completions()
- completions()
- completions()
- construct()
- construct()
- construct_type()
- construct_type_unchecked()
- consume_async_iterator()
- consume_sync_iterator()
- content()
- content()
- copy()
- copy()
- copy()
- copy()
- count_tokens()
- count_tokens()
- count_tokens()
- count_tokens()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- create()
- custom_auth()
- data()
- decode()
- deepcopy_minimal()
- default()
- default_headers()
- default_headers()
- default_headers()
- default_query()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- delete()
- download()
- download()
- elapsed()
- elapsed()
- encoding()
- event()
- extract_files()
- extract_response_type()
- extract_stream_chunk_type()
- extract_type_arg()
- extract_type_var_from_base()
- field_get_default()
- field_is_required()
- field_outer_type()
- file_from_path()
- files()
- files()
- files()
- files()
- files()
- files()
- files_from_dir()
- flatten()
- function_has_argument()
- functools()
- get()
- get()
- get()
- get_api_list()
- get_api_list()
- get_architecture()
- get_args()
- get_async_library()
- get_environment_proxies()
- get_max_retries()
- get_model_config()
- get_model_fields()
- get_next_page()
- get_next_page()
- get_origin()
- get_platform()
- get_python_runtime()
- get_python_version()
- get_required_header()
- get_transformed_string()
- get_type_hints()
- handle_request()
- has_next_page()
- has_next_page()
- has_next_page()
- has_next_page()
- has_next_page()
- has_next_page()
- has_next_page()
- headers()
- headers()
- http_request()
- http_request()
- http_version()
- http_version()
- httpx()
- httpx_aiohttp()
- human_join()
- id()
- is_annotated_type()
- is_base64_file_input()
- is_basemodel()
- is_basemodel_type()
- is_closed()
- is_closed()
- is_closed()
- is_closed()
- is_dict()
- is_file_content()
- is_given()
- is_ipv4_hostname()
- is_ipv6_hostname()
- is_iterable()
- is_iterable_type()
- is_list()
- is_list_type()
- is_literal_type()
- is_mapping()
- is_mapping_t()
- is_required_type()
- is_sequence()
- is_sequence_t()
- is_sequence_type()
- is_stream_class_type()
- is_tuple()
- is_tuple_t()
- is_type_alias_type()
- is_typeddict()
- is_typevar()
- is_union()
- is_union_type()
- iter_bytes()
- iter_bytes()
- iter_bytes()
- iter_bytes()
- iter_bytes()
- iter_lines()
- iter_lines()
- iter_lines()
- iter_pages()
- iter_pages()
- iter_raw()
- iter_text()
- iter_text()
- iter_text()
- json()
- json()
- json()
- json()
- json_safe()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- list()
- lru_cache()
- make_request_options()
- maybe_coerce_boolean()
- maybe_coerce_float()
- maybe_coerce_integer()
- maybe_transform()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- method()
- method()
- mirror_request_content()
- model_copy()
- model_dump()
- model_json()
- model_parse()
- model_parse_json()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- next_page_info()
- next_page_info()
- next_page_info()
- next_page_info()
- next_page_info()
- next_page_info()
- next_page_info()
- openapi_dumps()
- parse()
- parse()
- parse()
- parse()
- parse()
- parse()
- parse()
- parse()
- parse_beta_response()
- parse_date()
- parse_date()
- parse_date()
- parse_datetime()
- parse_datetime()
- parse_obj()
- parse_response()
- parse_text()
- parsed_output()
- parsed_output()
- patch()
- patch()
- platform_headers()
- platform_headers()
- post()
- post()
- put()
- put()
- pydantic()
- pydantic()
- pydantic_core()
- qs()
- qs()
- qs()
- quote()
- read()
- read()
- read()
- read_file_content()
- removeprefix()
- removesuffix()
- request()
- request()
- request_id()
- request_id()
- request_id()
- required_args()
- resources()
- results()
- results()
- results()
- results()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve_metadata()
- retrieve_metadata()
- retry()
- set_pydantic_config()
- setup_logging()
- skills()
- skills()
- skills()
- skills()
- skills()
- skills()
- status_code()
- status_code()
- stream()
- stream()
- stream()
- stream()
- stream_to_file()
- stream_to_file()
- stream_to_file()
- stringify()
- stringify_items()
- strip_annotated_type()
- strip_not_given()
- test_absolute_request_url()
- test_absolute_request_url()
- test_base_url_env()
- test_base_url_env()
- test_base_url_no_trailing_slash()
- test_base_url_no_trailing_slash()
- test_base_url_setter()
- test_base_url_setter()
- test_base_url_trailing_slash()
- test_base_url_trailing_slash()
- test_basic_call_sync()
- test_basic_union_response()
- test_basic_union_response()
- test_binary_content_upload()
- test_binary_content_upload()
- test_binary_content_upload_with_asynciterator()
- test_binary_content_upload_with_body_is_deprecated()
- test_binary_content_upload_with_body_is_deprecated()
- test_binary_content_upload_with_iterator()
- test_client_context_manager()
- test_client_context_manager()
- test_client_max_retries_validation()
- test_client_max_retries_validation()
- test_client_response_validation_error()
- test_client_response_validation_error()
- test_client_timeout_option()
- test_client_timeout_option()
- test_copied_client_does_not_close_http()
- test_copied_client_does_not_close_http()
- test_copy()
- test_copy()
- test_copy_build_request()
- test_copy_build_request()
- test_copy_default_headers()
- test_copy_default_headers()
- test_copy_default_options()
- test_copy_default_options()
- test_copy_default_query()
- test_copy_default_query()
- test_copy_signature()
- test_copy_signature()
- test_default_client_creation()
- test_default_client_creation()
- test_default_headers_option()
- test_default_headers_option()
- test_default_query_option()
- test_default_query_option()
- test_default_stream_cls()
- test_default_stream_cls()
- test_dict_of_union()
- test_follow_redirects()
- test_follow_redirects()
- test_follow_redirects_disabled()
- test_follow_redirects_disabled()
- test_get_platform()
- test_http_client_timeout_option()
- test_http_client_timeout_option()
- test_invalid_http_client()
- test_invalid_http_client()
- test_iterable_of_dictionaries()
- test_list_of_typeddict()
- test_list_of_unions()
- test_multipart_repeating_array()
- test_multipart_repeating_array()
- test_nested_union_of_mixed_types()
- test_nested_union_of_models()
- test_no_warning_when_using_output_config()
- test_omit_retry_count_header()
- test_omit_retry_count_header()
- test_overwrite_retry_count_header()
- test_overwrite_retry_count_header()
- test_parse_retry_after_header()
- test_parse_retry_after_header()
- test_proxy_environment_variables()
- test_proxy_environment_variables()
- test_raw_response()
- test_raw_response()
- test_raw_response_for_binary()
- test_raw_response_for_binary()
- test_received_text_for_expected_json()
- test_received_text_for_expected_json()
- test_request_extra_headers()
- test_request_extra_headers()
- test_request_extra_json()
- test_request_extra_json()
- test_request_extra_query()
- test_request_extra_query()
- test_request_timeout()
- test_request_timeout()
- test_retries_taken()
- test_retries_taken()
- test_retries_taken_new_response_class()
- test_retries_taken_new_response_class()
- test_retrying_status_errors_doesnt_leak()
- test_retrying_status_errors_doesnt_leak()
- test_retrying_timeout_errors_doesnt_leak()
- test_retrying_timeout_errors_doesnt_leak()
- test_stream_method_definition_in_sync()
- test_stream_method_definition_in_sync()
- test_streaming_call_sync()
- test_streaming_call_sync_events()
- test_tool_runner_method_in_sync()
- test_union_of_dict()
- test_union_of_list()
- test_union_of_lists()
- test_union_of_typeddict()
- test_union_response_different_types()
- test_union_response_different_types()
- test_validate_headers()
- test_validate_headers()
- text()
- text()
- text()
- text()
- to_custom_raw_response_wrapper()
- to_custom_streamed_response_wrapper()
- to_dict()
- to_httpx_files()
- to_json()
- to_raw_response_wrapper()
- to_raw_response_wrapper()
- to_streamed_response_wrapper()
- to_thread()
- tool_runner()
- tool_runner()
- transform()
- transform_schema()
- upload()
- upload()
- url()
- url()
- user_agent()
- validate_output_format()
- validate_type()
- versions()
- versions()
- versions()
- versions()
- versions()
- versions()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_raw_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- with_streaming_response()
- write_to_file()
- write_to_file()
- write_to_file()
Source Files
- src/anthropic/__init__.py
- src/anthropic/_base_client.py
- src/anthropic/_client.py
- src/anthropic/_utils/_compat.py
- src/anthropic/_compat.py
- src/anthropic/_utils/_datetime_parse.py
- src/anthropic/_exceptions.py
- src/anthropic/_files.py
- src/anthropic/lib/_files.py
- src/anthropic/_utils/_httpx.py
- src/anthropic/_utils/_json.py
- src/anthropic/_legacy_response.py
- src/anthropic/_utils/_logs.py
- src/anthropic/_models.py
- src/anthropic/_utils/_proxy.py
- src/anthropic/_qs.py
- src/anthropic/_utils/_reflection.py
- src/anthropic/_resource.py
- src/anthropic/_utils/_resources_proxy.py
- src/anthropic/_response.py
- src/anthropic/lib/_parse/_response.py
- src/anthropic/_streaming.py
- src/anthropic/_utils/_streams.py
- src/anthropic/_utils/_sync.py
- src/anthropic/_utils/_transform.py
- src/anthropic/lib/_parse/_transform.py
- src/anthropic/_types.py
- src/anthropic/_utils/_typing.py
- src/anthropic/_utils/_utils.py
- src/anthropic/resources/beta/messages/batches.py
- src/anthropic/resources/messages/batches.py
- src/anthropic/resources/beta/beta.py
- src/anthropic/resources/completions.py
- src/anthropic/resources/beta/files.py
- src/anthropic/lib/foundry.py
- src/anthropic/resources/messages/messages.py
- src/anthropic/resources/beta/messages/messages.py
- src/anthropic/resources/beta/models.py
- src/anthropic/resources/models.py
- src/anthropic/pagination.py
- src/anthropic/types/beta/parsed_beta_message.py
- src/anthropic/types/parsed_message.py
- src/anthropic/resources/beta/skills/skills.py
- tests/test_client.py
- src/anthropic/resources/beta/skills/versions.py
Source
- src/anthropic/__init__.py
- src/anthropic/_base_client.py
- src/anthropic/_client.py
- src/anthropic/_utils/_compat.py
- src/anthropic/_compat.py
- src/anthropic/_utils/_datetime_parse.py
- src/anthropic/_exceptions.py
- src/anthropic/_files.py
- src/anthropic/lib/_files.py
- src/anthropic/_utils/_httpx.py
- src/anthropic/_utils/_json.py
- src/anthropic/_legacy_response.py
- src/anthropic/_utils/_logs.py
- src/anthropic/_models.py
- src/anthropic/_utils/_proxy.py
- src/anthropic/_qs.py
- src/anthropic/_utils/_reflection.py
- src/anthropic/_resource.py
- src/anthropic/_utils/_resources_proxy.py
- src/anthropic/_response.py
- src/anthropic/lib/_parse/_response.py
- src/anthropic/_streaming.py
- src/anthropic/_utils/_streams.py
- src/anthropic/_utils/_sync.py
- src/anthropic/_utils/_transform.py
- src/anthropic/lib/_parse/_transform.py
- src/anthropic/_types.py
- src/anthropic/_utils/_typing.py
- src/anthropic/_utils/_utils.py
- src/anthropic/resources/beta/messages/batches.py
- src/anthropic/resources/messages/batches.py
- src/anthropic/resources/beta/beta.py
- src/anthropic/resources/completions.py
- src/anthropic/resources/beta/files.py
- src/anthropic/lib/foundry.py
- src/anthropic/resources/messages/messages.py
- src/anthropic/resources/beta/messages/messages.py
- src/anthropic/resources/beta/models.py
- src/anthropic/resources/models.py
- src/anthropic/pagination.py
- src/anthropic/types/beta/parsed_beta_message.py
- src/anthropic/types/parsed_message.py
- src/anthropic/resources/beta/skills/skills.py
- tests/test_client.py
- src/anthropic/resources/beta/skills/versions.py
Frequently Asked Questions
What is the SyncClient subdomain?
SyncClient is a subdomain in the anthropic-sdk-python codebase, part of the AnthropicClient domain. Implementation of the blocking Anthropic client using HTTPX. It contains 45 source files.
Which domain does SyncClient belong to?
SyncClient belongs to the AnthropicClient domain.
What functions are in SyncClient?
The SyncClient subdomain contains 839 function(s): Base64FileInput, DefaultAsyncHttpxClient, DefaultHttpxClient, GenericModel, GenericModel, NoneType, PYDANTIC_V1, RootModel, and 831 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free