Quickstart
Build your first agent in 10 minutes. This walkthrough installs the SDK, sets up a provider key, and runs a tiny agent locally.
Step 1: Install the SDK
Section titled “Step 1: Install the SDK”npm install @dreadnode/agents @ai-sdk/anthropicStep 2: Set a provider API key
Section titled “Step 2: Set a provider API key”Start the CLI and store a provider key (for example, Anthropic):
dreadnode/keys set anthropic sk-ant-...Step 3: Create your first agent
Section titled “Step 3: Create your first agent”Create a file called quickstart.ts:
import { anthropic } from '@ai-sdk/anthropic';import { createAgent, createGenerator } from '@dreadnode/agents';
const generator = createGenerator(anthropic('claude-sonnet-4-20250514'));
const agent = createAgent({ name: 'quickstart-agent', generator, systemPrompt: 'You are a helpful assistant.',});
async function main(): Promise<void> { const result = await agent.run({ input: 'Say hello and summarize what Dreadnode does in one sentence.', });
const lastMessage = result.trajectory.lastMessage; if (lastMessage) { console.log(lastMessage.text); }}
main().catch((error) => { console.error(error); process.exit(1);});Step 4: Run it
Section titled “Step 4: Run it”npx tsx quickstart.tsStep 5: View the output
Section titled “Step 5: View the output”You should see a short response printed to the terminal.