Overview

Purpose and Scope

This repository is the home of Anthropic’s official TypeScript library for the Claude API. The main package is intended for server-side TypeScript and JavaScript applications that need to call Claude through the direct Anthropic API, while the same repository also contains provider-specific packages for Claude access through managed cloud platforms. For a new developer, the most important orientation is that the root SDK gives the canonical client and generated API surface, and the provider packages adapt that client model to Bedrock, Vertex AI, and Microsoft Foundry deployment environments. Sources: README.md, package.json, packages/bedrock-sdk/README.md, packages/vertex-sdk/README.md, packages/foundry-sdk/README.md

The first-party Claude documentation describes the product surface in terms of model capabilities, tools, tool infrastructure, context management, and files or assets. This SDK repository is the TypeScript implementation layer that makes those areas usable from applications. The README’s first example starts with a single client, then calls the Messages API with a model, a user message, and a token limit. That is the simplest mental model for the repository: construct an Anthropic client, select the Claude feature surface you need, and call the generated resource method that corresponds to the API operation. Sources: README.md, api.md

Relevant Source Files

  • README.md — Introduces the main Claude SDK for TypeScript, installation command, first Messages API example, supported runtimes, TypeScript requirement, browser-safety note, contributing pointer, and license.
  • package.json — Defines the published root package metadata, package name, version, description, entrypoints, exports, scripts, CLI binary, dependencies, peer dependency on Zod, and browser substitution mappings.
  • api.md — Serves as the repository-level generated API reference target for the SDK surface and is the natural companion to user-facing overview and reference pages.
  • packages/bedrock-sdk/README.md — Documents the AWS Bedrock package, installation command, Bedrock client name, AWS credential behavior, custom credential resolver option, and runtime requirements.
  • packages/vertex-sdk/README.md — Documents the Google Vertex package, installation command, Vertex client name, project and region configuration, default Google authentication, custom GoogleAuth configuration, and preconfigured AuthClient option.
  • packages/foundry-sdk/README.md — Documents the Microsoft Foundry package, installation command, Foundry client name, API-key authentication, Azure AD token provider authentication, resource configuration, and deployment-oriented URL behavior.

Package Family

The root package is published as the official TypeScript library for the Anthropic API. Its package metadata declares the public package name, the CommonJS main entrypoint, TypeScript declarations, public publishing configuration, and dual import and require exports for the built distribution. That metadata matters because most consumers interact with this repository through the published package rather than local source files. The root package also declares the command-line binary name and build, test, format, lint, and prepare scripts, which together show that the repository is maintained as a generated, packaged SDK rather than a small handwritten API wrapper. Sources: package.json

The direct Claude API package should be the default choice when an application is calling Anthropic at the normal API endpoint with an Anthropic API key. The README installs it with npm, imports the default Anthropic client, and relies on the standard environment variable for the API key unless a caller explicitly passes one. The first example calls the Messages API using a current Claude model name, a list of conversation messages, and a maximum token budget. That example establishes the common calling convention reused throughout the SDK: request objects are ordinary JavaScript objects, and response content is available on the returned message object. Sources: README.md

The Bedrock package is a sibling package for teams that access Claude through AWS Bedrock instead of the direct Anthropic API. Its README explicitly points direct API users back to the root package, then shows an AnthropicBedrock client and a Bedrock-style model identifier. It assumes AWS credentials are configured through mechanisms recognized by the AWS Node SDK, such as a shared credentials file or access-key environment variables. It also documents a custom credential provider pattern for non-Node environments where the default AWS credential provider chain is not available, which is important for edge deployments and other constrained runtimes. Sources: packages/bedrock-sdk/README.md

The Vertex package is the Google Cloud counterpart. It provides an AnthropicVertex client for Claude through Google Vertex AI, and its example explains that region and project information can come from environment variables while authentication flows through Google’s standard authentication library. The README gives three levels of authentication control: default authentication, custom GoogleAuth configuration with scopes and key files, and a preconfigured AuthClient for advanced scenarios such as service-account impersonation. This means users can keep the same Messages API programming style while letting Google Cloud identity and project routing determine how requests reach Claude. Sources: packages/vertex-sdk/README.md

The Foundry package supports Claude through Microsoft Azure AI Foundry. Its README presents an AnthropicFoundry client that can authenticate with an API key or with an Azure AD token provider created from Azure identity libraries. It also requires a resource value identifying the Azure-hosted Anthropic resource. The deployment note is especially useful for platform teams: when a model deployment is configured, the SDK can construct the deployment-specific messages path. In practice, this package lets developers retain Claude request shapes while aligning authentication and routing with Microsoft Foundry operational controls. Sources: packages/foundry-sdk/README.md

Core Primitives

The core primitive across the repository is the client object. In the direct package, that object is Anthropic; in the provider packages, it is AnthropicBedrock, AnthropicVertex, or AnthropicFoundry. The client owns authentication, base routing, runtime behavior, and resource namespaces. The next primitive is the resource method, with messages.create shown in every provider README excerpt. A resource method accepts a typed request object and returns the API response object. Model identifiers are another primitive, but they vary by platform: the direct API, Bedrock, Vertex AI, and Foundry examples use provider-specific model naming conventions. Sources: README.md, packages/bedrock-sdk/README.md, packages/vertex-sdk/README.md, packages/foundry-sdk/README.md

Configuration is also a first-class primitive. The direct SDK example shows an API key option that defaults from the Anthropic API key environment variable. Bedrock configuration can rely on AWS credential discovery or a custom provider-chain resolver. Vertex configuration can rely on Google default authentication, explicit region and project values, a GoogleAuth object, or a preconfigured AuthClient. Foundry configuration uses a resource plus either an API key or an Azure AD token provider. Those differences are not incidental; they are the main reason the repository publishes separate provider packages instead of forcing all cloud routing through one constructor. Sources: README.md, packages/bedrock-sdk/README.md, packages/vertex-sdk/README.md, packages/foundry-sdk/README.md

Getting Started Flow

A typical first integration begins with the direct SDK unless the deployment environment already mandates Bedrock, Vertex AI, or Microsoft Foundry. Install the root package, create the client, and make a Messages API request. From there, move outward by adding request options, streaming, tool use, structured outputs, files, or managed-agent APIs as needed. The overview page in the official Claude docs is useful for deciding which capability area to explore next, but the SDK’s README gives the practical starting point: one package install, one client constructor, and one call to create a message. Sources: README.md

npm install @anthropic-ai/sdk
import Anthropic from '@anthropic-ai/sdk';
 
const client = new Anthropic({
  apiKey: process.env['ANTHROPIC_API_KEY'],
});
 
const message = await client.messages.create({
  model: 'claude-opus-4-6',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello, Claude' }],
});
 
console.log(message.content);

If the same application must run against a cloud provider surface, choose the provider package before copying request code. Bedrock users install the Bedrock package and configure AWS credentials or a custom credential resolver. Vertex users install the Vertex package and provide or discover Google Cloud project, region, and authentication state. Foundry users install the Foundry package and provide the Azure resource plus an API key or token provider. After that provider-specific setup, the examples return to the familiar messages.create shape, so most application logic can remain organized around Claude requests and responses. Sources: packages/bedrock-sdk/README.md, packages/vertex-sdk/README.md, packages/foundry-sdk/README.md

Runtime and Packaging Signals

The README states that the main SDK supports TypeScript 4.9 or newer and a range of server-side JavaScript runtimes, including modern Node.js, Deno, Bun, Cloudflare Workers, Vercel Edge Runtime, Jest with the node environment, and Nitro. Browser use is intentionally disabled by default to avoid exposing secret API credentials, and React Native is not supported. The provider package READMEs list similar modern runtimes with TypeScript 4.5 or newer. These requirements help readers decide whether to use the package directly, run it in an edge environment, or keep API calls on a server boundary. Sources: README.md, packages/bedrock-sdk/README.md, packages/vertex-sdk/README.md

Packaging metadata confirms that the root package is distributed with both import and require entrypoints, plus wildcard exports for built files. It also declares an optional peer dependency on Zod, which is relevant to helper APIs that integrate schemas and typed structured outputs elsewhere in the SDK. The browser field remaps selected agent-toolset and memory tool modules to browser-specific builds, while the README still warns that browser support requires an explicit opt-in. Taken together, the package is designed for broad JavaScript compatibility without weakening the default credential-safety posture. Sources: package.json, README.md

Next Steps

After this overview, new users should read Installation and Requirements, then Quickstart: Messages, then Authentication and Client Configuration. Application teams that already know their hosting platform should jump to the provider page matching their deployment: Amazon Bedrock SDK, Google Vertex SDK, or Microsoft Foundry SDK. Teams exploring Claude capabilities should continue into Messages API, Streaming Responses, Tool Use Overview, Structured Outputs, Files and Uploads, and Managed Agents Overview. The generated API reference remains the place to check exact resource names, request objects, response objects, and package exports when moving from examples to production code. Sources: README.md, api.md