Get started
The Strands Agents SDK empowers developers to quickly build, manage, evaluate and deploy AI-powered agents. These quickstart 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, Node.js, or Rust: there is no hosted control plane, scheduler, or database to stand up first. Any model provider supported by your SDK works. Amazon Bedrock is the default, and selecting another provider changes the model object rather than the agent loop, so an AWS account is only required if you keep the default. Adding an agent to an existing FastAPI, Express, Next.js, or Rust web app is a dependency and a few lines of code, not new infrastructure.
Here is the whole of it: one request 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 strands::Agent;
async fn chat(prompt: &str) -> strands::Result<String> { let mut agent = Agent::builder().printer(false).build()?; let result = agent.invoke(prompt).await?; let reply = result.to_string(); agent.shutdown().await?; Ok(reply)}Call chat() from the request handler in your web framework.
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 passing another model leaves the rest of your agent code unchanged. Install the dependency or feature for the provider you select.
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.
Amazon Bedrock is enabled by default. For Anthropic or OpenAI, select the provider’s Cargo feature when you add the SDK.
The examples use Tokio for their async entry points:
cargo add tokio --features macros,rt-multi-threaduse strands::Agent;
#[tokio::main]async fn main() -> strands::Result<()> { let mut agent = Agent::builder().printer(false).build()?; let result = agent.invoke("What can you help me build?").await?; println!("{result}"); agent.shutdown().await}cargo add strands --no-default-features --features anthropicuse strands::Agent;use strands::models::anthropic::AnthropicModel;
#[tokio::main]async fn main() -> strands::Result<()> { let model = AnthropicModel::builder() .api_key("<KEY>") .model_id("claude-sonnet-5") .build()?; let mut agent = Agent::builder().model(model).printer(false).build()?; let result = agent.invoke("What can you help me build?").await?; println!("{result}"); agent.shutdown().await}cargo add strands --no-default-features --features openaiuse strands::Agent;use strands::models::openai::OpenAIModel;
#[tokio::main]async fn main() -> strands::Result<()> { let model = OpenAIModel::builder() .api_key("<KEY>") .model_id("gpt-5.4") .build()?; let mut agent = Agent::builder().model(model).printer(false).build()?; let result = agent.invoke("What can you help me build?").await?; println!("{result}"); agent.shutdown().await}Google is not available.
Ollama is not available.
For exact APIs, use the API reference.
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 Python, TypeScript, and a Rust developer preview.
Feature availability
Section titled “Feature availability”The table below compares feature availability across the Python, TypeScript, and Rust SDKs.
| Category | Feature | Python | TypeScript | Rust preview |
|---|---|---|---|---|
| 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+ | 1+ | |
| Tools | Custom function tools | ✅ | ✅ | ✅ |
| MCP (Model Context Protocol) | ✅ | ✅ | ✅ | |
| Vended tools | ✅ | ✅ | ✅ | |
| 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 | ✅ | ✅ | File and custom storage |
| Observability | OpenTelemetry integration | ✅ | ✅ | ✅ |
| Steering | Agent steering | ✅ | ✅ | ❌ |
| Voice | Bidirectional streaming | ✅ | ❌ | ❌ |