Originally published at claudeguide.io/claude-agent-sdk-quickstart
Claude Agent SDK Quickstart: Build Your First Agent in 15 Minutes
An agent is a Claude model that can call tools — functions you define — in a loop until it completes a task. This guide walks from zero to a working agent with two tools (web search and unit converter) in Python or TypeScript in 2026.
Prerequisites: Anthropic API key, Python 3.11+ or Node.js 18+.
What you're building
A research assistant that:
- Accepts a question
- Decides whether to search the web or convert a unit
- Calls the tool
- Uses the result to answer (or calls another tool)
- Returns a final answer
Python version
Step 1: Install the SDK
pip install anthropic
export ANTHROPIC_API_KEY=sk-ant-your-key-here
Step 2: Define your tools
Tools are Python functions with JSON Schema descriptions. Claude reads the description to decide when to call each tool.
python
import anthropic
import json
client = anthropic.Anthropic()
TOOLS = [
{
"name": "web_search",
"description": "Search the web for current information. Use when the question requires recent facts or data.",
"input_schema": {
"type": "object",
"properties": {
"query": {"type": "string", "description": "The search query"}
},
"required": ["query"]
}
},
{
"name": "unit_converter",
"description": "Convert between common units. Supports: km/miles, kg/lbs, celsius/fahrenheit, usd/krw.",
"input_schema": {
"type": "object",
"properties": {
"value": {"type": "number", "description": "The numeric value to convert"},
"from_unit": {"type": "string", "description": "Source unit"},
"to_unit": {"type": "string", "description": "Target unit"}
},
"required": ["value", "from_unit", "to_unit"]
}
}
]
def web_search(query: str) -
Complete, runnable Python and TypeScript code throughout.
[→ Get Agent SDK Cookbook — $49](https://shoutfirst.gumroad.com/l/ogxhmy?utm_source=claudeguide&utm_medium=article&utm_campaign=claude-agent-sdk-quickstart)
*30-day money-back guarantee. Instant download.*
Top comments (0)