# @ai-sdk/anthropic

Latest version **4.0.53** (published 2026-09-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ai-sdk/anthropic
pnpm add @ai-sdk/anthropic
yarn add @ai-sdk/anthropic
bun add @ai-sdk/anthropic
```

## Health

**Score 80/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.53 |
| Published | 2026-09-11 |
| First published | 2024-04-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 2 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 26708 |
| Maintainers | vercel-release-bot, matheuss, matt.straka |
| Keywords | ai |

## Links

- npm: https://www.npmjs.com/package/@ai-sdk/anthropic
- Repository: https://github.com/vercel/ai
- Homepage: https://ai-sdk.dev/docs
- Issues: https://github.com/vercel/ai/issues
- npm.io page: https://npm.io/package/@ai-sdk/anthropic

## Dependencies (2)

- [@ai-sdk/provider](https://npm.io/package/@ai-sdk/provider.md) 4.0.14
- [@ai-sdk/provider-utils](https://npm.io/package/@ai-sdk/provider-utils.md) 5.0.40

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 4.0.53 (latest) — 2026-09-11
- 3.0.118 (ai-v6) — 2026-09-11
- 2.0.102 (ai-v5) — 2026-09-09
- 0.0.0-f1630544-20260811180950 (snapshot) — 2026-08-11
- 4.0.0-beta.69 (beta) — 2026-06-24
- 4.0.0-canary.66 (canary) — 2026-06-12
- 2.0.0-alpha.15 (alpha) — 2025-06-18
- 4.0.52 — 2026-09-09
- 4.0.51 — 2026-09-09
- 3.0.117 — 2026-09-09
- 4.0.50 — 2026-09-08
- 4.0.49 — 2026-09-02
- 3.0.116 — 2026-09-02
- 4.0.48 — 2026-09-02
- 2.0.101 — 2026-09-02
- … 590 more at https://npm.io/package/@ai-sdk/anthropic/versions

## README

# AI SDK - Anthropic Provider

The **[Anthropic provider](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the [Anthropic Messages API](https://docs.anthropic.com/claude/reference/messages_post).

> **Deploying to Vercel?** With Vercel's AI Gateway you can access Anthropic (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).

## Setup

The Anthropic provider is available in the `@ai-sdk/anthropic` module. You can install it with

```bash
npm i @ai-sdk/anthropic
```

## Skill for Coding Agents

If you use coding agents such as Claude Code or Cursor, we highly recommend adding the AI SDK skill to your repository:

```shell
npx skills add vercel/ai
```

## Provider Instance

You can import the default provider instance `anthropic` from `@ai-sdk/anthropic`:

```ts
import { anthropic } from '@ai-sdk/anthropic';
```

## Example

```ts
import { anthropic } from '@ai-sdk/anthropic';
import { generateText } from 'ai';

const { text } = await generateText({
  model: anthropic('claude-3-haiku-20240307'),
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
});
```

## Documentation

Please check out the **[Anthropic provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/anthropic)** for more information.

---
_Source: https://npm.io/package/@ai-sdk/anthropic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
