stratus

Getting Started

Install Stratus and run your first agent

Installation

bun add stratus-sdk zod

Zod is a peer dependency used for tool parameter schemas and structured output.

Prerequisites

You need an Azure OpenAI resource with a deployed model. You'll need:

  • Endpoint - Your Azure OpenAI endpoint URL
  • API Key - An API key for authentication
  • Deployment - The name of your deployed model (e.g. gpt-5.2)

Create a Model

model.ts
import { AzureResponsesModel } from "stratus-sdk";

const model = new AzureResponsesModel({
  endpoint: process.env.AZURE_ENDPOINT!,
  apiKey: process.env.AZURE_API_KEY!,
  deployment: "gpt-5.2",
});

Your First Agent

The simplest approach - send a message and get a result:

one-shot.ts
import { prompt } from "stratus-sdk/core";

const result = await prompt("What is 2 + 2?", { model });
console.log(result.output); // "4"

For multi-turn conversations, use createSession():

session.ts
import { createSession } from "stratus-sdk/core";

await using session = createSession({
  model,
  instructions: "You are a helpful assistant.",
});

session.send("Hello!");
for await (const event of session.stream()) {
  if (event.type === "content_delta") process.stdout.write(event.content);
}

// Send another message - previous context is preserved
session.send("What did I just say?");
for await (const event of session.stream()) {
  if (event.type === "content_delta") process.stdout.write(event.content);
}

For lower-level control, create an Agent and use run() or stream() directly:

agent.ts
import { Agent, run } from "stratus-sdk/core";

const agent = new Agent({
  name: "assistant",
  model,
  instructions: "You are a helpful assistant.",
});

const result = await run(agent, "What is the capital of France?");
console.log(result.output); // "The capital of France is Paris."

Next Steps

Edit on GitHub

Last updated on

On this page