AsyncAPI — anthropic-sdk-python Architecture
Handles asynchronous HTTP request lifecycles using anyio and httpx
Entity Profile
Dependency Diagram
graph TD subdomain_AnthropicClient_AsyncAPI["AsyncAPI"] 0c5e6779_0a2a_28fc_5287_7349e6c59ced["test_extract_files.py"] subdomain_AnthropicClient_AsyncAPI --> 0c5e6779_0a2a_28fc_5287_7349e6c59ced 2e9c15bb_de03_aa91_93be_0e05db0a552e["_response.py"] subdomain_AnthropicClient_AsyncAPI --> 2e9c15bb_de03_aa91_93be_0e05db0a552e e20f2c32_b105_01cb_557f_c10174db767d["_files.py"] subdomain_AnthropicClient_AsyncAPI --> e20f2c32_b105_01cb_557f_c10174db767d b2b2bd85_e598_f0e9_64e6_661945bb42ac["batches.py"] subdomain_AnthropicClient_AsyncAPI --> b2b2bd85_e598_f0e9_64e6_661945bb42ac 875202ec_3744_577d_9ec4_ed9fbc6aaf41["_utils.py"] subdomain_AnthropicClient_AsyncAPI --> 875202ec_3744_577d_9ec4_ed9fbc6aaf41 91a12d3e_6b2a_90bd_28df_074cc1d1ad53["_stream_decoder.py"] subdomain_AnthropicClient_AsyncAPI --> 91a12d3e_6b2a_90bd_28df_074cc1d1ad53 c8b41cc2_db36_3062_f709_8c907f559cd4["_datetime_parse.py"] subdomain_AnthropicClient_AsyncAPI --> c8b41cc2_db36_3062_f709_8c907f559cd4 8ecd4321_1ed7_9c90_8d23_e61f807683d3["test_runners.py"] subdomain_AnthropicClient_AsyncAPI --> 8ecd4321_1ed7_9c90_8d23_e61f807683d3 31e60ad8_cac8_652d_176d_4f7cf7dda1ad["_base_client.py"] subdomain_AnthropicClient_AsyncAPI --> 31e60ad8_cac8_652d_176d_4f7cf7dda1ad cf46c35e_ae7e_a652_f32b_5dd703f4d658["utils.py"] subdomain_AnthropicClient_AsyncAPI --> cf46c35e_ae7e_a652_f32b_5dd703f4d658 31e115f3_5f92_0f4b_4468_e9937a5656c2["helpers.py"] subdomain_AnthropicClient_AsyncAPI --> 31e115f3_5f92_0f4b_4468_e9937a5656c2 43a93153_bd96_06f2_9418_72daf6b4ca3a["_stream.py"] subdomain_AnthropicClient_AsyncAPI --> 43a93153_bd96_06f2_9418_72daf6b4ca3a 06ef3a78_b4c0_f7a7_8dcb_f5667ebd7320["test_partial_json.py"] subdomain_AnthropicClient_AsyncAPI --> 06ef3a78_b4c0_f7a7_8dcb_f5667ebd7320 aa7d21d4_f6f0_8301_73f8_2ea17597e81e["_response.py"] subdomain_AnthropicClient_AsyncAPI --> aa7d21d4_f6f0_8301_73f8_2ea17597e81e style subdomain_AnthropicClient_AsyncAPI fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Domain
Functions
- DefaultAsyncHttpxClient()
- DefaultHttpxClient()
- GenericModel()
- PYDANTIC_V1()
- SequenceNotStr()
- _DefaultAioHttpClient()
- _TYPE_ALIAS_TYPES()
- __aenter__()
- __aenter__()
- __aexit__()
- __aiter__()
- __bool__()
- __bool__()
- __call__()
- __contains__()
- __del__()
- __dir__()
- __enter__()
- __exit__()
- __get__()
- __get_proxied__()
- __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__()
- __iter__()
- __load__()
- __load__()
- __load__()
- __next__()
- __repr__()
- __repr__()
- __repr__()
- __repr__()
- __set_name__()
- __str__()
- __stream__()
- _async_collect_files()
- _async_format_data()
- _async_transform_file()
- _async_transform_recursive()
- _async_transform_typeddict()
- _build_discriminated_union_meta()
- _build_request()
- _construct_field()
- _extract_items()
- _format_data()
- _get_numeric()
- _get_page_items()
- _get_page_items()
- _get_page_items()
- _get_weather()
- _infer_region()
- _iter_events()
- _low_retry_timeout()
- _make_async_iterator()
- _make_status_error()
- _make_status_error()
- _make_status_error()
- _merge_output_configs()
- _models()
- _no_transform_needed()
- _parse()
- _parse_timezone()
- _prepare_options()
- _prepare_options()
- _prepare_options()
- _prepare_options()
- _prepare_options()
- _prepare_options()
- _prepare_request()
- _prepare_request()
- _prepare_request()
- _prepare_request()
- _prepare_request()
- _prepare_request()
- _primitive_value_to_str()
- _request_api_list()
- _request_api_list()
- _validate_headers()
- _validate_headers()
- aclose()
- add_request_id()
- aiter_bytes()
- aiter_bytes()
- aiter_bytes()
- aiter_raw()
- aiter_text()
- aread()
- assert_basic_response()
- assert_empty_iter()
- assert_is_file_content()
- assert_matches_model()
- async_client()
- async_client()
- async_files_from_dir()
- async_maybe_transform()
- async_read_file_content()
- async_stream()
- 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()
- batches()
- batches()
- batches()
- batches()
- batches()
- batches()
- beta()
- beta()
- beta()
- beta()
- botocore()
- build()
- cancel()
- charset_encoding()
- clear_locals()
- close()
- close()
- close()
- coerce_float()
- completions()
- completions()
- completions()
- completions()
- construct()
- construct_type()
- consume_async_iterator()
- content()
- copy()
- create()
- create()
- create()
- create()
- create()
- data()
- decode()
- default()
- delete()
- delete()
- delete()
- delete()
- delete()
- elapsed()
- extract_response_type()
- extract_stream_chunk_type()
- extract_type_arg()
- field_is_required()
- field_outer_type()
- files()
- files()
- files()
- files_from_dir()
- flatten()
- functools()
- get()
- get_architecture()
- get_async_library()
- get_environment_proxies()
- get_max_retries()
- get_model_fields()
- get_origin()
- get_platform()
- get_required_header()
- get_type_hints()
- handle_async_request()
- handle_request()
- 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_base64_file_input()
- is_basemodel()
- is_closed()
- is_closed()
- is_dict()
- is_ipv4_hostname()
- is_ipv6_hostname()
- is_iterable()
- is_iterable_type()
- is_list_type()
- is_mapping()
- is_required_type()
- is_sequence()
- is_tuple()
- is_type_alias_type()
- is_typeddict()
- iter_bytes()
- iter_next()
- iter_raw()
- iter_text()
- iter_text()
- iter_text()
- json_safe()
- list()
- list()
- list()
- list()
- list()
- load_fixture()
- main()
- make_async_snapshot_request()
- make_async_stream_snapshot_request()
- make_request_options()
- make_snapshot_request()
- make_stream_snapshot_request()
- maybe_coerce_boolean()
- maybe_coerce_integer()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- messages()
- mirror_request_content()
- mock_aws_config()
- model_dump()
- model_json()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- models()
- next_page_info()
- next_page_info()
- next_page_info()
- parse()
- parse()
- parse()
- parse()
- parse_date()
- parse_date()
- parse_response()
- parse_text()
- parsed_output()
- patch()
- patch()
- pydantic()
- pydantic()
- pytest_collection_modifyitems()
- qs()
- qs()
- read()
- read_file_content()
- region()
- removesuffix()
- request()
- request()
- request_id()
- request_id()
- request_id()
- required_args()
- resources()
- results()
- results()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve()
- retrieve_metadata()
- setup_logging()
- skills()
- stream()
- stream_to_file()
- stream_to_file()
- stringify_items()
- strip_not_given()
- test_absolute_request_url()
- test_absolute_request_url()
- test_allof()
- test_array_comma()
- test_async_azure_ad_token_provider()
- test_async_pathlib_includes_file_name()
- test_async_response_basemodel_request_id()
- test_async_response_parse_annotated_type()
- test_async_response_parse_bool()
- test_async_response_parse_custom_model()
- test_async_response_parse_custom_stream()
- test_async_response_parse_expect_model_union_non_json_content()
- test_async_response_parse_mismatched_basemodel()
- test_async_supports_anyio_path()
- test_async_tuple_input()
- test_base64_file_input()
- test_base_url_no_trailing_slash()
- test_base_url_setter()
- test_base_url_trailing_slash()
- test_basic()
- test_basic()
- test_basic_call_async()
- test_basic_function_schema_conversion()
- test_basic_response()
- test_basic_response()
- test_binary_content_upload_with_body_is_deprecated()
- test_binary_content_upload_with_iterator()
- test_client_max_retries_validation()
- test_client_response_validation_error()
- 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_query()
- test_custom_name_and_description()
- test_data_missing_event()
- test_datetime_custom_format()
- test_datetime_parsing()
- test_decorator_with_custom_parameters()
- test_default_headers_option()
- test_default_query_option()
- test_deprecated_alias()
- test_deprecated_model_warning_stream()
- test_deprecated_model_warning_stream()
- test_deprecated_model_warning_stream()
- test_dict_of_union()
- test_discriminated_unions_invalid_data()
- test_discriminated_unions_with_aliases_invalid_data()
- test_docstring_parsing_with_parameters()
- test_env_var_base_url_override()
- test_extract_response_type_concrete_subclasses()
- test_extract_type_var_multiple()
- test_follow_redirects()
- test_follow_redirects()
- test_forwards_compat_model_dump_json_method()
- test_function_call_with_invalid_input()
- test_get_platform()
- test_global_region_base_url()
- test_http_client_timeout_option()
- test_http_client_timeout_option()
- test_ignores_invalid_input()
- test_initialization_from_environment_variables()
- test_initialization_from_environment_variables()
- test_invalid_http_client()
- test_invalid_http_client()
- test_isinstance_check()
- test_iso8601_datetime()
- test_iterable_of_dictionaries()
- test_keyword_only_param()
- test_list_mismatched_type()
- test_list_nested_model()
- test_max_iterations()
- test_messages_retries_async()
- test_multipart_repeating_array()
- test_multiple_data_lines()
- test_multiple_events_with_data()
- test_multiple_params_multiple_variants()
- test_nested_discriminated_union()
- test_nested_union_invalid_data()
- test_nested_union_of_models()
- test_new_lines_in_json()
- test_null_schema()
- test_omit_retry_count_header()
- test_parse_retry_after_header()
- test_parse_with_nested_pydantic_model()
- test_pathlib_includes_file_name()
- test_pydantic_empty_model()
- test_pydantic_mismatched_object_type()
- test_pydantic_model_serialization()
- test_pydantic_model_with_alias()
- test_pydantic_model_with_alias_and_default()
- test_pydantic_model_with_nested_models_and_defaults()
- test_raw_response()
- test_region_infer_from_profile()
- test_rejects_both_output_format_and_config()
- test_removes_files_from_input()
- test_repr()
- 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_required_iso8601_format()
- test_response_basemodel_request_id()
- test_response_basemodel_request_id()
- test_response_parse_bool()
- test_response_parse_custom_model()
- test_response_parse_custom_stream()
- test_response_parse_mismatched_basemodel()
- test_retries_taken()
- test_retries_taken_new_response_class()
- test_retrying_timeout_errors_doesnt_leak()
- test_simple_dict()
- test_simple_list()
- test_stream_with_raw_schema()
- test_stream_with_raw_schema()
- test_string_schema_with_format_and_default()
- test_string_schema_without_format()
- test_strips_omit()
- test_to_dict()
- test_to_dict_method()
- test_tool_call_error()
- test_tool_use()
- test_top_level_alias()
- test_tracks_tool_input_type_alias_is_up_to_date()
- test_trailing_strings_mode_header()
- test_type_alias_type()
- test_union_of_typeddict()
- test_union_response_different_types()
- test_unknown_array_format()
- test_unknown_fields()
- test_with_options()
- text()
- text()
- text()
- to_async_iter()
- to_dict()
- to_httpx_files()
- to_raw_response_wrapper()
- to_streamed_response_wrapper()
- transform()
- transform_schema()
- update_env()
- upload()
- url()
- url()
- validate_type()
- 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_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()
Source Files
- src/anthropic/_base_client.py
- src/anthropic/_client.py
- src/anthropic/_utils/_datetime_parse.py
- src/anthropic/lib/_files.py
- src/anthropic/_files.py
- src/anthropic/_utils/_httpx.py
- src/anthropic/_resource.py
- src/anthropic/_utils/_resources_proxy.py
- src/anthropic/lib/_parse/_response.py
- src/anthropic/_response.py
- src/anthropic/lib/bedrock/_stream.py
- src/anthropic/lib/bedrock/_stream_decoder.py
- src/anthropic/_utils/_utils.py
- src/anthropic/resources/beta/messages/batches.py
- src/anthropic/resources/beta/beta.py
- src/anthropic/resources/beta/files.py
- src/anthropic/lib/foundry.py
- tests/lib/streaming/helpers.py
- src/anthropic/resources/models.py
- src/anthropic/pagination.py
- src/anthropic/types/beta/parsed_beta_message.py
- tests/lib/snapshots.py
- tests/lib/_parse/test_beta_messages.py
- tests/test_extract_files.py
- tests/test_files.py
- tests/test_legacy_response.py
- tests/test_models.py
- tests/lib/streaming/test_partial_json.py
- tests/lib/tools/test_runners.py
- examples/text_completions_demo_async.py
- tests/utils.py
- src/anthropic/resources/beta/skills/versions.py
Source
- src/anthropic/_base_client.py
- src/anthropic/_client.py
- src/anthropic/_utils/_datetime_parse.py
- src/anthropic/lib/_files.py
- src/anthropic/_files.py
- src/anthropic/_utils/_httpx.py
- src/anthropic/_resource.py
- src/anthropic/_utils/_resources_proxy.py
- src/anthropic/lib/_parse/_response.py
- src/anthropic/_response.py
- src/anthropic/lib/bedrock/_stream.py
- src/anthropic/lib/bedrock/_stream_decoder.py
- src/anthropic/_utils/_utils.py
- src/anthropic/resources/beta/messages/batches.py
- src/anthropic/resources/beta/beta.py
- src/anthropic/resources/beta/files.py
- src/anthropic/lib/foundry.py
- tests/lib/streaming/helpers.py
- src/anthropic/resources/models.py
- src/anthropic/pagination.py
- src/anthropic/types/beta/parsed_beta_message.py
- tests/lib/snapshots.py
- tests/lib/_parse/test_beta_messages.py
- tests/test_extract_files.py
- tests/test_files.py
- tests/test_legacy_response.py
- tests/test_models.py
- tests/lib/streaming/test_partial_json.py
- tests/lib/tools/test_runners.py
- examples/text_completions_demo_async.py
- tests/utils.py
- src/anthropic/resources/beta/skills/versions.py
Frequently Asked Questions
What is the AsyncAPI subdomain?
AsyncAPI is a subdomain in the anthropic-sdk-python codebase, part of the AnthropicClient domain. Handles asynchronous HTTP request lifecycles using anyio and httpx It contains 32 source files.
Which domain does AsyncAPI belong to?
AsyncAPI belongs to the AnthropicClient domain.
What functions are in AsyncAPI?
The AsyncAPI subdomain contains 516 function(s): DefaultAsyncHttpxClient, DefaultHttpxClient, GenericModel, PYDANTIC_V1, SequenceNotStr, _DefaultAioHttpClient, _TYPE_ALIAS_TYPES, __aenter__, and 508 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free