Run Agent

Chat with the unified Coda AI agent to write, debug, and optimise quantum circuits or explain quantum computing concepts. Responses are streamed as server-sent events (SSE).

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

x-api-pathstring or nullOptional

Request

This endpoint expects an object.
messageslist of objectsRequired
Conversation messages
thread_idstring or nullOptional
Thread ID for conversation continuity
code_modeenumOptionalDefaults to inline

‘inline’ (default): the agent streams final code as fenced markdown tokens with the canonical framework language tag. ‘file’: the agent writes code to a virtual filesystem instead; written files are streamed back in a terminal ‘files’ SSE event.

budgetenumOptionalDefaults to high

Agent effort budget. ‘low’, ‘medium’, and ‘high’ (default) scale the model’s thinking effort, max output tokens, step limit, and parallel research-subagent pool.

fastbooleanOptionalDefaults to falseDeprecated

Deprecated compatibility flag; ignored by the unified agent

modeenumOptionalDefaults to agentDeprecated
'agent' is the unified Coda agent. 'build' and 'learn' are deprecated aliases.

Response

Server-sent event stream. Each event is a JSON object with a `type` field. With `code_mode: "inline"` (default), final code is streamed in `token` events as a complete fenced markdown block with the canonical framework language tag, followed by `completed`. With `code_mode: "file"` the agent writes code to a virtual filesystem instead, and a terminal `files` event carries `data.files` mapping each file path to its contents.

Errors

422
Unprocessable Entity Error