Packages and entry points
Two packages hold everything these docs describe. You need this to find which entry point to import from.
The gateway
Section titled “The gateway”@buildanagent/gateway talks to model providers. Import from these entry points:
@buildanagent/gateway:createModel(), the message and event types, and the helpers that price and replay a conversation.@buildanagent/gateway/anthropic: the adapter for Anthropic’s Messages API.@buildanagent/gateway/openai-chat: the adapter for OpenAI’s Chat Completions API and for servers that copy it.@buildanagent/gateway/testing: mock transports and the stream check.@buildanagent/gateway/testing/setup: the import that keeps a test file offline.
The SDK
Section titled “The SDK”@buildanagent/sdk runs the loop. Import from these entry points:
@buildanagent/sdk:run(),continueRun(),defineTool(), signers and the hook types.@buildanagent/sdk/otel: an observer that exports a run as OpenTelemetry spans.@buildanagent/sdk/testing:ScriptedModeland the doubles that stand in for an approver and a tool server.
Every export has a reference page
Section titled “Every export has a reference page”The docs generate a page for each export from its TSDoc, so a page always matches the code it describes. Browse the gateway API or the SDK API, which list each entry point’s functions, classes, interfaces and types.
Start with your first agent if you have not built one yet.
These docs are licensedCC BY 4.0. Thelicence text is in the repository.