generateOpenAPISpec returns an OpenAPI 3.1 document describing the agent, authorization, audit and delegation REST endpoints. Feed it to a code generator to produce a client for Python, Java, Rust or any other language.
openapi.ts
Serving it
The function is pure, so you can expose it from any route:What it covers
Requests authenticate with a bearer token (
BearerAuth security scheme). The spec describes the core agent API only. Endpoints that plugins register (email, OAuth, passkeys and so on) are not included; see Writing plugins for how those are mounted.