Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ functions
Functions
4,863 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
4,863
◇
Types & classes
1,585
↳
Endpoints
26
↓ 2 callers
Method
handler
(req: APIRequest)
tests/test_middleware.py:502
↓ 2 callers
Method
has_next_page
(self)
src/anthropic/_base_client.py:203
↓ 2 callers
Method
heartbeat
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:312
↓ 2 callers
Method
hold
Pause the countdown while a gated call is held or in flight.
src/anthropic/lib/tools/_beta_session_runner.py:205
↓ 2 callers
Method
hop_body
The hop's request body: the refused request's, with the entry's overrides merged over it and extended by the continuation. The server
src/anthropic/lib/middleware/_fallbacks.py:1093
↓ 2 callers
Function
is_base64_file_input
(obj: object)
src/anthropic/_files.py:25
↓ 2 callers
Function
is_basemodel
Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`
src/anthropic/_models.py:527
↓ 2 callers
Function
is_basemodel_type
(type_: type)
src/anthropic/_models.py:539
↓ 2 callers
Function
is_iterable_type
If the given type is `typing.Iterable[T]`
src/anthropic/_utils/_typing.py:34
↓ 2 callers
Function
is_literal_type
(type_: type[Any])
src/anthropic/_compat.py:39
↓ 2 callers
Function
is_required_type
(typ: type)
src/anthropic/_utils/_typing.py:44
↓ 2 callers
Function
is_sequence
(obj: object)
src/anthropic/_utils/_utils.py:178
↓ 2 callers
Function
is_sequence_t
(obj: _SequenceT | object)
src/anthropic/_utils/_utils.py:182
↓ 2 callers
Function
is_stream_class_type
TypeGuard for determining whether or not the given type is a subclass of `Stream` / `AsyncStream`
src/anthropic/_streaming.py:536
↓ 2 callers
Function
is_tuple_t
(obj: _TupleT | object)
src/anthropic/_utils/_utils.py:174
↓ 2 callers
Function
is_typeddict
(tp: Type[Any])
src/anthropic/_utils/_compat.py:32
↓ 2 callers
Function
is_union
(tp: type[Any] | None)
src/anthropic/_compat.py:33
↓ 2 callers
Method
iter_bytes
Given an iterator that yields raw binary data, iterate over it & yield every event encountered
src/anthropic/_streaming.py:427
↓ 2 callers
Method
json
Read and decode the JSON response content.
src/anthropic/_response.py:375
↓ 2 callers
Method
json
(self)
src/anthropic/_streaming.py:405
↓ 2 callers
Function
make_async_vertex_client
(**kwargs: Any)
tests/test_middleware.py:1816
↓ 2 callers
Method
mark_opened
(self)
src/anthropic/lib/middleware/_fallbacks.py:1086
↓ 2 callers
Function
model_parse
(model: type[_ModelT], data: Any)
src/anthropic/_compat.py:175
↓ 2 callers
Function
parse_beta_response
( *, output_format: ResponseFormatT | NotGiven, response: BetaMessage, )
src/anthropic/lib/_parse/_response.py:23
↓ 2 callers
Function
parse_response
( *, output_format: ResponseFormatT | NotGiven, response: Message, )
src/anthropic/lib/_parse/_response.py:49
↓ 2 callers
Method
patch
( self, path: str, *, cast_to: Type[ResponseT], body: Body | None = No
src/anthropic/_base_client.py:1538
↓ 2 callers
Method
pending_seam_frames
(self)
src/anthropic/lib/middleware/_fallbacks.py:1083
↓ 2 callers
Method
poll
Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating se
src/anthropic/resources/beta/environments/work.py:390
↓ 2 callers
Method
queue_seam
Queue the reached hop's `fallback` seam block at the next monotonic index. Queued seams are flushed by the hop reader once output reaches the
src/anthropic/lib/middleware/_fallbacks.py:1059
↓ 2 callers
Method
raw_events
Iterate the raw Server-Sent Events from `response`, before any JSON parsing or event-name filtering. This reads the response body dir
src/anthropic/_streaming.py:78
↓ 2 callers
Method
release
Drop one hold; the last release applies any deferred arm. Once nothing gated is held or in flight, a deferred ``end_turn`` countdown
src/anthropic/lib/tools/_beta_session_runner.py:215
↓ 2 callers
Function
resolve_identity_token_path
ctor arg → ``ANTHROPIC_IDENTITY_TOKEN_FILE`` → ``None``.
src/anthropic/lib/credentials/_constants.py:220
↓ 2 callers
Function
short_circuit_message
(*, model: str = "claude-opus-4-6")
tests/test_middleware.py:362
↓ 2 callers
Function
start
(event_id: str)
tests/lib/sessions/test_accumulate.py:21
↓ 2 callers
Method
stringify_items
( self, params: Params, *, array_format: ArrayFormat | NotGiven = not_given,
src/anthropic/_qs.py:51
↓ 2 callers
Method
terminal_failure_frames
Degrade to the suppressed refusal when every remaining entry failed over HTTP: replay its message_delta verbatim — `recommended_model`
src/anthropic/lib/middleware/_fallbacks.py:1124
↓ 2 callers
Function
to_aiter
(iter: Iterator[bytes])
tests/test_streaming.py:249
↓ 2 callers
Function
to_custom_raw_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support returning the given respo
src/anthropic/_response.py:814
↓ 2 callers
Function
to_custom_streamed_response_wrapper
Higher order function that takes one of our bound API methods and an `APIResponse` class and wraps the method to support streaming and returning t
src/anthropic/_response.py:730
↓ 2 callers
Method
token
Return a valid access token, loading ADC / refreshing as needed. Blocking.
src/anthropic/lib/google_cloud/_client.py:63
↓ 2 callers
Function
tool_registry
Index ``tools`` by their ``name`` for O(1) dispatch lookup. On a duplicate name the later tool wins, matching a plain dict comprehension.
src/anthropic/lib/tools/_tool_dispatch.py:40
↓ 2 callers
Method
unwrap
(self, payload: str, *, headers: Mapping[str, str], key: str | bytes | None = None)
src/anthropic/resources/beta/webhooks.py:17
↓ 2 callers
Function
validate_output_format
(output_format: object)
src/anthropic/resources/beta/messages/messages.py:4187
↓ 2 callers
Function
validate_type
Strict validation that the given value matches the expected type
src/anthropic/_models.py:828
↓ 1 callers
Method
__aexit__
(self, *exc: object)
src/anthropic/lib/tools/agent_toolset.py:251
↓ 1 callers
Method
__as_proxied__
Helper method that returns the current proxy, typed as the loaded object
src/anthropic/_utils/_proxy.py:60
↓ 1 callers
Method
__decode__
(self)
src/anthropic/_decoders/jsonl.py:43
↓ 1 callers
Method
__decode__
(self)
src/anthropic/_decoders/jsonl.py:99
↓ 1 callers
Method
__enter__
(self)
src/anthropic/lib/streaming/_messages.py:70
↓ 1 callers
Method
__init__
( self, *, raw: httpx.Response, cast_to: type[R], client: BaseClient[A
src/anthropic/_legacy_response.py:72
↓ 1 callers
Method
__init__
Construct a new synchronous Anthropic client instance. Credentials are resolved in the following order (first match wins): 1. Explic
src/anthropic/_client.py:147
↓ 1 callers
Method
__init__
(self, content: BetaFunctionToolResultType)
src/anthropic/lib/tools/_beta_functions.py:48
↓ 1 callers
Method
__init__
( self, *, cast_to: type[_T], response: httpx.Response, client: Anthro
src/anthropic/lib/bedrock/_stream.py:15
↓ 1 callers
Method
__init__
( self, *, aws_access_key: str | None = None, aws_secret_key: str | None = Non
src/anthropic/lib/bedrock/_mantle.py:177
↓ 1 callers
Method
__init__
( self, aws_secret_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/bedrock/_client.py:138
↓ 1 callers
Method
__init__
( self, *, api_key: str | None = None, aws_access_key: str | None = None,
src/anthropic/lib/aws/_client.py:34
↓ 1 callers
Method
__init__
( self, *, region: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NO
src/anthropic/lib/vertex/_client.py:96
↓ 1 callers
Method
__init__
Construct a new synchronous Claude Platform on Google Cloud client. Auth precedence (first match wins, unless ``skip_auth=True``):
src/anthropic/lib/google_cloud/_client.py:201
↓ 1 callers
Method
__init__
( self, *, raw_iterator: Iterator[bytes], line_type: type[_T], http_re
src/anthropic/_decoders/jsonl.py:23
↓ 1 callers
Method
__load__
(self)
src/anthropic/_utils/_proxy.py:65
↓ 1 callers
Method
__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:262
↓ 1 callers
Method
__run__
(self)
src/anthropic/lib/tools/_beta_runner.py:550
↓ 1 callers
Method
__stream__
(self)
src/anthropic/_streaming.py:255
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:131
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_beta_messages.py:280
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:128
↓ 1 callers
Method
__stream__
(self)
src/anthropic/lib/streaming/_messages.py:276
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:144
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_beta_messages.py:293
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:140
↓ 1 callers
Method
__stream_text__
(self)
src/anthropic/lib/streaming/_messages.py:288
↓ 1 callers
Function
_add
(tag: str | None)
src/anthropic/lib/_stainless_helpers.py:104
↓ 1 callers
Function
_aforce_stop_quietly
Async version of :func:`_force_stop_quietly`.
src/anthropic/lib/environments/_poller.py:269
↓ 1 callers
Method
_aiter_chunks
Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks
src/anthropic/_streaming.py:459
↓ 1 callers
Function
_append_header_value
Append `addition` to a comma-separated header value, skipping tokens that are already present so the same helper isn't recorded twice. Values
src/anthropic/_base_client.py:2567
↓ 1 callers
Function
_apply_delta
Apply a content_block_delta to the accumulating block at `index`.
src/anthropic/lib/middleware/_fallbacks.py:1252
↓ 1 callers
Function
_archive_file_mode
Reduce an archive entry's Unix mode to ``0o755`` if it is executable, ``0o644`` otherwise. Skill bundles can ship executable scripts (e.g. ``
src/anthropic/lib/tools/_skills.py:94
↓ 1 callers
Function
_array_suffix
(array_format: ArrayFormat, array_index: int)
src/anthropic/_utils/_utils.py:61
↓ 1 callers
Function
_assert_list_type
(type_: type[object], value: object)
tests/utils.py:145
↓ 1 callers
Function
_async_collect_files
(directory: anyio.Path, relative_to: anyio.Path, files: list[FileTypes])
src/anthropic/lib/_files.py:36
↓ 1 callers
Function
_async_format_data
(data: object, format_: PropertyFormat, format_template: str | None)
src/anthropic/_utils/_transform.py:406
↓ 1 callers
Function
_async_transform_file
(file: FileTypes)
src/anthropic/_files.py:107
↓ 1 callers
Function
_async_transform_typeddict
( data: Mapping[str, object], expected_type: type, )
src/anthropic/_utils/_transform.py:433
↓ 1 callers
Function
_async_validate_no_symlink_escape
(target_path: AsyncPath, memory_root: AsyncPath)
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:641
↓ 1 callers
Function
_backfill
Fill `None` fields on `primary` from `fallback`.
src/anthropic/lib/middleware/_fallbacks.py:1511
↓ 1 callers
Function
_basic_config
()
src/anthropic/_utils/_logs.py:8
↓ 1 callers
Function
_build_discriminated_union_meta
(*, union: type, meta_annotations: tuple[Any, ...])
src/anthropic/_models.py:747
↓ 1 callers
Function
_build_federation_result
Build a :class:`CredentialResult` for the env-var federation path (step 4 in the precedence spec). Returns ``None`` if the required trio isn't
src/anthropic/lib/credentials/_chain.py:29
↓ 1 callers
Method
_build_headers
(self, options: FinalRequestOptions, *, retries_taken: int = 0)
src/anthropic/_base_client.py:457
↓ 1 callers
Method
_build_middleware_chain
Build the middleware invocation chain. The chain only depends on the immutable `self._middleware` tuple so it is built once at constr
src/anthropic/_base_client.py:1199
↓ 1 callers
Method
_build_middleware_chain
Build the middleware invocation chain. The chain only depends on the immutable `self._middleware` tuple so it is built once at constr
src/anthropic/_base_client.py:1945
↓ 1 callers
Function
_build_result_event
Build the result-event params matching ``ev``'s tool-call kind. A custom tool call (``agent.custom_tool_use``) is answered with a ``user.cust
src/anthropic/lib/tools/_beta_session_runner.py:323
↓ 1 callers
Method
_call_oidc_federation
(self, auth: Dict[str, Any], *, force_refresh: bool = False)
src/anthropic/lib/credentials/_providers.py:622
↓ 1 callers
Method
_call_provider
Call the provider, retrying once on a 401 from the token endpoint.
src/anthropic/lib/credentials/_cache.py:88
↓ 1 callers
Method
_call_user_oauth
Interactive-login profile. With a ``client_id`` in the auth block, we run the refresh_token grant on expiry; without one, we treat the
src/anthropic/lib/credentials/_providers.py:495
↓ 1 callers
Method
_check_and_compact
Check token usage and compact messages if threshold exceeded. Returns True if compaction was performed, False otherwise.
src/anthropic/lib/tools/_beta_runner.py:178
↓ 1 callers
Method
_check_and_compact
Check token usage and compact messages if threshold exceeded. Returns True if compaction was performed, False otherwise.
src/anthropic/lib/tools/_beta_runner.py:466
↓ 1 callers
Method
_cleanup_skills
Remove the skill directories :meth:`setup_skills` downloaded. Only the directories this context created are removed — a pre-existing
src/anthropic/lib/tools/agent_toolset.py:233
↓ 1 callers
Function
_coerce_expires_at
Parse a credentials-file ``expires_at`` field into Unix seconds.
src/anthropic/lib/credentials/_providers.py:58
↓ 1 callers
Function
_collect_files
(directory: Path, relative_to: Path, files: list[FileTypes])
src/anthropic/lib/_files.py:19
← previous
next →
501–600 of 4,863, ranked by callers