Skip to main content
This guide is for a developer wiring a server-side integration. You create a conversation for one end user, send a message, read the streamed answer, and fetch the stored transcript. It takes four requests.

Prerequisites

  • An API key. Either an organization API key from the portal (Settings, then API keys) or a scoped key (nxsk_v1_...) that carries conversations:use. The examples read the key from the NEXIO_API_KEY environment variable. See Authentication and access.
  • A Conversation instance with at least one published version. Create and publish one in the portal under Conversations, or see Versions and publish. The examples use the slug workspace-assistant.
  • An end_user value for the person your application is serving. The examples use u_dana_ortiz. Send the same value on every request for that person’s conversations.
Call these routes from your server. The API sends no CORS headers, and the key must never reach a browser.
1

Confirm the instance is published

List the instance’s released versions. For an instance you manage yourself, an empty list means turns will return 409 instance_not_published. An instance that follows another instance (a follower) runs the versions released on the instance it follows, so its own list can be empty while turns work.
Response 200:
2

Create a conversation

Create a conversation for the end user. title and scope are optional. scope is a JSON object your application can use to remember what the conversation is about. It never grants access to anything.
Response 201:
3

Send a message and read the stream

Post a turn with message. The response is a Server-Sent Events stream: each frame is an event: line, a data: line of JSON, and a blank line. Read frames until a turn_end or error frame arrives. Set no client read timeout shorter than the 10-minute server limit on a segment.
The stream for this message:
The first frame is conversation. It carries the turn_id and the id of the user message the turn stored. text_delta frames carry the answer in pieces. The stream ends with exactly one turn_end or error frame. The answer text depends on the instance’s system prompt and tools; the frame shapes do not. Every frame type is described on Turns and streaming.If the connection drops, the turn still runs to completion on the server and is stored. Fetch the conversation to see the result.
4

Read the stored conversation

Fetch the conversation with the same end_user. The response holds the most recent 500 messages of the branch the conversation serves, oldest first.
Response 200:
config_version_hash records which released config answered. parent_message_id links messages on their branch; see Branching.

What to build next

Common errors

Last modified on September 25, 2026