Plugins
Anthropic
Anthropic Claude LLM via the Messages API.
The Anthropic plugin provides an LLM over the Anthropic Messages API.
Capabilities
LLM
Install & import
import "github.com/webdeveloperben/agents-go/plugins/anthropic"
// or, for model-spec strings only:
import _ "github.com/webdeveloperben/agents-go/plugins/anthropic"No build tag. Pure Go (HTTP).
Model specs
Registered as anthropic (alias claude).
| Spec | Resolves to |
|---|---|
anthropic/claude-sonnet-4-6 | chat LLM |
claude/claude-3-5-haiku | same provider via the alias |
session, _ := agents.NewSession(agents.Config{LLM: "anthropic/claude-sonnet-4-6"})Constructors & options
func NewLLM(opts LLMOptions) (*LLM, error)| Field | Notes |
|---|---|
Model | Defaults to claude-sonnet-4-6. |
APIKey | Falls back to ANTHROPIC_API_KEY. |
BaseURL | Override the API base URL. |
MaxTokens | Max output tokens (int64). |
HTTPClient | Custom *http.Client. |
llm, err := anthropic.NewLLM(anthropic.LLMOptions{Model: "claude-sonnet-4-6", MaxTokens: 1024})Credentials
Reads ANTHROPIC_API_KEY, or pass APIKey explicitly.
Related
- Models & providers — the model system.
- Reference: Models · Writing a plugin