New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@ai-sdk/anthropic

Package Overview
Dependencies
Maintainers
3
Versions
606
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/anthropic

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).

Source
npmnpm
Version
3.0.35
Version published
Weekly downloads
11M
68.58%
Maintainers
3
Weekly downloads
 
Created
Source

AI SDK - Anthropic Provider

The Anthropic provider for the AI SDK contains language model support for the Anthropic Messages API.

Setup

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

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:

npx skills add vercel/ai

Provider Instance

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

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

Example

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 for more information.

Keywords

ai

FAQs

Package last updated on 01 Feb 2026

Related posts