NylorunDocsBeta
Runtime APISessionsAG-UI

Run an agent

POST
/v1/ag-ui/agents/{agentId}

For a person, named by a trusted issuer's token or by Nylorun-Subject. The thread is one session per person, agent and thread, created on its first run with forwardedProps.nylorun.session. The trailing user message starts a turn (its id is the idempotency key); resume answers interrupts. A busy session is a RUN_ERROR in the stream.

Authorization

headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

agentId*string

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

Nylorun-Subject?string

The person an application key acts for

Nylorun-Scopes?string

The subject's space-separated scopes; required with a subject

Request Body

application/json
  1. body
threadId*string
runId*string
protocolVersion?string
parentRunId?string
state?unknown|null
messages*array<||||||>
tools?array<>
Default[]
context?array<>
Default[]
forwardedProps?unknown
resume?array<>
[key: string]?unknown

Response Body

The run's events, from RUN_STARTED to its end

text/event-stream
curl -X POST "https://example.com/v1/ag-ui/agents/string" \  -H "Nylorun-Protocol: string" \  -H "Content-Type: application/json" \  -d '{    "threadId": "string",    "runId": "string",    "messages": [      {        "id": "string",        "role": "developer",        "content": "string",        "property1": null,        "property2": null      }    ],    "property1": null,    "property2": null  }'
Empty