AETHER

Aether Public API

Start and run a live, real-time voice conversation from your own product. You send audio in and get audio and text back over a single WebSocket. We run the model servers, scaling and routing behind it; every session is relayed through api.manifestro.io.

Parts of this page are marked contract 2.1. That is the version of the wire protocol between clients, the API and the model servers; those parts work once the API and the model you use run that version. Everything unmarked works on every version, and clients must ignore fields and frame types they do not know — so code written against this page keeps working either way.

How it fits together

  1. Create a session for a model with POST /public/sessions. You get back a connect_url.
  2. Open connect_url as a WebSocket and wait for the handshake frame. Then stream the user's audio in, and play the audio and read the text that come back.
  3. Close the socket when the conversation is over. The session ends with it.

A session is single-use and single-connection: once its socket closes, it is finished and cannot be resumed. Start a new one for the next conversation.

Your API key

Paste a key here and it is filled into the commands on this page and used by the playground. It is kept in this page's memory only — not saved in your browser, not put in the address bar — and is gone when you reload.

No key yet? Sign in and create one in your profile.

Quickstart

Create a session:

bash
curl -X POST "https://api.manifestro.io/api/v1/public/sessions" \
  -H "Authorization: Bearer mfro-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model_id": "MODEL_ID"}'

Replace MODEL_ID with the id of a model — see Models.

Then open the returned connect_url with a WebSocket client and stream audio. The code examples are complete programs that do all of it; the playground does it from this page.

Authentication

Every request carries an API key as a bearer token. Keys start with mfro-, are created in your profile, and are shown exactly once: we store only a one-way hash and the first few characters, which your profile shows so you can tell keys apart.

http
Authorization: Bearer mfro-your-key

A key acts as your account. Use it only from a server you control — never ship it in a web page or a mobile app, where anyone can read it. A browser gets the connect_url of one session from your backend instead (see the Browser example). You can revoke a key in your profile at any time; that takes effect immediately and cannot be undone.

The /public/… endpoints accept API keys only; the token of a signed-in browser session is rejected with 401.

Models

A session runs on one model, named by its id (a short slug). Only active models accept sessions.

Checking whether you are signed in…

The same list from the API — an array of objects with id, name, description and is_active:

bash
curl "https://api.manifestro.io/api/v1/models?only_active=true" \
  -H "Authorization: Bearer mfro-your-key"

Sessions

A session is one conversation. It moves through reserved (created, nobody connected yet) → active (socket open) → ended or failedcontract 2.1. A reserved session that nobody connects to is released automatically after a short time — about half a minute — so open the socket right after creating it.

connect_url is always a wss://api.manifestro.io address on our own servers. It already contains the session token, so treat it as a secret for as long as the session lives, and hand it only to the client that will hold the conversation.

Session settings contract 2.1

POST /public/sessions takes an optional config object next to model_id. Every field is optional. A model reports which fields it supports; a field it does not support is rejected with 422 unsupported_config. API versions before contract 2.1 do not act on config.

FieldTypeMeaning
system_promptstring, ≤ 16000 charactersThe role and the facts the agent should use.
voicestringVoice identifier.
temperaturenumber, 0–2Sampling temperature.
max_tokensinteger, 16–1024Upper bound on the length of one reply.
greetingstring, ≤ 500 charactersThe first thing the agent says.
pronunciationsobject {word: spelling}How to pronounce specific words.
turnobjectTurn-taking thresholds: vad_threshold, max_silence_ms, barge_in_ms, turn_threshold.
recordbooleanWhether the transcript of this session is stored.
prompt_idstringYour own identifier for the prompt, kept with the session.
json
{
  "model_id": "MODEL_ID",
  "config": {
    "system_prompt": "You are the front desk of a dental clinic. Be brief.",
    "greeting": "Hello, how can I help?"
  }
}

Realtime protocol

Every message on the socket is binary. The first byte is the frame type; the rest is the payload.

TypeDirectionPayload
0x00server → clientHandshake. Sent once, right after the socket opens: the model is ready for audio.
0x01client → serverYour audio: one or more Ogg Opus pages (24 kHz, mono).
0x01server → clientThe reply audio: Ogg Opus pages (24 kHz, mono), in 80 ms steps.
0x02server → clientText of the reply, UTF-8, as it is spoken.
0x02client → serverTyped input from the user, UTF-8. Answered by voice.contract 2.1
0x04server → clientWhat the model heard the user say: JSON {"text": string, "final": boolean}.contract 2.1
0x05server → clientState event: JSON {"event": string, …} — see the list below.contract 2.1
0x05client → serverControl: JSON {"type": "interrupt" | "mute" | "unmute"}.contract 2.1
Ignore frame types you do not know. New types are added without notice, and a client that throws on an unknown first byte will break. The same goes for unknown fields in JSON payloads and unknown event names.

Wait for the handshake. Send nothing until the 0x00 frame arrives — not on the socket's open event.

Audio is an Ogg Opus stream, cut into frames. In each direction the 0x01 payloads, put end to end, form one continuous Ogg Opus stream: mono, 24 kHz. It begins with the two Ogg header pages, which you must send first, and each frame you send should hold whole Ogg pages. Keep one encoder and one decoder for the whole connection — a frame is not a standalone audio file. Our own web client encodes with 20 ms Opus frames and the audio application (2049).

Text (0x02) arrives interleaved with the audio, as the reply is produced. Depending on the model it comes as short fragments or whole phrases; append fragments as they are, without adding spaces.

State events — frame 0x05 contract 2.1

eventMeaning
agent_thinkingThe model has started working on a reply.
agent_speakingReply audio is being sent.
agent_idleThe model is listening.
interruptedThe reply was cut off by the user; drop any audio you have queued.
time_warningThe session is about to hit its time limit. Field: seconds_left.
laggingThe model is behind real time. Field: lag_ms.
errorSomething went wrong but the session is still open. Fields: code, message.
drainingThe server is being taken out of rotation; the session continues to its end.

On versions before contract 2.1 there are no events and no control frames: the model simply listens while it speaks, and you interrupt it by talking over it.

Closing and close codes

To end a conversation, close the socket (code 1000). The session ends on our side as soon as either side closes. POST /public/sessions/{id}/end does the same for a session you never connected to, or one you want to cut off from your backend; it is safe to call more than once.

When we close the socket, the close frame says why contract 2.1. The reason string is the stable identifier; the numeric code is the same information for clients that cannot read the reason.

reasonCodeWhat happenedWhat to do
client_closed1000You closed the socket or ended the session.Nothing — this is the normal end.
invalid_token4001The session token in connect_url was not accepted.Create a new session; do not retry the same URL.
reservation_expired4002The session was not connected in time after it was created.Create a new session and connect right away.
no_capacity4003The slot was no longer available when you connected.Create a new session, or poll /public/capacity first.
time_limit4004The session reached its maximum duration.Start a new session to continue.
idle_timeout4005No audio arrived from you for too long.Keep sending audio (silence included) while the session is open.
engine_failed4006The model or the relay failed.Create a new session; contact support if it repeats.
force_reset4007The session was ended from our side, e.g. by an operator.Create a new session.
shutdown4008The server running the session is shutting down.Create a new session; another server will take it.
network_lostnone (1006 locally)The connection dropped without a close frame.Create a new session — a session cannot be resumed.

API versions before contract 2.1 do not send these codes: the socket closes with 1000, or drops without a close frame (your client then reports 1006). So treat every close as the end of the session, and use the reason only to decide what to tell the user. A connection to a session that is unknown, already finished, or opened with the wrong token may be refused during the WebSocket handshake; a browser reports that as a failed connection with code 1006.

Audio timing and realtime behaviour

This is a full-duplex stream, not a request/response API. When you send matters as much as what you send.

Send audio at the pace it is captured. One 20 ms frame roughly every 20 ms, as it comes off a microphone. The model consumes your audio in 80 ms steps and produces 80 ms of reply for each. Sending a recording faster than real time only queues audio the model has not reached yet: it does not answer sooner, and the conversation drifts away from the clock.

Keep sending for the whole session — silence included. The model advances only as your audio arrives. If you stop sending, you stop receiving, and a session that stays silent on the wire for too long is closed (idle_timeoutcontract 2.1). To mute the user, send silence instead of nothing.

Full-duplex, not turn-based. Audio flows both ways at once; there is no "your turn" signal. The model keeps listening while it speaks, so the user can interrupt simply by talking.

No resume. A session is exactly one WebSocket connection. If it drops — a network blip, a proxy timeout, a crashed client — that session is over, and the conversation continues only in a new one. Nothing is buffered for you on our side beyond the connection itself.

Code examples

Each example is a complete program: create a session, connect, wait for the handshake, stream audio, handle audio, text, the newer frames and the close, and release the session. The API key is read from the AETHER_API_KEY environment variable; the model is the first active one unless you set AETHER_MODEL_ID.

Needs Node.js 18 or newer, the ws package and ffmpeg on your PATH (it does the Opus encoding). It sends an audio file at real-time pace, keeps listening, prints the transcript and writes the spoken reply to reply.ogg.

run
npm install ws
AETHER_API_KEY=mfro-your-key node aether.mjs question.wav
aether.mjs
// aether.mjs — a complete conversation with Aether from Node.js 18 or newer.
//
//   npm install ws                         (ffmpeg must be on your PATH)
//   AETHER_API_KEY=mfro-... node aether.mjs question.wav
//
// Sends question.wav to the model at real-time pace, keeps listening for
// LISTEN_SECONDS after it ends, prints the transcript and saves the spoken
// reply to reply.ogg. Any audio file ffmpeg can read works as input. To talk
// through a microphone instead, replace the two arguments "-i", input below
// with your capture device, e.g. "-f", "avfoundation", "-i", ":0" (macOS)
// or "-f", "alsa", "-i", "default" (Linux).
import { spawn } from "node:child_process";
import { createWriteStream } from "node:fs";
import process from "node:process";
import { setTimeout as sleep } from "node:timers/promises";
import WebSocket from "ws";

const API_BASE = process.env.AETHER_API_BASE ?? "https://api.manifestro.io/api/v1";
const API_KEY = process.env.AETHER_API_KEY;
const input = process.argv[2];
const LISTEN_SECONDS = 20;

if (!API_KEY || !input) {
  console.error("Usage: AETHER_API_KEY=mfro-... node aether.mjs <audio file>");
  process.exit(1);
}

// Close codes of API versions that implement contract 2.1. Older versions
// close with 1000 or a generic code — either way, a close ends the session.
const CLOSE_REASONS = {
  1000: "client_closed",
  4001: "invalid_token",
  4002: "reservation_expired",
  4003: "no_capacity",
  4004: "time_limit",
  4005: "idle_timeout",
  4006: "engine_failed",
  4007: "force_reset",
  4008: "shutdown",
};

async function api(method, path, body) {
  const res = await fetch(API_BASE + path, {
    method,
    headers: { Authorization: "Bearer " + API_KEY, "Content-Type": "application/json" },
    body: body === undefined ? undefined : JSON.stringify(body),
  });
  const data = await res.json().catch(() => null);
  if (!res.ok) {
    const detail = data && data.detail;
    const code = detail && detail.code ? detail.code : "error";
    const message = detail && detail.message ? detail.message : JSON.stringify(detail);
    throw new Error(method + " " + path + " failed: HTTP " + res.status + " " + code + " - " + message);
  }
  return data;
}

function parseJson(payload) {
  try {
    return JSON.parse(payload.toString("utf8"));
  } catch {
    return null;
  }
}

// Length of the first complete Ogg page in the buffer, or 0 if it is not all there yet.
function oggPageLength(buffer) {
  if (buffer.length < 27) return 0;
  if (buffer.toString("latin1", 0, 4) !== "OggS") throw new Error("ffmpeg did not produce an Ogg stream");
  const segments = buffer[26];
  if (buffer.length < 27 + segments) return 0;
  let length = 27 + segments;
  for (let i = 0; i < segments; i++) length += buffer[27 + i];
  return buffer.length >= length ? length : 0;
}

// Encodes the input as Ogg Opus (24 kHz, mono, 20 ms frames) and sends it one
// Ogg page per 0x01 frame. Each page is held back until its own timestamp, so
// audio is never sent faster than real time.
async function streamAudio(ws) {
  const ffmpeg = spawn(
    "ffmpeg",
    [
      "-hide_banner", "-loglevel", "error",
      "-i", input,
      "-af", "apad=pad_dur=" + LISTEN_SECONDS,
      "-ac", "1", "-ar", "24000",
      "-c:a", "libopus", "-application", "audio", "-frame_duration", "20",
      "-f", "ogg", "-page_duration", "20000", "-flush_packets", "1",
      "pipe:1",
    ],
    { stdio: ["ignore", "pipe", "inherit"] },
  );
  ffmpeg.on("error", (err) => console.error("Could not run ffmpeg: " + err.message));

  const startedAt = Date.now();
  let pending = Buffer.alloc(0);
  for await (const chunk of ffmpeg.stdout) {
    pending = Buffer.concat([pending, chunk]);
    for (let length = oggPageLength(pending); length > 0; length = oggPageLength(pending)) {
      const page = pending.subarray(0, length);
      pending = pending.subarray(length);
      // Bytes 6-13 of a page: samples so far, counted at 48 kHz.
      const dueIn = startedAt + Number(page.readBigInt64LE(6)) / 48 - Date.now();
      if (dueIn > 0) await sleep(dueIn);
      if (ws.readyState !== WebSocket.OPEN) {
        ffmpeg.kill();
        return;
      }
      ws.send(Buffer.concat([Buffer.from([0x01]), page]));
    }
  }
}

// 1. Pick a model: AETHER_MODEL_ID, or the first active one.
let modelId = process.env.AETHER_MODEL_ID;
if (!modelId) {
  const models = await api("GET", "/models?only_active=true");
  if (models.length === 0) throw new Error("No active model is available.");
  modelId = models[0].id;
}

// 2. Create the session. connect_url already carries the session token.
const session = await api("POST", "/public/sessions", { model_id: modelId });
console.log("Session " + session.id + " reserved on " + modelId + ". Connecting...");

// 3. Open the socket and wait for the 0x00 handshake before sending anything.
const reply = createWriteStream("reply.ogg");
const ws = new WebSocket(session.connect_url);
let streaming = false;

ws.on("message", (data, isBinary) => {
  if (!isBinary || data.length === 0) return;
  const payload = data.subarray(1);
  switch (data[0]) {
    case 0x00: // handshake: the model is ready for audio
      if (streaming) break;
      streaming = true;
      streamAudio(ws)
        .catch((err) => console.error(err.message))
        .finally(() => ws.close(1000, "client_closed"));
      break;
    case 0x01: // reply audio: Ogg Opus pages, written out as one .ogg file
      reply.write(payload);
      break;
    case 0x02: // reply text
      process.stdout.write(payload.toString("utf8"));
      break;
    case 0x04: { // what the model heard you say (contract 2.1)
      const heard = parseJson(payload);
      if (heard && heard.final) console.log("\n[you] " + heard.text);
      break;
    }
    case 0x05: { // state events (contract 2.1)
      const event = parseJson(payload);
      if (event) console.log("\n[event] " + JSON.stringify(event));
      break;
    }
    default: // frame types you do not know must be ignored
      break;
  }
});

ws.on("error", (err) => console.error("WebSocket error: " + err.message));

// 4. A close ends the session. Report why, then release it on the API side.
ws.on("close", async (code, reasonBytes) => {
  reply.end();
  const reason =
    reasonBytes.toString("utf8") || CLOSE_REASONS[code] || (code === 1006 ? "network_lost" : "unknown");
  console.log("\nClosed: " + code + " " + reason + ". Reply audio saved to reply.ogg");
  // Idempotent: also covers a socket that never opened.
  await api("POST", "/public/sessions/" + session.id + "/end").catch((err) => console.error(err.message));
});

process.on("SIGINT", () => ws.close(1000, "client_closed"));

Playground: run a test session

Try the API without writing code: this creates a session with your key and holds the conversation in this tab, through your microphone and speakers.

Loading the playground…

API reference

Base URL: https://api.manifestro.io/api/v1. Requests and responses are JSON. The same reference as a machine-readable document: .

GET/models

Lists models. Query: only_active (boolean, default true).

GET/public/capacity

Tells whether a session could start right now, without creating one. Query: model_id (required).

json — 200
{
  "available": false,
  "next_available_at": "2026-09-30T12:04:00Z",
  "seconds_until": 47
}

When available is true the other two fields are null. seconds_until is an estimate — the time until the oldest running session reaches its time limit — and can be null when there is nothing to estimate from.

POST/public/sessions

Creates a session. Body: model_id (required) and, on contract 2.1 versions, an optional config (see Sessions).

json — request
{ "model_id": "MODEL_ID" }
json — 201
{
  "id": "a1b2c3d4-…",
  "session_token": "9f8e7d6c…",
  "model_id": "MODEL_ID",
  "mode": "relay",
  "status": "reserved",
  "connect_url": "wss://api.manifestro.io/api/v1/sessions/a1b2c3d4-…/ws?session_token=9f8e7d6c…",
  "created_at": "2026-09-30T12:00:00Z",
  "ended_at": null
}

Open connect_url as it is — the token is already in it. Newer API versions add optional fields to this object (for example duration_seconds, end_reason and config); ignore the ones you do not use.

POST/public/sessions/{session_id}/end

Ends a session: one you have not connected to, or a live one you want to cut off. Ending a session that is already over just returns it. Response — 200, the session object.

bash
curl -X POST "https://api.manifestro.io/api/v1/public/sessions/SESSION_ID/end" \
  -H "Authorization: Bearer mfro-your-key"

Errors

An error is a JSON body with a stable code to match on and a human-readable message that may change:

json — 404
{ "detail": { "code": "model_not_found", "message": "Model 'my-model' not found" } }
StatuscodeMeaning
401unauthorizedThe API key is missing, unknown or revoked — or it is not an mfro- key at all.
403ip_blockedAccess denied: the IP address the request came from is blocked. Every endpoint can return this.
403email_not_verifiedThe account that owns the key has not confirmed its email address.contract 2.1
404model_not_foundNo model with that id exists.
404model_not_activeThe model exists but is not accepting sessions.
404session_not_foundUnknown session id, or the session belongs to another account.
422— (detail is a list)The request body failed validation; each entry names the field in loc and the problem in msg.
422unsupported_configA config field is not supported by this model; detail.fields lists which.contract 2.1
429daily_session_limit_reachedThe account has used all its sessions for the last 24 hours.
503no_capacityEvery slot of that model is busy. Retry later, or poll /public/capacity.
503maintenanceThe service is in maintenance mode.contract 2.1

A request that never gets an HTTP response (DNS, TLS, a dropped connection) is a network failure on the way to us, not an API error: retry it. 503 no_capacity is also safe to retry — nothing was created and nothing was counted.

Limits

Two limits apply to every API key. Both belong to the account, not to the key: all keys of an account, and the conversations its owner has in the chat, count together.

  • Sessions per 24 hours. A rolling window, not a fixed reset time: a session stops counting 24 hours after it was started. Going over returns 429 daily_session_limit_reached.
  • Maximum session duration. A session is not meant to run longer than this. On contract 2.1 versions the server enforces it: it closes the socket with time_limit when the time is up, and sends a time_warning event shortly before. Older versions do not, so end the session yourself in time.

Need more? Ask us to raise the limits for your account.

Support

Questions, a bug, or a limit that is in your way: write to [email protected]. For a problem with a specific conversation, include the session id and the time — never your API key. Whether the API is up right now is on the status page; what changed recently is in the release notes.