Run an agent
Sends a message to an agent instance and returns the response. When the stream header is true, the response is an AI SDK UIMessage stream over SSE (text/event-stream); otherwise a sync JSON response is returned. The agent’s rights_mode controls whether an API key or session JWT is required — public agents allow unauthenticated calls. An agent-scoped API key is only valid for its bound agent instance. Supply the session header to persist messages to a session.
Authorizations
Organisation API key. Format: sk_<secret>/<keyname> — the secret portion, a literal slash, and the human-readable key name. The header exulu-api-key is accepted as an alias. A Bearer prefix is tolerated and stripped. Keys with an agent scope are only valid for the scoped agent instance.
Headers
Set to true to receive a streaming SSE response (AI SDK UIMessage stream). Omit or set to false for a synchronous JSON response.
true, false Agent session ID. When provided, message history is loaded from and saved to the session. The caller must have write access to the session.
LiteLLM model ID to use for this request, overriding the model configured on the agent. Only accepted when the resolved model is permitted for the calling user.
Path Parameters
Agent ID (UUID).
Body
The user message to send. Used when session is set or when sending a single message without history.
Full conversation history. When provided without a session header and without a message field, the last element is used as the current message and the rest as prior context.
Additional system instructions appended to the agent's base instructions for this run only.
Tool IDs to exclude from this run, even if enabled on the agent.
Skill IDs to exclude from this run.
Tool call IDs that the user has pre-approved for execution without a confirmation prompt.
Response
Successful response. When stream: true the body is an AI SDK UIMessage stream (text/event-stream); each line is a server-sent event carrying a UIMessage part or finish chunk. When stream: false the body is a sync JSON object returned by provider.generateSync.
AI SDK UIMessage stream. Lines are SSE events; each event carries a serialised UIMessage part (text delta, tool-call, tool-result, finish-step, finish). The final finish event includes token usage in its messageMetadata.