Strands Agents
Strands tool({...}) instances for TypeScript agents, including Strands agents running on AWS Bedrock AgentCore. Pull a curated subset of the catalog into the agent; when it calls a tool, the adapter solves a proof-of-work or signs an x402 payment and returns the structured result.
Install
npm install agent402-strands @strands-agents/sdk zod
Example
import { Agent } from "@strands-agents/sdk";
import { agent402Tools } from "agent402-strands";
const { tools } = await agent402Tools({
slugs: ["extract", "hash", "render", "screenshot"],
});
const agent = new Agent({ tools });
const out = await agent.invoke("Extract the article at https://example.com");
What it exposes
- One native tool per catalog slug you pass in
slugs(a short list gives the model better tool selection). - With no
slugs, the free-tier catalog: every compute-payable tool (freeOnly: trueis the default). - An
execute(name, args)function that runs a tool call and pays for it underneath. baseUrlpoints the adapter at a self-hosted Agent402 instance.- A
clientfield with the underlying buyer SDK (find(),call(),clearCache()), andagent402Execute()for a standalone executor.
How payment works
- Free tier: compute-payable tools settle with a sha256 proof-of-work solved in-process. No wallet, no API key.
- Wallet-only tools (browser, network, memory, live data): set
freeOnly: falseand pass a payment-wrappedfetch. An@x402/fetchfetch pays in USDC over x402; a stockmppxfetch pays over MPP. The same 402 carries both offers. - Prices come from the live catalog at /api/pricing and are quoted in every 402 before anything is signed.
const { tools } = await agent402Tools({ freeOnly: false, fetch: payFetch });
A call that fails is not charged: settlement runs after the tool and only on a successful response. Background: What x402 is · MPP (Machine Payments Protocol).
Tools to try first
Every tool, price and input schema: the catalog.
Links
agent402-strands on npm · source on GitHub · configuration reference
Guides: Use Agent402 from Claude Code, Cursor, VS Code, Windsurf, Cline, Roo Code, Codex CLI, Gemini CLI, Muse Code, Continue, ElizaOS, AgentCore and any OpenAI SDK · Let your agent pay anyone: the non-custodial x402 payments toolkit
All integrations