agents-go
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).

SpecResolves to
anthropic/claude-sonnet-4-6chat LLM
claude/claude-3-5-haikusame provider via the alias
session, _ := agents.NewSession(agents.Config{LLM: "anthropic/claude-sonnet-4-6"})

Constructors & options

func NewLLM(opts LLMOptions) (*LLM, error)
FieldNotes
ModelDefaults to claude-sonnet-4-6.
APIKeyFalls back to ANTHROPIC_API_KEY.
BaseURLOverride the API base URL.
MaxTokensMax output tokens (int64).
HTTPClientCustom *http.Client.
llm, err := anthropic.NewLLM(anthropic.LLMOptions{Model: "claude-sonnet-4-6", MaxTokens: 1024})

Credentials

Reads ANTHROPIC_API_KEY, or pass APIKey explicitly.

On this page