Ask

Responses

Recommended endpoint for Calypso with modern, structured streaming events, grounded citations, and stateful conversations.

Overview

Use the Responses API for Calypso whenever possible. It supports rich, structured streaming events, grounded source metadata, conversation state, and maps well to modern chat UIs.

To call this API you need an API key. Join Calypso for free or sign in.
  • Endpoint: POST /responses
  • Base URL: https://api.calypso.so/v1
  • Authentication: Bearer project API key — see Authentication

Basic request

Minimal JSON request:

{
  "model": "elephant-agent",
  "input": "What is our refund policy?"
}

Python (non-streaming)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_CALYPSO_API_KEY",
    base_url="https://api.calypso.so/v1"
)

resp = client.responses.create(
    model="elephant-agent",
    input="What is our refund policy?"
)

print(resp.output_text)

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

Python (streaming)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_CALYPSO_API_KEY",
    base_url="https://api.calypso.so/v1"
)

stream = client.responses.create(
    model="elephant-agent",
    input="What is our refund policy?",
    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: "https://api.calypso.so/v1",
});

const stream = await client.responses.create({
  model: "elephant-agent",
  input: "What is our refund policy?",
  stream: true,
});

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

Grounded sources

Calypso returns grounded source metadata alongside the answer so you can render citations. Sources surface through the response output in OpenAI-native form:

  • Inline citations — annotation objects on the output_text content, anchored to the answer by start_index / end_index character spans.
  • Source list — the file_search_call output item, whose results[].attributes carry a stable source_index and a display-ready label for each retrieved source.
  • Status metadata — a compact metadata._aicore block reporting retrieval_status and grounded_sources_state.

See Citations and sources for the full schema, JSON examples, the request-level citation_compat / sources_appendix options, and rendering guidance. See Playground grounding states for how to interpret available, hidden, missing, and none.

Attaching files

You can attach a previously uploaded file as input by passing its file_id so the answer is grounded in that document:

{
  "model": "elephant-agent",
  "input": [
    { "type": "input_text", "text": "Summarize the attached contract." },
    { "type": "input_file", "file_id": "file_abc123" }
  ]
}

Uploads are bucket-backed. See Knowledge Buckets and the Upload API for how to create durable knowledge.

Limiting an answer to buckets

Name up to five buckets in metadata._aicore.buckets to answer from those alone, by id or slug:

resp = client.responses.create(
    model="elephant-agent:mcp",
    input="What does my lease say about subletting?",
    metadata={"_aicore": {"buckets": ["home-and-contracts"]}}
)

The list narrows the agent's scope and never widens it. An unknown or archived bucket is a 404 bucket_not_found naming it; more than five, or anything but a list of strings, is a 400. A bucket the agent does not read comes back as an answer with metadata._aicore.answer_failure_code: "bucket_outside_agent_scope" instead of a guess — see Answer failure codes.

Without the list, an agent bound to more than five buckets answers from five of them: Calypso checks up to twenty — the best name matches for the question — keeps buckets holding an attached file, and fills the rest with the buckets that showed the most evidence. The buckets left out are reported in metadata._aicore.bucket_coverage. Two cases are refused instead, with the reason in metadata._aicore.answer_failure_code: attached files spread over more than five buckets (attached_source_outside_scope), and a request with no question to rank by (bucket_store_limit_exceeded). See Policy behavior.

Stateful conversations

The Responses API supports OpenAI-style statefulness on top of Calypso's conversation store. Continue a thread by passing either conversation or previous_response_id — not both:

resp = client.responses.create(
    model="elephant-agent",
    input="And what about international orders?",
    previous_response_id=previous_resp.id
)

Selecting answer effort

Use the OpenAI-standard reasoning.effort field to control how much effort elephant-agent puts into an answer. Allowed values are minimal, low, medium, and high, which map to the Fast, Medium, and Extended answer tiers.

resp = client.responses.create(
    model="elephant-agent",
    input="What is our refund policy?",
    reasoning={"effort": "high"}
)

The tier that actually ran is echoed back in resp.reasoning.effort (capped to your plan's ceiling). See Controlling answer effort for the full mapping and the deprecated metadata.response_policy fallback.

Notes

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