NylorunDocsBeta
Runtime API

Agents SDK

The TypeScript client your app server uses to call the Runtime API.

npm install @nylorun/agents
import { createClient } from "@nylorun/agents";

const client = await createClient();

const session = await client.createSession({
  agentId: "assistant",
  ownerUserId: user.id,
});
await session.input("Where is order demo-123?", {
  idempotencyKey: crypto.randomUUID(),
});

@nylorun/agents calls the Runtime API with an application key. Run it on your server, never in a browser: the Runtime refuses a key sent with an Origin header. It requires Node 24 or later.

Each endpoint page in this section shows the SDK call first, then cURL.

The client

CallEndpoints
client.saveAgent(), client.listAgents()Agents
client.filesDefinition files
client.createSession(), client.session(id), client.sessions.page()Sessions API
client.sandboxesSandboxes
client.artifactsArtifacts
client.hostFeatures(), client.access.jwks()Runtime
client.as(subject)Any of the above, for one signed-in person

The AG-UI and A2A endpoints are for those protocols' clients. createAgUiHandler() from @nylorun/agents/ag-ui and createA2aHandler() from @nylorun/agents/a2a serve them from your own server.

Entry points

ImportContents
@nylorun/agentsThe client, the agent builder, tools, MCP, skills, plugins, and errors
@nylorun/agents/clientcreateClient and the client classes only
@nylorun/agents/defineThe agent builder and tools, without the file-reading .skills() and .plugin()
@nylorun/agents/ag-uicreateAgUiHandler()
@nylorun/agents/a2acreateA2aHandler()

Defining agents, tools, and flows is covered in Build.

On this page