Vercel AI SDK
The Vercel AI SDK provider transforms Devcaster tools into Vercel's tool format with built-in execution — no manual agentic loop needed.
Install
npm install @devcaster/core @devcaster/vercel ai @ai-sdk/anthropicConfigure API Keys
Set DEVCASTER_API_KEY with your API key from Settings and ANTHROPIC_API_KEY with your Anthropic API key.
DEVCASTER_API_KEY=xxxxxxxxx
ANTHROPIC_API_KEY=xxxxxxxxxCreate session and run
The Vercel provider is agentic — tools include an execute function, so the AI SDK handles tool calls automatically via stopWhen.
import { anthropic } from "@ai-sdk/anthropic";
import { Devcaster } from "@devcaster/core";
import { VercelProvider } from "@devcaster/vercel";
import { generateText, stepCountIs } from "ai";
const devcaster = new Devcaster({ provider: new VercelProvider() });
// Create a session for your user
const session = await devcaster.create("user_123");
const tools = await session.tools();
const { text } = await generateText({
model: anthropic("claude-opus-4-6"),
tools,
prompt: "Send an email to john@example.com with the subject 'Hello' and body 'Hello from Devcaster!'",
stopWhen: stepCountIs(10),
});
console.log(text);