
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@anthropic-ai/foundry-sdk
Advanced tools
The official TypeScript library for the Anthropic Foundry API
This library provides convenient access to the Claude API via Microsoft Azure AI Foundry. See the documentation for more details.
For the direct Claude API at api.anthropic.com, see @anthropic-ai/sdk.
npm install @anthropic-ai/foundry-sdk
import { AnthropicFoundry } from '@anthropic-ai/foundry-sdk';
const client = new AnthropicFoundry({
apiKey: process.env.ANTHROPIC_FOUNDRY_API_KEY, // defaults to process.env.ANTHROPIC_FOUNDRY_API_KEY
resource: 'example-resource.azure.anthropic.com', // your Azure resource
});
const message = await client.messages.create({
model: 'claude-3-5-sonnet-20241022',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude!' }],
});
console.log(message.content);
For enhanced security, you can use Azure AD (Microsoft Entra) authentication instead of an API key:
import { AnthropicFoundry } from '@anthropic-ai/foundry-sdk';
import { getBearerTokenProvider, DefaultAzureCredential } from '@azure/identity';
const credential = new DefaultAzureCredential();
const scope = 'https://ai.azure.com/.default';
const azureADTokenProvider = getBearerTokenProvider(credential, scope);
const client = new AnthropicFoundry({
azureADTokenProvider,
resource: 'example-resource.azure.anthropic.com', // your Azure resource
});
const message = await client.messages.create({
model: 'claude-3-5-sonnet-20241022',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude!' }],
});
console.log(message.content);
If you have a model deployment configured, you can specify it to have the SDK automatically construct the correct URL path:
const client = new AnthropicFoundry({
apiKey: process.env.ANTHROPIC_FOUNDRY_API_KEY,
resource: 'example-resource.azure.anthropic.com',
});
// The SDK will automatically use /deployments/my-claude-deployment/messages
const message = await client.messages.create({
model: 'claude-3-5-sonnet-20241022',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello!' }],
});
FAQs
The official TypeScript library for the Anthropic Foundry API
We found that @anthropic-ai/foundry-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.