Skip to main content
Every deployed agent speaks AG-UI, the protocol agent front ends use to show an agent at work. Point an AG-UI client at your agent’s AG-UI URL and it receives your agent’s text, tool calls, tool results and steps as they happen, with nothing to write on the agent’s side. Onecortex implements AG-UI 1.0, including interrupts.

The endpoint

The client sends a RunAgentInput and reads a stream of AG-UI events back. Every AG-UI run streams. Every call carries an API key as a bearer token:
Create a key under API keys in the dashboard. It is shown once, when you create it. See API keys.

Call it

With the official client, @ag-ui/client:
agui.ts
The client checks every event against the AG-UI schema and its ordering rules, and fails the run if one breaks them.

The request

A RunAgentInput, at most 1 MB.
string
The conversation. It is your agent’s session: the same thread reaches the same running instance, so your agent remembers. 1 to 256 characters. Left out, Onecortex generates one.
string
Echoed on RUN_STARTED and RUN_FINISHED. Generated when left out.
array
required
The conversation as the client holds it. The text of the last user message is your agent’s prompt, and the whole list reaches your agent as messages, each as { "role": "...", "content": "..." } with text parts joined. A run with no user message and no resume is refused with 400 before your agent is called: Send at least one user message, or a resume to answer a paused run.
array
The answer to a run that ended with an interrupt. See Pauses.
any
Reach your agent unchanged, as params, with any other field the client sends. Onecortex does not run a front end’s tools or read its state: your agent decides what they mean. Each framework page says where params arrive in your code.

The events

Each line is an unnamed data: frame holding one AG-UI event. While your agent is silent, a : ping comment arrives every 15 seconds, which AG-UI clients ignore. What your agent reports depends on its framework: see Streaming. Anything still open when the run ends, a message, a tool call or a step, is closed before RUN_FINISHED.

Pauses

A run your agent pauses for a person, as in Human in the loop, ends with RUN_FINISHED whose outcome lists the interrupts:
An interrupt your agent gave no reason carries input_required, because AG-UI requires one. To continue, run again on the same threadId with a resume that answers every interrupt:
An agent that does not pause answers a resume with RUN_ERROR and VALIDATION_ERROR: This agent does not pause for input, so there is nothing to resume.

Errors

A refusal before the stream starts, such as a missing key, another organization’s agent or a rate limit, is an HTTP error with the same JSON body and status as the invoke API, which AG-UI clients report as a failed run. See Errors. A failure after the stream starts is a RUN_ERROR event, with the message from Errors and one of these codes:

From a browser

A web page can call the AG-UI URL directly: Onecortex allows any origin for requests that carry an API key, and never sends credentials of its own. Anyone who can read the page can read its key, so use a key scoped to this one agent, or call through your own server.

Limits

AG-UI runs share your organization’s and agent’s invoke limits: each run counts as one request and holds one of the organization’s open streams.
Last modified on September 29, 2026