Skip to content

Quickstart

Terminal window
npm install @npm-while1/claude-agent-sdk zod

The examples use DeepSeek’s Anthropic-compatible endpoint.

import { createAgent } from "@npm-while1/claude-agent-sdk";
const agent = createAgent({
apiKey: process.env.DEEPSEEK_API_KEY,
baseURL: "https://api.deepseek.com/anthropic",
model: "deepseek-v4-flash",
});
for await (const message of agent.query("Say hello in one sentence.")) {
console.log(message);
}
const result = await agent.prompt("What is 2+2?");
console.log(result.result);
const result = await agent.prompt("Write a short haiku.", {
stream: false,
});