
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
ai-sdk-claude-agent-provider
Advanced tools
The `ai-sdk-claude-agent-provider` package provides a Claude Agent SDK-backed provider for the [AI SDK](https://ai-sdk.dev/docs), using [`@anthropic-ai/claude-agent-sdk`](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) under the hood.
The ai-sdk-claude-agent-provider package provides a Claude Agent SDK-backed provider for the AI SDK, using @anthropic-ai/claude-agent-sdk under the hood.
Install the provider with ai:
npm i ai-sdk-claude-agent-provider ai
If you use coding agents such as Claude Code or Cursor, we recommend adding the AI SDK skill to your repository:
npx skills add vercel/ai
Import the default provider instance claudeAgentSdk:
import { claudeAgentSdk } from "ai-sdk-claude-agent-provider";
Or create a customized provider instance:
import { createClaudeAgentSdk } from "ai-sdk-claude-agent-provider";
const provider = createClaudeAgentSdk({
name: "claude-agent-sdk",
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: process.env.ANTHROPIC_BASE_URL,
queryOptions: {
cwd: process.cwd(),
permissionMode: "default",
settingSources: ["project", "local"],
},
});
import { claudeAgentSdk } from "ai-sdk-claude-agent-provider";
import { generateText } from "ai";
const { text } = await generateText({
model: claudeAgentSdk("default"),
prompt: "Summarize the repository state in one paragraph.",
});
console.log(text);
LanguageModelV3 only.tool-call, tool-result) when available from SDK messages.apiKey, authToken) or by pre-configured Claude Agent CLI environment.claudeAgentSdkModelIds is a non-exhaustive convenience list and may include aliases like default, sonnet, haiku.claude-opus-4-6), read providerMetadata["claude-agent-sdk"].resolvedModelId / resolvedModelIds on results.import { listClaudeAgentSdkModels } from "ai-sdk-claude-agent-provider";
const models = await listClaudeAgentSdkModels({
apiKey: process.env.ANTHROPIC_API_KEY,
});
console.log(models.map((model) => model.value));
To regenerate the static model id/info files from your current Claude Agent SDK account:
bun --cwd packages/ai-sdk-claude-agent-provider run sync:model-catalog
Audited against @anthropic-ai/claude-agent-sdk@0.2.45.
Options support: all Claude Agent SDK Options fields are supported through the adapter, with four fields mapped from AI SDK primitives instead of direct passthrough:
prompt comes from AI SDK prompt/messages.model comes from the selected model id (claudeAgentSdk("<model-id>")).abortController comes from AI SDK abortSignal.outputFormat comes from AI SDK JSON responseFormat.schema (mapped to json_schema; responseFormat.name/description map to schema title/description when missing).Options fields:
createClaudeAgentSdk({ queryOptions: ... })claudeAgentSdk(modelId, modelSettings)providerOptions["<provider-name>"]apiKey, authToken, baseURL/baseUrl, and env are merged into Claude process env (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL). If both baseURL and baseUrl are provided, baseURL wins.providerOptions["claude-agent-sdk"] (canonical key) and providerOptions["<provider-name>"] (custom provider name). If both are present, custom-key values override canonical values.AI SDK call options currently not forwarded to Claude Agent SDK (warnings emitted):
tools, toolChoiceheaderstemperature, topP, topKmaxOutputTokensstopSequencespresencePenalty, frequencyPenaltyseedFAQs
The `ai-sdk-claude-agent-provider` package provides a Claude Agent SDK-backed provider for the [AI SDK](https://ai-sdk.dev/docs), using [`@anthropic-ai/claude-agent-sdk`](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) under the hood.
The npm package ai-sdk-claude-agent-provider receives a total of 5 weekly downloads. As such, ai-sdk-claude-agent-provider popularity was classified as not popular.
We found that ai-sdk-claude-agent-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.