# Anthropic (/docs/configuration/pre_configured_ai/anthropic)

- Create an account at **[https://platform.claude.com/](https://platform.claude.com/)**
- Go to **[https://platform.claude.com/settings/keys](https://platform.claude.com/settings/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_provided` for users to provide their own.

```bash filename=".env"
ANTHROPIC_API_KEY=user_provided
```

- You can determine which models you would like to have available with `ANTHROPIC_MODELS`.

```bash filename=".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-100k
```

**Notes:**

- Anthropic endpoint supports all [Shared Endpoint Settings](/docs/configuration/librechat_yaml/object_structure/shared_endpoint_settings) via the `librechat.yaml` configuration file, including `streamRate`, `titleModel`, `titleMethod`, `titlePrompt`, `titlePromptTemplate`, and `titleEndpoint`

---

## 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:

```bash filename=".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.json
```

### Prerequisites

1. **Google Cloud Project** with Vertex AI API enabled
2. **Service Account** with the following roles:
   - `Vertex AI User` (`roles/aiplatform.user`)
   - Or `Vertex AI Administrator` for full access
3. **Claude models** enabled in your Vertex AI Model Garden
4. **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:

```yaml filename="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@20241022
```

For detailed YAML configuration options, see [Anthropic Vertex AI Configuration](/docs/configuration/librechat_yaml/object_structure/anthropic_vertex).