Skip to content
buildanagent
Search
Ctrl
K
Cancel
GitHub
Select theme
Dark
Light
Auto
Menu
Start
What the SDK is
Install
Your first agent
Concepts
The transcript and the stream
Stop reasons
Tools
Approvals
Guides
Add a tool
Pause for approval
Testing
Test with ScriptedModel
Keep tests offline
Reference
Packages and entry points
Gateway API
@buildanagent/gateway
Classes
GatewayError
ModelRequestsDisabledError
StreamContractError
Interfaces
AssistantMessage
CatalogEntry
CatalogSources
Cost
CreateModelOptions
FailedRequest
MiddlewareParams
Model
ModelAdapter
ModelCaps
ModelContext
ModelMiddleware
ModelRef
OpaqueToken
PriceCatalog
ProjectedTokens
ProviderConfig
RateTier
RequestDump
ResolvedProviderConfig
StreamOptions
ToolNameMap
ToolNameRule
Usage
WireTool
Type Aliases
ContentBlock
DumpedOptions
ErrorKind
GatewayErrorCode
GatewayEvent
Message
ModelCallOptions
ModelContent
ModelErrorCode
ModelEvent
Sleep
Transport
Variables
abortableSleep
CANONICAL_TOOL_NAME
DEFAULT_INITIAL_RETRY_DELAY_MS
defaultCatalog
MAX_RETRY_DELAY_MS
TOOL_NAME_RULES
Functions
addCost
addUsage
assertCanonicalName
assertModelRequestAllowed
assertStreamContract
classifyError
complete
createModel
createToolNameMap
emptyUsage
estimateInputTokens
findCatalogEntry
isCanonicalName
isGatewayError
isMockTransport
modelRequestsAreAllowed
parseCatalog
priceUsage
projectCallCost
projectCost
resolveProviderConfig
retryDelay
retryHintMs
staleCatalogEntries
totalInput
transformMessages
unreportedUsage
@buildanagent/gateway/anthropic
Interfaces
AnthropicProviderOptions
Variables
ANTHROPIC_VERSION
THINKING_BINDING_BETA
Functions
anthropic
@buildanagent/gateway/openai-chat
Interfaces
ChatCompat
OpenAIChatConfig
OpenAIChatProviderOptions
Functions
openaiChat
@buildanagent/gateway/testing
Interfaces
MockServer
MockServerOptions
MockTransport
RecordedRequest
WireResponse
Type Aliases
WireApi
WireScript
Variables
CREDENTIAL_HEADERS
PROVIDER_KEY_VARIABLES
REDACTED
Functions
allowModelRequests
assertNoProviderKeys
chatCompletionEvents
guardedFetch
installTestGuards
isCredentialName
isLoopbackHost
markMockTransport
mockTransport
redactHeaders
redactUrl
seededRandom
serverSentEvents
startMockServer
stripCredentials
References
assertStreamContract
isMockTransport
ModelRequestsDisabledError
StreamContractError
@buildanagent/gateway/testing/setup
SDK API
@buildanagent/sdk
Classes
RunStoppedError
SafetyError
SdkError
Interfaces
ApprovalDetails
ApprovalSigner
AwaitingApprovalResult
BudgetResult
ClarificationRequestedResult
ClarificationToolOptions
Context
ContextEvent
ContinueOptions
DeliveryReceipt
DoneResult
EndedResult
ErrorResult
EventBase
HmacSignerOptions
HookEventBase
Interceptors
ModelCallEvent
ModelCallPatch
ModelCallRequest
ModelCallStop
ModelResultEvent
NoProgressResult
OutputToolOptions
ParentRun
PendingCall
PendingRequestFields
ProgressPolicy
ResultBase
Run
RunError
RunInput
RunOptions
SchemaIssue
SignedPendingRequest
SignPendingOptions
StepEvent
StoppedResult
ToolAnnotations
ToolCallEvent
ToolContext
ToolDefinition
ToolEffect
ToolResult
ToolResultEvent
VerifyResolutionOptions
Type Aliases
AgentEvent
AgentEventBody
AppFor
ApprovalHandler
CallOptions
DeliveryKind
GateDecision
JsonSchema
MaybePromise
Observer
OrNothing
Recheck
RejectionCause
Resolution
ResolutionCheck
ResolutionRejectionCause
RunResult
SafetyErrorCode
SdkErrorCode
StopDecision
ToolExecutionMode
ToolExposure
ToolFailure
ToolResultPatch
ToolSchema
UnfinishedResult
WarningCode
WriteOutcome
Variables
AGENT_EVENT_TYPES
CAPABILITIES
DEFAULT_PROGRESS
DEFAULTS_HASH
SDK_PACKAGE
SDK_VERSION
Functions
blockingApprovals
canonicalInputHash
clarificationTool
composeInterceptors
continueRun
createPendingRequest
defineTool
ephemeralSigner
hmacSigner
isSafetyError
isSdkError
nestedRunDepth
outputTool
projectCallCost
run
runOrThrow
verifyResolution
@buildanagent/sdk/otel
Interfaces
OtelObserverOptions
SpanLike
SpanOptionsLike
TracerLike
Type Aliases
AttributeValueLike
OtelObserver
Variables
GEN_AI_ATTRIBUTES
GEN_AI_CONTENT_ATTRIBUTES
GEN_AI_OPERATIONS
SEMCONV_GENAI_COMMIT
Functions
otelObserver
@buildanagent/sdk/testing
Classes
RecordingError
ReplayModel
ScriptedModel
UnexpectedModelCallError
Interfaces
AssistantScript
AutoResponderOptions
Clock
RecordedPair
RecordedRequest
Recorder
RecordingStamp
RecordOptions
ReplayOptions
ScriptedApprovals
ScriptedMcpCall
ScriptedMcpServer
ScriptedMcpServerOptions
ScriptedMcpTool
ScriptedModelOptions
StreamScript
Type Aliases
ExpectedStamp
RecordingErrorCode
ScriptedAnswer
ScriptedToolStep
ScriptStep
Variables
DEFAULT_DENIED_TOOLS
TEST_KEY_ID
Functions
autoResponder
fixedClock
recordPairs
replayPairs
scriptedApprovals
scriptedMcpServer
sequentialIds
synthesizeInput
testSigner
GitHub
Select theme
Dark
Light
Auto
@buildanagent/gateway
Modules
Section titled “Modules”
@buildanagent/gateway
@buildanagent/gateway/anthropic
@buildanagent/gateway/openai-chat
@buildanagent/gateway/testing
@buildanagent/gateway/testing/setup
These docs are licensed
CC BY 4.0
. The
licence text
is in the repository.