Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/anthropic-sdk-python
/ types & classes
Types & classes
2,013 in github.com/anthropics/anthropic-sdk-python
⨍
Functions
6,358
◇
Types & classes
2,013
↳
Endpoints
17
↓ 230 callers
Class
PropertyInfo
Metadata class to be used in Annotated types to provide information about a given type. For example: class MyParams(TypedDict): acco
src/anthropic/_utils/_transform.py:44
↓ 101 callers
Class
Anthropic
src/anthropic/_client.py:124
↓ 75 callers
Class
BetaRefusalFallbackMiddleware
Middleware that retries refused beta `/v1/messages` requests down a fallback chain, reproducing the server-side `fallbacks` wire shape client-
src/anthropic/lib/middleware/_fallbacks.py:104
↓ 68 callers
Class
CredentialsFile
An :class:`AccessTokenProvider` backed by a named profile. A profile is a pair of files under the config directory (``~/.config/anthropic/``
src/anthropic/lib/credentials/_providers.py:146
↓ 68 callers
Class
FinalRequestOptions
src/anthropic/_models.py:944
↓ 58 callers
Class
AgentToolContext
Workdir + path-policy for the agent toolset. Trust model — two tiers: - The file tools (:func:`beta_read_tool`, :func:`beta_write_tool`,
src/anthropic/lib/tools/agent_toolset.py:192
↓ 58 callers
Class
AsyncAnthropic
src/anthropic/_client.py:546
↓ 55 callers
Class
AnthropicGoogleCloud
Synchronous client for the first-party Anthropic API served through Google's gateway (Claude Platform on Google Cloud). The whole first-party
src/anthropic/lib/google_cloud/_client.py:189
↓ 48 callers
Class
FakeAsyncEvents
tests/lib/tools/test_session_runner.py:173
↓ 46 callers
Class
BetaMemoryTool20250818CreateCommand
src/anthropic/types/beta/beta_memory_tool_20250818_create_command.py:10
↓ 38 callers
Class
_FakeTool
tests/lib/tools/test_session_runner.py:234
↓ 34 callers
Class
AnthropicError
src/anthropic/_exceptions.py:30
↓ 34 callers
Class
WorkloadIdentityCredentials
Exchanges an external OIDC JWT for an Anthropic access token via the RFC 7523 ``jwt-bearer`` grant. This is an :class:`AccessTokenProvider`:
src/anthropic/lib/credentials/_workload.py:138
↓ 33 callers
Class
AccessToken
An Anthropic API access token with optional expiry. ``expires_at`` is unix seconds; ``None`` means no expiry information (the token will be t
src/anthropic/lib/credentials/_types.py:22
↓ 32 callers
Class
AnthropicAWS
src/anthropic/lib/aws/_client.py:25
↓ 32 callers
Class
RecordingMiddleware
tests/test_middleware.py:88
↓ 28 callers
Class
ToolError
Error that can be raised from a tool to return structured content with ``is_error: True``. When the tool runner catches this error, it will use t
src/anthropic/lib/tools/_beta_functions.py:30
↓ 24 callers
Class
AnthropicBedrockMantle
src/anthropic/lib/bedrock/_mantle.py:164
↓ 22 callers
Class
_StubWork
Minimal stand-in for ``BetaSelfHostedWork`` — only fields the poller reads.
tests/lib/environments/test_poller_method.py:30
↓ 21 callers
Class
AsyncAnthropicGoogleCloud
Asynchronous client for the first-party Anthropic API served through Google's gateway (Claude Platform on Google Cloud). See ``AnthropicGoogleClou
src/anthropic/lib/google_cloud/_client.py:449
↓ 21 callers
Class
EnvironmentWorker
Run a self-hosted environment worker. Composed from the control-plane poller (``client.beta.environments.work.poller``) and the per-session :
src/anthropic/lib/environments/_worker.py:297
↓ 21 callers
Class
StaticToken
An :class:`AccessTokenProvider` that always returns a fixed token with no expiry.
src/anthropic/lib/credentials/_providers.py:118
↓ 21 callers
Class
TokenCache
Thread-safe cache wrapping an :class:`AccessTokenProvider` with two-tier proactive refresh and single-flight semantics. Refresh policy on eac
src/anthropic/lib/credentials/_cache.py:25
↓ 19 callers
Class
SessionMemoryStores
The memory stores attached to one session, materialised on disk. :meth:`download` opens a :class:`~._file_store.LocalFileStore` at each attac
src/anthropic/lib/tools/_memories.py:160
↓ 19 callers
Class
_FakeSessions
tests/lib/environments/test_worker.py:137
↓ 18 callers
Class
FakeWork
Sync resource fake. ``poll_script`` is consumed in order; values are either ``BetaSelfHostedWork``-shaped stubs, ``None`` (no work available),
tests/lib/environments/test_poller_method.py:44
↓ 17 callers
Class
Omit
To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json
src/anthropic/_types.py:159
↓ 17 callers
Class
_FakeWorkResource
tests/lib/environments/test_worker.py:90
↓ 16 callers
Class
AnthropicFoundry
src/anthropic/lib/foundry.py:95
↓ 15 callers
Class
BetaFallbackState
Tracks which fallback a sequence of requests is pinned to. Create one and enter it (`with state:` — the same context manager works for both c
src/anthropic/lib/middleware/_fallbacks.py:62
↓ 15 callers
Class
_FakeCredentials
Duck-typed stand-in for a `google.auth` Credentials object.
tests/lib/test_google_cloud.py:49
↓ 13 callers
Class
APIRequest
A view over the request that the client is about to execute. Treat instances as immutable; use `copy()` to derive a modified request.
src/anthropic/_request.py:15
↓ 13 callers
Class
BetaMemoryTool20250818ViewCommand
src/anthropic/types/beta/beta_memory_tool_20250818_view_command.py:11
↓ 12 callers
Class
APIResponse
src/anthropic/_response.py:297
↓ 12 callers
Class
AsyncAnthropicAWS
src/anthropic/lib/aws/_client.py:233
↓ 12 callers
Class
IdentityTokenFile
An :class:`IdentityTokenProvider` that reads a JWT from a file on every call. Kubernetes projected service-account tokens (and similar) are rotat
src/anthropic/lib/credentials/_providers.py:752
↓ 12 callers
Class
InMemoryConfig
An :class:`AccessTokenProvider` driven by an in-memory config dict (same shape as ``configs/<profile>.json``) rather than files on disk. Inte
src/anthropic/lib/credentials/_providers.py:798
↓ 11 callers
Class
AsyncAPIResponse
src/anthropic/_response.py:410
↓ 11 callers
Class
AsyncAnthropicFoundry
src/anthropic/lib/foundry.py:313
↓ 11 callers
Class
WorkloadIdentityError
Raised when the OIDC token exchange (``POST /v1/oauth/token``) fails.
src/anthropic/lib/credentials/_workload.py:110
↓ 10 callers
Class
AnthropicBedrock
src/anthropic/lib/bedrock/_client.py:132
↓ 10 callers
Class
AnthropicVertex
src/anthropic/lib/vertex/_client.py:92
↓ 10 callers
Class
AsyncAnthropicVertex
src/anthropic/lib/vertex/_client.py:256
↓ 10 callers
Class
BetaMemoryTool20250818InsertCommand
src/anthropic/types/beta/beta_memory_tool_20250818_insert_command.py:10
↓ 9 callers
Class
APIStatusError
Raised when an API response has a status code of 4xx or 5xx.
src/anthropic/_exceptions.py:70
↓ 9 callers
Class
FakeAsyncWork
tests/lib/environments/test_poller_method.py:68
↓ 9 callers
Class
FakeClock
tests/lib/test_credentials.py:1440
↓ 9 callers
Class
Querystring
src/anthropic/_qs.py:19
↓ 8 callers
Class
BetaManagedAgentsTextBlock
Regular text content.
src/anthropic/types/beta/sessions/beta_managed_agents_text_block.py:10
↓ 8 callers
Class
BetaMemoryTool20250818DeleteCommand
src/anthropic/types/beta/beta_memory_tool_20250818_delete_command.py:10
↓ 8 callers
Class
BetaMemoryTool20250818RenameCommand
src/anthropic/types/beta/beta_memory_tool_20250818_rename_command.py:10
↓ 8 callers
Class
BetaMemoryTool20250818StrReplaceCommand
src/anthropic/types/beta/beta_memory_tool_20250818_str_replace_command.py:10
↓ 8 callers
Class
FileStoreError
A refused operation — input the store will not act on. OS errors propagate as ``OSError``.
src/anthropic/lib/tools/_file_store.py:36
↓ 8 callers
Class
PageInfo
Stores the necessary information to build the request to retrieve the next page. Either `url` or `params` must be set.
src/anthropic/_base_client.py:135
↓ 7 callers
Class
User
tests/test_utils/test_json.py:25
↓ 7 callers
Class
_StubEvent
Stand-in for the various session event types — only the fields the runner reads are populated.
tests/lib/tools/test_session_runner.py:65
↓ 6 callers
Class
CountingProvider
tests/lib/test_credentials.py:1448
↓ 6 callers
Class
InspectResponse
Records the response wrapper returned by `call_next` and passes it through.
tests/test_middleware.py:253
↓ 6 callers
Class
JSONOutputFormatParam
src/anthropic/types/json_output_format_param.py:11
↓ 5 callers
Class
AsyncAnthropicBedrockMantle
src/anthropic/lib/bedrock/_mantle.py:360
↓ 5 callers
Class
AttemptRecorder
Records the `retries_taken` and response status of every attempt the chain runs for.
tests/test_middleware.py:196
↓ 5 callers
Class
Model
tests/test_models.py:162
↓ 5 callers
Class
_FakeStream
Stand-in for the AsyncStream returned by ``events.stream()``. Yields scripted events in order; once exhausted, blocks forever (the real strea
tests/lib/tools/test_session_runner.py:131
↓ 4 callers
Class
AWSEventStreamDecoder
src/anthropic/lib/bedrock/_stream_decoder.py:25
↓ 4 callers
Class
AsyncAnthropicBedrock
src/anthropic/lib/bedrock/_client.py:310
↓ 4 callers
Class
BetaJSONOutputFormatParam
src/anthropic/types/beta/beta_json_output_format_param.py:11
↓ 4 callers
Class
Exploding
tests/test_middleware.py:231
↓ 4 callers
Class
ModelFallback
tests/test_middleware.py:132
↓ 4 callers
Class
SessionToolRunner
Attach to a managed-agents session and dispatch its tool calls locally. The sessions-side counterpart to ``client.beta.messages.tool_runner``: an
src/anthropic/lib/tools/_beta_session_runner.py:362
↓ 4 callers
Class
UnsupportedMCPValueError
Raised when an MCP value cannot be converted to a format supported by the Claude API.
src/anthropic/lib/tools/mcp.py:126
↓ 4 callers
Class
_Lease
This worker's view of one work-item lease: whether it has ended, and why. Shared by :func:`_heartbeat_loop` and the code serving the item. The fi
src/anthropic/lib/environments/_worker.py:124
↓ 3 callers
Class
AsyncCallableMiddleware
A middleware object that is a class instance with an async `__call__` method.
tests/test_middleware.py:291
↓ 3 callers
Class
AsyncMessages
src/anthropic/lib/bedrock/_beta_messages.py:44
↓ 3 callers
Class
AsyncMessages
src/anthropic/lib/vertex/_beta_messages.py:45
↓ 3 callers
Class
AsyncMessagesWithRawResponse
src/anthropic/lib/vertex/_beta_messages.py:81
↓ 3 callers
Class
AsyncMessagesWithStreamingResponse
src/anthropic/lib/vertex/_beta_messages.py:99
↓ 3 callers
Class
AsyncServiceAccountsWithRawResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:766
↓ 3 callers
Class
AsyncServiceAccountsWithStreamingResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:808
↓ 3 callers
Class
AsyncStream
Provides the core interface to iterate over an asynchronous stream response.
src/anthropic/_streaming.py:169
↓ 3 callers
Class
BetaLocalFilesystemMemoryTool
File-based memory storage implementation for Claude conversations
src/anthropic/lib/tools/_beta_builtin_memory_tool.py:378
↓ 3 callers
Class
BetaUsage
src/anthropic/types/beta/beta_usage.py:16
↓ 3 callers
Class
Boom
tests/test_middleware.py:227
↓ 3 callers
Class
EnvToken
An :class:`AccessTokenProvider` that reads ``ANTHROPIC_AUTH_TOKEN`` at call time.
src/anthropic/lib/credentials/_providers.py:129
↓ 3 callers
Class
Messages
src/anthropic/lib/bedrock/_beta_messages.py:18
↓ 3 callers
Class
Messages
src/anthropic/lib/vertex/_beta_messages.py:18
↓ 3 callers
Class
MessagesWithRawResponse
src/anthropic/lib/vertex/_beta_messages.py:72
↓ 3 callers
Class
MessagesWithStreamingResponse
src/anthropic/lib/vertex/_beta_messages.py:90
↓ 3 callers
Class
MissingDependencyError
src/anthropic/lib/_extras/_common.py:11
↓ 3 callers
Class
P
tests/lib/test_credentials.py:1497
↓ 3 callers
Class
ParsedBetaMessage
src/anthropic/types/beta/parsed_beta_message.py:67
↓ 3 callers
Class
SSEDecoder
src/anthropic/_streaming.py:369
↓ 3 callers
Class
ServiceAccountsWithRawResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:745
↓ 3 callers
Class
ServiceAccountsWithStreamingResponse
src/anthropic/resources/beta/organization/workspaces/service_accounts.py:787
↓ 3 callers
Class
SessionMemoryError
A memory store could not be materialised on disk. Raised by :meth:`SessionMemoryStores.download`; the worker lets it fail the work item.
src/anthropic/lib/tools/_memories.py:117
↓ 3 callers
Class
Stream
Provides the core interface to iterate over a synchronous stream response.
src/anthropic/_streaming.py:22
↓ 3 callers
Class
SyncCallableMiddleware
A middleware object that is a class instance with a sync `__call__` method.
tests/test_middleware.py:302
↓ 3 callers
Class
_FakeClient
Minimal stand-in for ``AsyncAnthropic`` — only exposes the resource path the runner reads.
tests/lib/tools/test_session_runner.py:268
↓ 3 callers
Class
_SyncTool
A real ``BetaBuiltinFunctionTool``, unlike ``_FakeTool``, so ``run_runnable_tool`` takes its sync-tool branch.
tests/lib/tools/test_session_runner.py:251
↓ 3 callers
Class
_TaggedDict
A dict subclass that can carry a ``_stainless_helper`` attribute. Behaves identically to a regular dict for serialization and isinstance checks,
src/anthropic/lib/tools/mcp.py:96
↓ 2 callers
Class
APIConnectionError
src/anthropic/_exceptions.py:94
next →
1–100 of 2,013, ranked by callers