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). Optional team_id bills an Enterprise team wallet. Personal tokens bill the personal wallet unless team_id is set. Team service-account keys always bill their team. A mismatched team_id returns 400. There is no fallback to the personal wallet. Response headers include X-Run-Id, X-Thread-Id, and X-Team-Id (when a team is billed). Settled cost is not in the SSE payload; look it up with the usage API.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Headers
Request
Optional Enterprise team wallet to bill. Personal tokens bill the personal wallet unless team_id is set. Team service-account keys always bill their team (omitting team_id does not switch to personal billing). A mismatched team_id returns 400. A short team wallet returns 402 with no fallback to the personal wallet.
‘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.
Agent effort budget. ‘low’, ‘medium’, and ‘high’ (default) scale the model’s thinking effort, max output tokens, step limit, and parallel research-subagent pool.
Deprecated compatibility flag; ignored by the unified agent
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.