---
layout: default
title: Anthropic
parent: Providers
nav_order: 3
description: Experience the Claude family of models with native support for PDF document analysis, advanced reasoning, and long-context capabilities.
---

# {{ page.title }} <span style="background-color: #0d9488; color: white; padding: 1px 6px; border-radius: 3px; font-size: 0.65em; font-weight: 600; vertical-align: middle;">v1.0.0+</span>
{: .no_toc }

{{ page.description }}
{: .fs-6 .fw-300 }

## Table of contents
{: .no_toc .text-delta }

1. TOC
{:toc}

---

The Anthropic provider gives access to the Claude family of models, known for high-quality reasoning and coding capabilities.

---

## Configuration

```ts
import { createLLM } from "@node-llm/core";

const llm = createLLM({ 
  provider: "anthropic", 
  anthropicApiKey: process.env.ANTHROPIC_API_KEY // Optional if set in env 
});
```

---

## Specific Parameters

You can pass Anthropic-specific parameters or custom headers.

```ts
const chat = llm.chat("claude-3-5-sonnet-20241022").withParams({
  top_k: 50,
  top_p: 0.9,
  // Custom headers if needed
  headers: {
    "anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15"
  }
});
```

---

## Features

- **Models**: `claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-opus`, `claude-3-haiku`.
- **Vision**: Analyzes images.
- **PDF Support**: Can read and analyze PDF documents natively.
- **Tools**: Fully supported.
- **Reasoning**: Support for Extended Thinking and token-based pricing for `claude-3-7`.

---

## PDF Support

Anthropic supports sending PDF files as base64 encoded blocks, which `NodeLLM` handles automatically.

```ts
await chat.ask("Summarize this document", {
  files: ["./report.pdf"]
});
```

---

## Getting an API Key

Sign up and get your API key at [console.anthropic.com](https://console.anthropic.com).
