Skip to main content

Module types

Module types 

Source
Expand description

Foundational shared types used across every API resource.

TypePurpose
ModelIdString-newtype for model identifiers; common models as associated constants
Roleuser / assistant message role
UsageToken counts returned with every Message response
StopReasonWhy the model stopped generating (end_turn, max_tokens, tool_use, …)
ServiceTierstandard / priority / batch service tier on the response

Structs§

CacheCreationBreakdown
Per-TTL breakdown of cache-creation tokens.
ModelId
Identifier for a Claude model.
ServerToolUseUsage
Counters for server-side tool invocations billed on this request.
Usage
Token usage and related counters returned on every response.

Enums§

Role
Conversation role for a message.
ServiceTier
Service tier reported on a response.
StopReason
Why the model stopped producing output.