Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
".": "0.87.0",
"packages/vertex-sdk": "0.15.0",
".": "0.88.0",
"packages/vertex-sdk": "0.16.0",
"packages/bedrock-sdk": "0.28.1",
"packages/foundry-sdk": "0.2.3",
"packages/aws-sdk": "0.2.5"
Expand Down
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 72
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-d87d3ef6f636c667a0256be82cebef0699d17403d409c26ec15813683cfc3263.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic%2Fanthropic-dfe504526eed07979685a729ac9afd45e59cc2879291714b9f4674f2ef1247c7.yml
openapi_spec_hash: d849fdf2c4dd6631a60c4340e9bc1322
config_hash: 062be10c6bf39b6719b3a5ea2bf758b3
config_hash: 831f90480c5b2b863b726e89eabaa90c
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.88.0 (2026-04-10)

Full Changelog: [sdk-v0.87.0...sdk-v0.88.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.87.0...sdk-v0.88.0)

### Features

* vertex eu region ([#882](https://github.com/anthropics/anthropic-sdk-typescript/issues/882)) ([1933857](https://github.com/anthropics/anthropic-sdk-typescript/commit/193385760676b1c941a1f500aa91d0f7a3204b40))


### Documentation

* improve examples ([de4f483](https://github.com/anthropics/anthropic-sdk-typescript/commit/de4f483c1eb4f758116887da5d19305eccb6f8f4))
* update examples ([454e1c5](https://github.com/anthropics/anthropic-sdk-typescript/commit/454e1c594cfd420eb11e891baefbf6a6530d7131))

## 0.87.0 (2026-04-09)

Full Changelog: [sdk-v0.86.1...sdk-v0.87.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.86.1...sdk-v0.87.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anthropic-ai/sdk",
"version": "0.87.0",
"version": "0.88.0",
"description": "The official TypeScript library for the Anthropic API",
"author": "Anthropic <support@anthropic.com>",
"types": "dist/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/vertex-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.16.0 (2026-04-10)

Full Changelog: [vertex-sdk-v0.15.0...vertex-sdk-v0.16.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.15.0...vertex-sdk-v0.16.0)

### Features

* vertex eu region ([#882](https://github.com/anthropics/anthropic-sdk-typescript/issues/882)) ([1933857](https://github.com/anthropics/anthropic-sdk-typescript/commit/193385760676b1c941a1f500aa91d0f7a3204b40))

## 0.15.0 (2026-04-03)

Full Changelog: [vertex-sdk-v0.14.4...vertex-sdk-v0.15.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/vertex-sdk-v0.14.4...vertex-sdk-v0.15.0)
Expand Down
2 changes: 1 addition & 1 deletion packages/vertex-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anthropic-ai/vertex-sdk",
"version": "0.15.0",
"version": "0.16.0",
"description": "The official TypeScript library for the Anthropic Vertex API",
"author": "Anthropic <support@anthropic.com>",
"types": "dist/index.d.ts",
Expand Down
3 changes: 3 additions & 0 deletions packages/vertex-sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export class AnthropicVertex extends BaseAnthropic {
case 'us':
baseURL = 'https://aiplatform.us.rep.googleapis.com/v1';
break;
case 'eu':
baseURL = 'https://aiplatform.eu.rep.googleapis.com/v1';
break;
default:
baseURL = `https://${region}-aiplatform.googleapis.com/v1`;
}
Expand Down
9 changes: 9 additions & 0 deletions packages/vertex-sdk/tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ describe('AnthropicVertex', () => {
expect(client.baseURL).toBe('https://aiplatform.us.rep.googleapis.com/v1');
});

test('eu region eues correct base URL', () => {
const client = new AnthropicVertex({
region: 'eu',
projectId: 'test-project',
accessToken: 'fake-token',
});
expect(client.baseURL).toBe('https://aiplatform.eu.rep.googleapis.com/v1');
});

test.each(['us-central1', 'europe-west1', 'asia-southeast1'])(
'regional endpoint %s uses correct base URL format',
(region) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vertex-sdk/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

"@anthropic-ai/sdk@file:../../dist":
# x-release-please-start-version
version "0.87.0"
version "0.88.0"
# x-release-please-end-version
dependencies:
json-schema-to-ts "^3.1.1"
Expand Down
4 changes: 2 additions & 2 deletions src/resources/beta/messages/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ export class Messages extends APIResource {
* ```ts
* const betaMessageTokensCount =
* await client.beta.messages.countTokens({
* messages: [{ content: 'string', role: 'user' }],
* model: 'claude-mythos-preview',
* messages: [{ content: 'Hello, world', role: 'user' }],
* model: 'claude-opus-4-6',
* });
* ```
*/
Expand Down
2 changes: 1 addition & 1 deletion src/resources/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class Completions extends APIResource {
* ```ts
* const completion = await client.completions.create({
* max_tokens_to_sample: 256,
* model: 'claude-mythos-preview',
* model: 'claude-2.1',
* prompt: '\n\nHuman: Hello, world!\n\nAssistant:',
* });
* ```
Expand Down
4 changes: 2 additions & 2 deletions src/resources/messages/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export class Messages extends APIResource {
* ```ts
* const messageTokensCount =
* await client.messages.countTokens({
* messages: [{ content: 'string', role: 'user' }],
* model: 'claude-mythos-preview',
* messages: [{ content: 'Hello, world', role: 'user' }],
* model: 'claude-opus-4-6',
* });
* ```
*/
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.87.0'; // x-release-please-version
export const VERSION = '0.88.0'; // x-release-please-version
12 changes: 6 additions & 6 deletions tests/api-resources/beta/agents/agents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('resource agents', () => {
},
},
],
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});

Expand All @@ -79,7 +79,7 @@ describe('resource agents', () => {
await expect(
client.beta.agents.retrieve(
'agent_011CZkYpogX7uDKUyvBTophP',
{ version: 0, betas: ['string'] },
{ version: 0, betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('resource agents', () => {
},
],
metadata: { foo: 'string' },
model: 'claude-opus-4-6',
model: { id: 'claude-opus-4-6', speed: 'standard' },
name: 'name',
skills: [
{
Expand All @@ -135,7 +135,7 @@ describe('resource agents', () => {
},
},
],
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});

Expand All @@ -162,7 +162,7 @@ describe('resource agents', () => {
include_archived: true,
limit: 0,
page: 'page',
betas: ['string'],
betas: ['message-batches-2024-09-24'],
},
{ path: '/_stainless_unknown_path' },
),
Expand All @@ -185,7 +185,7 @@ describe('resource agents', () => {
await expect(
client.beta.agents.archive(
'agent_011CZkYpogX7uDKUyvBTophP',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/beta/agents/versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('resource versions', () => {
{
limit: 0,
page: 'page',
betas: ['string'],
betas: ['message-batches-2024-09-24'],
},
{ path: '/_stainless_unknown_path' },
),
Expand Down
10 changes: 5 additions & 5 deletions tests/api-resources/beta/environments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('resource environments', () => {
},
description: 'Python environment with data-analysis packages.',
metadata: { foo: 'string' },
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});

Expand All @@ -62,7 +62,7 @@ describe('resource environments', () => {
await expect(
client.beta.environments.retrieve(
'env_011CZkZ9X2dpNyB7HsEFoRfW',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand Down Expand Up @@ -98,7 +98,7 @@ describe('resource environments', () => {
include_archived: true,
limit: 1,
page: 'page',
betas: ['string'],
betas: ['message-batches-2024-09-24'],
},
{ path: '/_stainless_unknown_path' },
),
Expand All @@ -121,7 +121,7 @@ describe('resource environments', () => {
await expect(
client.beta.environments.delete(
'env_011CZkZ9X2dpNyB7HsEFoRfW',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand All @@ -143,7 +143,7 @@ describe('resource environments', () => {
await expect(
client.beta.environments.archive(
'env_011CZkZ9X2dpNyB7HsEFoRfW',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand Down
18 changes: 13 additions & 5 deletions tests/api-resources/beta/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('resource files', () => {
before_id: 'before_id',
limit: 1,
scope_id: 'scope_id',
betas: ['string'],
betas: ['message-batches-2024-09-24'],
},
{ path: '/_stainless_unknown_path' },
),
Expand All @@ -49,14 +49,22 @@ describe('resource files', () => {
test('delete: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.beta.files.delete('file_id', { betas: ['string'] }, { path: '/_stainless_unknown_path' }),
client.beta.files.delete(
'file_id',
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
});

test('download: request options and params are passed correctly', async () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.beta.files.download('file_id', { betas: ['string'] }, { path: '/_stainless_unknown_path' }),
client.beta.files.download(
'file_id',
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
});

Expand All @@ -76,7 +84,7 @@ describe('resource files', () => {
await expect(
client.beta.files.retrieveMetadata(
'file_id',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand All @@ -98,7 +106,7 @@ describe('resource files', () => {
test('upload: required and optional params', async () => {
const response = await client.beta.files.upload({
file: await toFile(Buffer.from('Example data'), 'README.md'),
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});
});
12 changes: 6 additions & 6 deletions tests/api-resources/beta/messages/batches.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('resource batches', () => {
},
},
],
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});

Expand All @@ -152,7 +152,7 @@ describe('resource batches', () => {
await expect(
client.beta.messages.batches.retrieve(
'message_batch_id',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand All @@ -177,7 +177,7 @@ describe('resource batches', () => {
after_id: 'after_id',
before_id: 'before_id',
limit: 1,
betas: ['string'],
betas: ['message-batches-2024-09-24'],
},
{ path: '/_stainless_unknown_path' },
),
Expand All @@ -200,7 +200,7 @@ describe('resource batches', () => {
await expect(
client.beta.messages.batches.delete(
'message_batch_id',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand All @@ -222,7 +222,7 @@ describe('resource batches', () => {
await expect(
client.beta.messages.batches.cancel(
'message_batch_id',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand Down Expand Up @@ -265,7 +265,7 @@ describe('resource batches', () => {
await expect(
client.beta.messages.batches.results(
'message_batch_id',
{ betas: ['string'] },
{ betas: ['message-batches-2024-09-24'] },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Anthropic.NotFoundError);
Expand Down
12 changes: 6 additions & 6 deletions tests/api-resources/beta/messages/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ describe('resource messages', () => {
],
top_k: 5,
top_p: 0.7,
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});

test('countTokens: only required params', async () => {
const responsePromise = client.beta.messages.countTokens({
messages: [{ content: 'string', role: 'user' }],
model: 'claude-mythos-preview',
messages: [{ content: 'Hello, world', role: 'user' }],
model: 'claude-opus-4-6',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -133,8 +133,8 @@ describe('resource messages', () => {

test('countTokens: required and optional params', async () => {
const response = await client.beta.messages.countTokens({
messages: [{ content: 'string', role: 'user' }],
model: 'claude-mythos-preview',
messages: [{ content: 'Hello, world', role: 'user' }],
model: 'claude-opus-4-6',
cache_control: { type: 'ephemeral', ttl: '5m' },
context_management: {
edits: [
Expand Down Expand Up @@ -202,7 +202,7 @@ describe('resource messages', () => {
type: 'custom',
},
],
betas: ['string'],
betas: ['message-batches-2024-09-24'],
});
});
});
Loading
Loading