🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@anthropic-ai/sdk

Package Overview
Dependencies
Maintainers
14
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anthropic-ai/sdk

The official TypeScript library for the Anthropic API

Source
npmnpm
Version
0.95.2
Version published
Weekly downloads
23M
0.36%
Maintainers
14
Weekly downloads
 
Created
Source

Claude SDK for TypeScript

NPM version

The Claude SDK for TypeScript provides access to the Claude API from server-side TypeScript or JavaScript applications.

Documentation

Full documentation is available at platform.claude.com/docs/en/api/sdks/typescript.

Installation

npm install @anthropic-ai/sdk

Getting started

import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted
});

const message = await client.messages.create({
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello, Claude' }],
  model: 'claude-opus-4-6',
});

console.log(message.content);

Requirements

Node.js 18+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the MIT License. See the LICENSE file for details.

FAQs

Package last updated on 11 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts