HTTP request
Lets your agent call external APIs and fetch web content. Supports all HTTP methods, custom headers, and request bodies. Default timeout is 30 seconds.
Supported in: Python; Node.js 22+, modern browsers (TypeScript).
The Python tool delegates all networking to an httpx.AsyncClient. Use the make_http_request factory to supply a pre-configured client with authentication, timeouts, redirects, proxies, or other transport-level configuration.
Example:
import { Agent } from '@strands-agents/sdk'import { httpRequest } from '@strands-agents/sdk/vended-tools/http-request'
const agent = new Agent({ tools: [httpRequest],})
// Make API requestsawait agent.invoke('Get data from https://api.example.com/users')await agent.invoke('Post {"name": "John"} to https://api.example.com/users')from strands import Agentfrom strands.vended_tools import http_request
agent = Agent(tools=[http_request])agent("Get data from https://api.example.com/data")Custom configuration with a pre-configured client:
import httpxfrom strands import Agentfrom strands.vended_tools import make_http_request
client = httpx.AsyncClient( headers={"Authorization": "Bearer token"},)tool = make_http_request(client=client)agent = Agent(tools=[tool])Full API reference: TypeScript, Python