The gateway listens on 127.0.0.1:8120. Every route under /api except /api/health needs the access token, sent as Authorization: Bearer <token>; a missing or wrong token gets 401. The web page uses exactly these routes, so anything it does can also be scripted.
How full the context window is, by category, and the desk's tools
yes
GET
/api/desks/{desk}/commands
The desk's slash commands and usable skills, each with its usage, what it does, and whether it is answered at once, beside the running turn, or queued; the web page's and the terminal's command menus read it
yes
POST
/api/desks/{desk}/model
Try one model first from now on, optionally another of its provider's models, or go back to the configured order, as /model does
yes
POST
/api/desks/{desk}/messages
Queue a message or slash command, with attachment_ids naming uploaded files; the answer arrives as events
yes
POST
/api/desks/{desk}/attachments
Upload one picture or document (a form with a file field); answers its attachment
yes
GET
/api/desks/{desk}/attachments/{attachment}
The uploaded file itself
yes
GET
/api/desks/{desk}/pictures/{path}
A picture inside the desk's folder, such as a screenshot in a tool card
yes
POST
/api/desks/{desk}/pause
Stop the desk asking its models
yes
POST
/api/desks/{desk}/resume
Start it again
yes
POST
/api/desks/{desk}/flatten
Cancel the desk's orders and close its positions, with a reason
The desks' waiting requests, or all of them with status=all
yes
POST
/api/requests/{request}/answer
Answer a question
yes
POST
/api/requests/{request}/plan
Approve a plan, or ask for changes
yes
POST
/api/requests/{request}/permission
Allow a held call once or always, or deny it
yes
POST
/api/requests/{request}/dismiss
Close a request without answering
yes
GET
/api/permissions
The standing "Always allow" permissions
yes
POST
/api/permissions/revoke
Make a desk ask again before using a tool
yes
Each answer is handed to the desk as a new message; the desk never waited for it. An answer is recorded as given "via web" unless the client sends the header X-Trading-Agent-Client: terminal, which the terminal program does; any other value counts as web.
/ws/events?token=<token> is a WebSocket that sends every event as JSON as it happens: its kind, its desk, its payload and its created_at. Add &desk=intraday to receive one desk's events and the events that belong to no desk, such as the kill switch. A wrong token closes the connection with code 1008.