← All chapters

Talking to a tron

Sending work in, and reading the answer as it is written.

The routes

GET/trons/:id/nuclei/:agent/chat-historyThe conversation of one agent; ?session_id= picks the session.
DELETE/trons/:id/nuclei/:agent/chat-historyClears it.

Streaming, from the site

POST /trons/:id/nuclei/:agent/chat/stream takes the same body as the chat ({ message | inputs, thinking?, session_id? }, or multipart with files) and answers with server-sent events, each a JSON object with a type: ready, turn (turn_id and session_id), thinking and text (pieces of the answer as they are written), tool_use (name, input) and tool_result (name, output), files, error, and done. A delegation to another agent is a tool call of the agent that delegates, and is shown in the chat as a hand-off. It takes a session token: a Tron API key has no stream of the text, only the state of its job.

Calling a tron from your own code

That is the Tron API, the next chapter: a key for one or more trons, a message that is a job, its states, its stream, its files and its webhook.