Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anthropic-ai/vertex-sdk

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anthropic-ai/vertex-sdk

The official TypeScript library for the Anthropic Vertex API

  • 0.5.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by11.51%
Maintainers
0
Weekly downloads
 
Created
Source

Anthropic Vertex TypeScript API Library

NPM version

This library provides convenient access to the Anthropic Vertex API.

For the non-Vertex Anthropic API at api.anthropic.com, see @anthropic-ai/sdk.

Installation

npm install @anthropic-ai/vertex-sdk

Usage

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

// Reads from the `CLOUD_ML_REGION` & `ANTHROPIC_VERTEX_PROJECT_ID` environment variables.
// Additionally goes through the standard `google-auth-library` flow.
const client = new AnthropicVertex();

async function main() {
  const result = await client.messages.create({
    messages: [
      {
        role: 'user',
        content: 'Hey Claude!',
      },
    ],
    model: 'claude-3-sonnet@20240229',
    max_tokens: 300,
  });
  console.log(JSON.stringify(result, null, 2));
}

main();

For more details on how to use the SDK, see the README.md for the main Anthropic SDK which this library extends.

Requirements

TypeScript >= 4.5 is supported.

The following runtimes are supported:

  • Node.js 18 LTS or later (non-EOL) versions.
  • Deno v1.28.0 or higher, using import { AnthropicVertex } from "npm:@anthropic-ai/vertex-sdk".
  • Bun 1.0 or later.
  • Cloudflare Workers.
  • Vercel Edge Runtime.
  • Jest 28 or greater with the "node" environment ("jsdom" is not supported at this time).
  • Nitro v2.6 or greater.

Note that React Native is not supported at this time.

If you are interested in other runtime environments, please open or upvote an issue on GitHub.

FAQs

Package last updated on 05 Nov 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc