Every aiui server publishes an OpenAPI 3.1 document of its own HTTP API, and the app
shell has a page to read it and send requests. Nothing to configure: both are on by default.
GET /api/openapi.json is built from the route table the server is running, when it is
GET /api/openapi.json
asked. It lists every API route it answers (/api/*, /v1/* and the unprefixed data
/api/*
/v1/*
routes such as /sessions and /run): the core, each enabled built-in, and the routes of
/sessions
/run
your plugins and register_feature() features. It cannot go stale, and a built-in you
register_feature()
switch off (extensions: {disabled: [builtin.training]}) leaves it.
extensions: {disabled: [builtin.training]}
| Field | Comes from |
|---|---|
| tags | The built-in that owns the route (sessions, api, config…), a plugin's or feature's name, else core |
tags
sessions
api
config
core
| summary, description | The handler's docstring: first line, then the rest (plain text; a leading POST /path — is dropped) |
summary
description
POST /path —
| parameters | Path parameters and their types ({id:int} is an integer) |
parameters
{id:int}
| security | Bearer token; [] on the public routes (/api/health, sign-in) |
security
[]
/api/health
| servers | /: the server that served the document |
servers
/
| x-websockets | The WebSocket routes (/api/chat/ws, /api/logs/stream) |
x-websockets
/api/chat/ws
/api/logs/stream
The route needs the same credentials as every other /api route in each auth mode. A
/api
plugin the caller may not use (an entry-point plugin that is off by default on a remote or
sign-in server) is left out. Switch the document and the page off with
extensions: {disabled: [builtin.api-reference]}.
extensions: {disabled: [builtin.api-reference]}
Use it anywhere an OpenAPI file goes: client generators, API tools, or the API reference
of an aiui docs site (api: {openapi: http://localhost:8000/api/openapi.json}, see
aiui
api: {openapi: http://localhost:8000/api/openapi.json}
OpenAPI).
A feature adds request bodies, responses or anything else to its operations with an
optional openapi() method, keyed by "METHOD /path":
openapi()
"METHOD /path"
The OpenAI-compatible routes (/v1/chat/completions, /v1/responses, /v1/embeddings…)
/v1/chat/completions
/v1/responses
/v1/embeddings
carry their request bodies this way.
In the app shell (style: app), API Reference in the Control group (/api-reference)
style: app
/api-reference
shows the routes by feature with a search box (method, path or text). Pick a route to read
it and try it against this same server:
document's example);
$AIUI_TOKEN
?op=<operationId>
/api-reference?op=get_api_sessions
Requests go to the same origin with your session, so no proxy, CORS setup or pasted key is
needed. The default dashboard style is unchanged; its Inspector and API pages stay.
dashboard