from anthropic.types import (
APIErrorObject,
AuthenticationError,
BillingError,
ErrorObject,
ErrorResponse,
GatewayTimeoutError,
InvalidRequestError,
NotFoundError,
OverloadedError,
PermissionError,
RateLimitError,
)
Types:
from anthropic.types import (
Base64PDFSource,
CacheControlEphemeral,
ContentBlock,
ContentBlockDeltaEvent,
ContentBlockParam,
ContentBlockStartEvent,
ContentBlockStopEvent,
DocumentBlockParam,
ImageBlockParam,
InputJSONDelta,
Message,
MessageDeltaEvent,
MessageDeltaUsage,
MessageParam,
MessageStartEvent,
MessageStopEvent,
MessageStreamEvent,
MessageTokensCount,
Metadata,
Model,
RawContentBlockDeltaEvent,
RawContentBlockStartEvent,
RawContentBlockStopEvent,
RawMessageDeltaEvent,
RawMessageStartEvent,
RawMessageStopEvent,
RawMessageStreamEvent,
TextBlock,
TextBlockParam,
TextDelta,
Tool,
ToolChoice,
ToolChoiceAny,
ToolChoiceAuto,
ToolChoiceTool,
ToolResultBlockParam,
ToolUseBlock,
ToolUseBlockParam,
Usage,
)
Methods:
client.messages.create(**params) -> Message
client.messages.stream(*args) -> MessageStreamManager[MessageStream] | MessageStreamManager[MessageStreamT]
client.messages.count_tokens(**params) -> MessageTokensCount
Types:
from anthropic.types.messages import (
MessageBatch,
MessageBatchCanceledResult,
MessageBatchErroredResult,
MessageBatchExpiredResult,
MessageBatchIndividualResponse,
MessageBatchRequestCounts,
MessageBatchResult,
MessageBatchSucceededResult,
)
Methods:
client.messages.batches.create(**params) -> MessageBatch
client.messages.batches.retrieve(message_batch_id) -> MessageBatch
client.messages.batches.list(**params) -> SyncPage[MessageBatch]
client.messages.batches.cancel(message_batch_id) -> MessageBatch
client.messages.batches.results(message_batch_id) -> BinaryAPIResponse
Types:
from anthropic.types import ModelInfo
Methods:
client.models.retrieve(model_id) -> ModelInfo
client.models.list(**params) -> SyncPage[ModelInfo]
Types:
from anthropic.types import (
AnthropicBeta,
BetaAPIError,
BetaAuthenticationError,
BetaBillingError,
BetaError,
BetaErrorResponse,
BetaGatewayTimeoutError,
BetaInvalidRequestError,
BetaNotFoundError,
BetaOverloadedError,
BetaPermissionError,
BetaRateLimitError,
)
Types:
from anthropic.types.beta import BetaModelInfo
Methods:
client.beta.models.retrieve(model_id) -> BetaModelInfo
client.beta.models.list(**params) -> SyncPage[BetaModelInfo]
Types:
from anthropic.types.beta import (
BetaBase64PDFBlock,
BetaBase64PDFSource,
BetaCacheControlEphemeral,
BetaContentBlock,
BetaContentBlockParam,
BetaImageBlockParam,
BetaInputJSONDelta,
BetaMessage,
BetaMessageDeltaUsage,
BetaMessageParam,
BetaMessageTokensCount,
BetaMetadata,
BetaRawContentBlockDeltaEvent,
BetaRawContentBlockStartEvent,
BetaRawContentBlockStopEvent,
BetaRawMessageDeltaEvent,
BetaRawMessageStartEvent,
BetaRawMessageStopEvent,
BetaRawMessageStreamEvent,
BetaTextBlock,
BetaTextBlockParam,
BetaTextDelta,
BetaTool,
BetaToolBash20241022,
BetaToolChoice,
BetaToolChoiceAny,
BetaToolChoiceAuto,
BetaToolChoiceTool,
BetaToolComputerUse20241022,
BetaToolResultBlockParam,
BetaToolTextEditor20241022,
BetaToolUnion,
BetaToolUseBlock,
BetaToolUseBlockParam,
BetaUsage,
)
Methods:
client.beta.messages.create(**params) -> BetaMessage
client.beta.messages.count_tokens(**params) -> BetaMessageTokensCount
Types:
from anthropic.types.beta.messages import (
BetaMessageBatch,
BetaMessageBatchCanceledResult,
BetaMessageBatchErroredResult,
BetaMessageBatchExpiredResult,
BetaMessageBatchIndividualResponse,
BetaMessageBatchRequestCounts,
BetaMessageBatchResult,
BetaMessageBatchSucceededResult,
)
Methods:
client.beta.messages.batches.create(**params) -> BetaMessageBatch
client.beta.messages.batches.retrieve(message_batch_id) -> BetaMessageBatch
client.beta.messages.batches.list(**params) -> SyncPage[BetaMessageBatch]
client.beta.messages.batches.cancel(message_batch_id) -> BetaMessageBatch
client.beta.messages.batches.results(message_batch_id) -> BinaryAPIResponse