Get started
The Strands Agents SDK empowers developers to quickly build, manage, evaluate and deploy AI-powered agents. These quick start guides get you set up and running a simple agent in less than 20 minutes.
A library, not a platform
Section titled “A library, not a platform”Strands runs inside your own process. Creating an agent is constructing an object in Python or Node.js: there is no hosted control plane, scheduler, or database to stand up first. Any model provider works. Amazon Bedrock is the default, and swapping in Anthropic, OpenAI, Gemini, or Ollama is a one-line change, so an AWS account is only required if you keep the default. Adding an agent to an existing FastAPI, Express, or Next.js app is a dependency and a few lines of code, not new infrastructure.
Here is the whole of it: one file that answers HTTP requests with a Strands agent. The route handler constructs an agent and calls it. The only service it reaches is the model provider.
from fastapi import FastAPIfrom pydantic import BaseModelfrom strands import Agent
app = FastAPI()
class ChatRequest(BaseModel): prompt: str
@app.post("/chat")def chat(request: ChatRequest) -> dict[str, str]: # The agent lives in this process: no scheduler or database to reach. agent = Agent() result = agent(request.prompt) return {"reply": str(result)}Run it with uvicorn main:app.
import { Agent } from '@strands-agents/sdk'import express, { type Request, type Response } from 'express'
const app = express()app.use(express.json())
app.post('/chat', async (req: Request, res: Response) => { // The agent lives in this process: no scheduler or database to reach. const agent = new Agent() const result = await agent.invoke(req.body.prompt) res.json({ reply: result.lastMessage })})
app.listen(3000)Run it with tsx server.ts.
Use any model provider
Section titled “Use any model provider”The model is one object you hand to the agent. Amazon Bedrock is the default, and every other provider is a one-line swap; the rest of your agent code does not change.
from strands import Agent
# Amazon Bedrock is the default, so no model object is required.agent = Agent()print(agent("What can you help me build?"))from strands import Agentfrom strands.models.anthropic import AnthropicModel
agent = Agent(model=AnthropicModel(client_args={"api_key": "<KEY>"}, model_id="claude-sonnet-5"))print(agent("What can you help me build?"))from strands import Agentfrom strands.models.openai import OpenAIModel
agent = Agent(model=OpenAIModel(client_args={"api_key": "<KEY>"}, model_id="gpt-5.4"))print(agent("What can you help me build?"))from strands import Agentfrom strands.models.gemini import GeminiModel
agent = Agent(model=GeminiModel(client_args={"api_key": "<KEY>"}, model_id="gemini-2.5-flash"))print(agent("What can you help me build?"))from strands import Agentfrom strands.models.ollama import OllamaModel
agent = Agent(model=OllamaModel(host="http://localhost:11434", model_id="llama3.1"))print(agent("What can you help me build?"))import { Agent } from '@strands-agents/sdk'
// Amazon Bedrock is the default, so no model object is required.const agent = new Agent()const result = await agent.invoke('What can you help me build?')console.log(result.lastMessage)import { Agent } from '@strands-agents/sdk'import { AnthropicModel } from '@strands-agents/sdk/models/anthropic'
const agent = new Agent({ model: new AnthropicModel({ apiKey: '<KEY>', modelId: 'claude-sonnet-5' }),})const result = await agent.invoke('What can you help me build?')console.log(result.lastMessage)import { Agent } from '@strands-agents/sdk'import { OpenAIModel } from '@strands-agents/sdk/models/openai'
const agent = new Agent({ model: new OpenAIModel({ apiKey: '<KEY>', modelId: 'gpt-5.4' }),})const result = await agent.invoke('What can you help me build?')console.log(result.lastMessage)import { Agent } from '@strands-agents/sdk'import { GoogleModel } from '@strands-agents/sdk/models/google'
const agent = new Agent({ model: new GoogleModel({ apiKey: '<KEY>', modelId: 'gemini-2.5-flash' }),})const result = await agent.invoke('What can you help me build?')console.log(result.lastMessage)Ollama runs in the Python SDK only.
See model providers for the full list and per-provider configuration.
Strands harness or the Strands Harness SDK?
Section titled “Strands harness or the Strands Harness SDK?”Strands gives you two starting points, and you can move between them without a rewrite.
| If you want to… | Start with | Why |
|---|---|---|
| Get a complete agent harness with tested defaults, in one import | Strands harness | Model, tools, memory, context management, and a production loop are already wired together. |
| Build the agent yourself and customize every part of the loop | SDK | You define the tools, model, memory, and control flow, and the Strands Harness SDK runs the loop. |
| Start on Strands harness and drop down for more control later | Compose with the Strands Harness SDK | Strands harness is built on the Strands Harness SDK, so you can change any piece of it without a rewrite. |
Weighing Strands against other frameworks or a hand-written loop instead? See choosing an agent foundation.
Language support
Section titled “Language support”Strands Agents SDK is available in both Python and TypeScript.
Feature availability
Section titled “Feature availability”The table below compares feature availability between the Python and TypeScript SDKs.
| Category | Feature | Python | TypeScript |
|---|---|---|---|
| Core | Agent creation and invocation | ✅ | ✅ |
| Streaming responses | ✅ | ✅ | |
| Structured output | ✅ | ✅ | |
| Model providers | Amazon Bedrock | ✅ | ✅ |
| OpenAI | ✅ | ✅ | |
| OpenAI Responses API | ✅ | ✅ | |
| Anthropic | ✅ | ✅ | |
| ✅ | ✅ | ||
| Ollama | ✅ | ❌ | |
| LiteLLM | ✅ | ❌ | |
| Custom providers | ✅ | ✅ | |
| Additional providers | 5+ | 1+ | |
| Tools | Custom function tools | ✅ | ✅ |
| MCP (Model Context Protocol) | ✅ | ✅ | |
| Built-in tools | 30+ via community package | 4 built-in | |
| Conversation | Null manager | ✅ | ✅ |
| Sliding window manager | ✅ | ✅ | |
| Summarizing manager | ✅ | ✅ | |
| Hooks | Lifecycle hooks | ✅ | ✅ |
| Custom hook providers | ✅ | ✅ | |
| Multi-agent | Swarms | ✅ | ✅ |
| Graphs | ✅ | ✅ | |
| Workflows | ✅ | ✅ | |
| Agents as tools | ✅ | ✅ | |
| Agent-to-Agent (A2A) | ✅ | ✅ | |
| Session management | File, S3, repository managers | ✅ | ✅ |
| Observability | OpenTelemetry integration | ✅ | ✅ |
| Steering | Agent steering | ✅ | ✅ |
| Experimental | Bidirectional streaming | ✅ | ❌ |