Supported Models
Relevant source files
The following files were used as context for generating this wiki page:
The Anthropic Go SDK provides comprehensive support for interacting with various Claude models. This system includes services for retrieving specific model information, listing available models, and defining model capabilities such as context management, effort levels, and specialized input/output features.
The SDK supports models across multiple platforms, including Anthropic's native API, Amazon Bedrock, and Google Vertex AI. Users can identify models via predefined constants or string identifiers when creating messages.
Model Service Architecture
The SDK implements model interaction through a service-oriented architecture. Both standard and beta versions of the model service exist to manage model data and discovery.
Service Structure and Logic
The ModelService and BetaModelService provide methods to interact with the /v1/models endpoint. These services handle the logic for applying request options and executing HTTP requests to fetch model metadata.
The diagram shows the relationship between the service layers and the data models they return.
Sources: model.go:27-111, betamodel.go:27-109
Model Capabilities
Models are defined not just by their IDs, but by a granular set of capabilities that dictate what features are available for a given request.
Capability Categories
The ModelCapabilities structure tracks support for specific API features:
- Input Support: Image and PDF input capabilities.
- Feature Support: Batch API, Citations, and Code Execution.
- Output Support: Structured outputs and reasoning effort levels.
- Thinking: Support for extended thinking (reasoning) with adaptive or enabled modes.
Reasoning Effort and Context Management
Models can support different levels of reasoning effort (low, medium, high, max) and various context management strategies such as compaction or clearing tool uses.
| Capability | Description | Source |
|---|---|---|
Batch | Whether the model supports the Batch API. | model.go:167 |
Citations | Support for citation generation. | model.go:169 |
StructuredOutputs | Support for JSON mode or strict tool schemas. | model.go:181 |
Thinking | Support for extended thinking/reasoning blocks. | model.go:183 |
Effort | Available reasoning effort levels (low, medium, high, max). | model.go:145-162 |
Sources: model.go:133-214, betamodel.go:131-212
Platform Integration
The SDK allows using models hosted on different cloud providers by providing specialized clients and model identifier formats.
Anthropic Native, Bedrock, and Vertex AI
While the native API uses standard model names like claude-3-5-sonnet, providers like Bedrock and Vertex require specific string formats.
The flowchart illustrates how different model identifiers are routed through the unified client interface depending on the provider configuration.
Sources: examples/message/main.go:20, examples/bedrock/main.go:26, examples/vertex/main.go:24
Model Discovery Flow
The sequence for discovering and using a model typically involves listing available models or fetching details for a specific model ID.
Sources: model.go:44-98
Technical Specifications
ModelInfo Structure
The following table describes the fields returned when querying model information.
| Field | Type | Description |
|---|---|---|
id | string | Unique model identifier. |
display_name | string | Human-readable name. |
max_input_tokens | int64 | Maximum input context window size. |
max_tokens | int64 | Absolute maximum tokens the model can generate. |
capabilities | struct | Detailed feature support flags. |
created_at | time.Time | RFC 3339 release datetime. |
Sources: model.go:216-250, betamodel.go:214-248
Predefined Model Constants
The SDK provides typed constants for commonly used models to ensure type safety during message creation.
anthropic.ModelClaudeSonnet4_5_20250929anthropic.ModelClaudeOpus4_6
Sources: README.md:46, examples/message/main.go:20
The Supported Models system in the Anthropic Go SDK ensures developers can programmatically discover model capabilities and integrate with Claude across various cloud environments using a standardized metadata format.