Agents

Responses API

Recommended endpoint for Calypso Agents with modern streaming events.

Overview

Use the Responses API for Calypso Agents whenever possible. It supports rich, structured streaming events and maps well to modern chat UIs.

To call this API you need an API key. Start a free 14-day trial: app.calypso.ms/signup
  • Endpoint: POST /responses
  • Base URL: http://ai.calypso.day/v1

Basic request

Minimal JSON request:

{
  "model": "calypso-agent",
  "input": "Draft a WhatsApp template to confirm an appointment for {{name}}."
}

Python (non-streaming)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_CALYPSO_API_KEY",
    base_url="http://ai.calypso.day/v1"
)

resp = client.responses.create(
    model="calypso-agent",
    input="Draft a WhatsApp template to confirm an appointment for {{name}}."
)

print(resp.output_text)

Set stream=True to receive SSE events as the model generates output.

Python (streaming)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_CALYPSO_API_KEY",
    base_url="http://ai.calypso.day/v1"
)

stream = client.responses.create(
    model="calypso-agent",
    input="Draft a WhatsApp template to confirm an appointment for {{name}}.",
    stream=True
)

for event in stream:
    if event.type == "response.output_text.delta":
        print(event.delta, end="")

JavaScript (Node.js streaming)

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CALYPSO_API_KEY,
  baseURL: "http://ai.calypso.day/v1",
});

const stream = await client.responses.create({
  model: "calypso-agent",
  input: "Draft a WhatsApp template to confirm an appointment for {{name}}.",
  stream: true,
});

for await (const event of stream) {
  if (event.type === "response.output_text.delta") {
    process.stdout.write(event.delta);
  }
}

Notes

  • Handle disconnects and retries gracefully.
  • If the user cancels, abort the request and stop rendering deltas.