Anthropic
- Create an account at https://console.anthropic.com/
- Go to https://console.anthropic.com/account/keys and get your api key
- You will need to set the following environment variable to your key or you can set it to
user_providedfor users to provide their own.
.env
ANTHROPIC_API_KEY=user_provided- You can determine which models you would like to have available with
ANTHROPIC_MODELS.
.env
ANTHROPIC_MODELS=claude-3-opus-20240229,claude-3-sonnet-20240229,claude-3-haiku-20240307,claude-2.1,claude-2,claude-1.2,claude-1,claude-1-100k,claude-instant-1,claude-instant-1-100kNotes:
- Anthropic endpoint supports all Shared Endpoint Settings via the
librechat.yamlconfiguration file, includingstreamRate,titleModel,titleMethod,titlePrompt,titlePromptTemplate, andtitleEndpoint
Vertex AI
LibreChat supports running Anthropic Claude models through Google Cloud Vertex AI. This is useful if you:
- Already have Google Cloud infrastructure
- Want to use your existing GCP billing and credentials
- Need to comply with regional data residency requirements
Quick Setup (Environment Variables)
Set the following environment variables to enable Anthropic via Vertex AI:
.env
# Enable Vertex AI mode for Anthropic
ANTHROPIC_USE_VERTEX=true
# Vertex AI region (optional, defaults to 'us-east5')
# Available regions: global, us-east5, us-central1, europe-west1, europe-west4, asia-southeast1
ANTHROPIC_VERTEX_REGION=global
# Path to Google service account key file (optional)
# If not specified, uses default path: api/data/auth.json
GOOGLE_SERVICE_KEY_FILE=/path/to/service-account.jsonPrerequisites
- Google Cloud Project with Vertex AI API enabled
- Service Account with the following roles:
Vertex AI User(roles/aiplatform.user)- Or
Vertex AI Administratorfor full access
- Claude models enabled in your Vertex AI Model Garden
- Service Account Key (JSON file) downloaded and accessible to LibreChat
Advanced Configuration
For model name mapping and advanced settings (similar to Azure OpenAI configuration), use the librechat.yaml file:
librechat.yaml
endpoints:
anthropic:
vertex:
region: us-east5
models:
claude-opus-4.5:
deploymentName: claude-opus-4-5@20251101
claude-sonnet-4:
deploymentName: claude-sonnet-4-20250514
claude-3.5-haiku:
deploymentName: claude-3-5-haiku@20241022For detailed YAML configuration options, see Anthropic Vertex AI Configuration.