Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.elizaos.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Anthropic plugin provides access to Claude models for text generation. Note that it does not support embeddings, so you’ll need a fallback plugin.

Features

  • Claude 3 models - Access to Claude 3 Opus, Sonnet, and Haiku
  • Long context - Up to 200k tokens context window
  • XML formatting - Optimized for structured responses
  • Safety features - Built-in content moderation

Installation

elizaos plugins add @elizaos/plugin-anthropic

Configuration

Environment Variables

# Required
ANTHROPIC_API_KEY=sk-ant-...

# Optional model configuration
# You can use any available Anthropic model
ANTHROPIC_SMALL_MODEL=claude-3-haiku-20240307      # Default: claude-3-haiku-20240307
ANTHROPIC_LARGE_MODEL=claude-3-5-sonnet-latest     # Default: claude-3-5-sonnet-latest

# Examples of other available models:
# ANTHROPIC_SMALL_MODEL=claude-3-haiku-20240307
# ANTHROPIC_LARGE_MODEL=claude-3-opus-20240229
# ANTHROPIC_LARGE_MODEL=claude-3-5-sonnet-20241022
# ANTHROPIC_LARGE_MODEL=claude-3-5-haiku-20241022

Character Configuration

{
  "name": "MyAgent",
  "plugins": [
    "@elizaos/plugin-anthropic",
    "@elizaos/plugin-openai"  // For embeddings
  ]
}

Supported Operations

OperationSupportNotes
TEXT_GENERATIONAll Claude models
EMBEDDINGUse fallback plugin
OBJECT_GENERATIONVia XML formatting

Important: Embedding Fallback

Since Anthropic doesn’t provide embedding models, always include a fallback:
{
  "plugins": [
    "@elizaos/plugin-anthropic",  // Primary for text
    "@elizaos/plugin-openai"       // Fallback for embeddings
  ]
}

Model Configuration

The plugin uses two model categories:
  • SMALL_MODEL: For faster, cost-effective responses
  • LARGE_MODEL: For complex reasoning and best quality
You can use any available Claude model, including:
  • Claude 3.5 Sonnet (latest and dated versions)
  • Claude 3 Opus, Sonnet, and Haiku
  • Claude 3.5 Haiku
  • Any new models Anthropic releases

Usage Tips

  1. XML Templates - Claude excels at XML-formatted responses
  2. System Prompts - Effective for character personality
  3. Context Management - Leverage the 200k token window

External Resources