Authentication
API keys created from organization settings receive all developer scopes by
default. Existing keys created before this API shipped need
agents:invoke
added in organization settings.agents:invoke on the client. Session-authenticated calls include organizationId in the JSON body for writes and in the query string for the run lookup. API-key requests omit organizationId.
Wait for the result
--timeout is omitted.
200:
thread_id on the next call to continue the same conversation.
Start and poll
202 immediately:
202 body is the run itself in queued state. The Location header points at the run, and Retry-After gives the seconds to wait before polling. Poll responses keep sending Retry-After while the run is queued or running.
Poll with the run id:
queued and running responses have an empty messages array. completed, awaiting_approval, and failed include the stored result. A sync invoke is stored too, so the same GET works after a waiting call.
A thread can have one queued or running run. A second start or invoke on that thread returns 409 until the active run finishes. A run that stops reporting progress is marked failed after 20 minutes running, or after an hour still queued, so a crashed worker cannot hold a thread.
Thread ids belong to your organization. The same thread_id in another organization is a different conversation, and API threads never continue in-app chats.
Request body
Message
content is a string or an array of parts. A text part is { "type": "text", "text" }. An image part is { "type": "image", "url", "filename"? }. role is user, assistant, or system. When role is omitted it is user.
Image parts belong on the latest user message. url is an already uploaded http or https address. A message can contain up to 20 parts and can be images only. The same image parts work on invoke and on start.
config.enabled_tools limits the run to named Omni agent tools. Omit it to use the organization’s agent tools. An empty array runs with no tools. Unknown tool names return 400. config.system_prompt replaces the agent prompt for that call. config.structured_output is a JSON Schema object ("type": "object"). When the agent completes, structured_output in the response is the value that matches that schema. A schema mismatch fails the run.
Approvals
A tool that needs approval returns200 from invoke, or a polled run, with status: "awaiting_approval". approvals lists each pending action:
thread_id with decisions and no new messages. One decision applies to every pending action. Otherwise send one decision per pending action, in order. Decisions on a thread whose latest run is not awaiting_approval return 409.
POST /api/v1/agents/general/runs.
Status values
Errors
Error bodies use the standard developer API envelope. When a run was created before the failure,
data.run_id and data.thread_id identify it, so GET /api/v1/agents/general/runs/{runId} returns the stored transcript.
SDK and CLI
omni agents general invoke waits up to 780 seconds unless you pass --timeout.