sideagentDocs

Library

Server

createAgent options, adapters for Hono, Next.js and Express, and the doctor check.

On this page

createAgent is async: it parses the spec and, if you configured knowledge, embeds it. Create the agent once and reuse it. It returns an object with a request handler and a doctor() check.

Options

OptionWhat it does
specOpenAPI 3.0 or 3.1: a URL, an object or a JSON string.
baseUrlPinned API host. The spec's servers list is ignored.
llmbaseUrl, apiKey and model of any OpenAI-compatible host.
allowDefault-deny allowlist of operation IDs, or tag:name.
allowedOriginsBrowser origins that may call the endpoint.
getAuthReturns the user ID and the headers to forward to your API.
approvalSecretSigns approval tokens. Set it on serverless or multi-instance deployments, so every instance verifies the same tokens.
checkpointer, threadStorePersistent chat history. See Chat history.
knowledge, vectorStoreMarkdown and URL sources the agent can search. See Knowledge.

Adapters

honoHandler(agent), nextRoute(agent) and expressHandler(agent). The core agent.handler(request) takes a standard Request and returns a Response.

Doctor

Call await agent.doctor() at startup. It reports what the agent can do (operations loaded, knowledge sources, warnings) and checks the LLM connection.