Skip to main content
Use the developer agent API to send a conversation to the general Omni agent. The same request body works for a call that waits and for a call that returns immediately. Interactive playground: API reference · Spec: openapi.json

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.
OAuth clients must include 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

The call stays open until the agent completes, pauses for approval, or fails. The route allows up to 800 seconds. TypeScript and Python callers set a client timeout of about 780 seconds. The CLI uses 780 seconds for this command when --timeout is omitted.
A finished or paused run returns 200:
Pass the returned thread_id on the next call to continue the same conversation.

Start and poll

This queues the same agent and returns 202 immediately:
The 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 returns 200 from invoke, or a polled run, with status: "awaiting_approval". approvals lists each pending action:
Resume on the same 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.
The same body works on 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.