Build on the Sonichaos API
One OpenAI-compatible gateway for chat at /v1, and a platform API at /api for projects, sessions, missions and billing.
Instead of choosing a model and managing prompts, teams define the outcome. SONICHAOS plans the work, assembles a specialized AI workforce, selects the right models and compute, executes the mission, verifies the result and continuously learns from the organization.
Install
There is no Sonichaos SDK to install. The gateway speaks the OpenAI wire format, so your existing OpenAI client works unchanged — you only change the base URL and the key.
npm install openai # or pip install openai
Quickstart
1. Get an API key
An organisation admin mints keys with POST /api/apikeys. The raw key is returned once; the server keeps only a hash.
curl https://sonichaos.ai/api/apikeys \
-H "Authorization: Bearer $SONICHAOS_SESSION" \
-H "Content-Type: application/json" \
-d '{"name":"quickstart"}'
# → { "id": "key_…", "name": "quickstart", "prefix": "sk_live_…", "key": "sk_live_…" }2. Set the base URL
Point your client at https://sonichaos.ai/v1 for chat, and https://sonichaos.ai/api for the control API.
3. Make your first chat call
Any model id returned by GET /v1/models works. Streaming is supported with stream: true.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.SONICHAOS_API_KEY,
baseURL: "https://sonichaos.ai/v1",
});
const chat = await client.chat.completions.create({
model: "gpt-4o", // any id from GET /v1/models
messages: [{ role: "user", content: "Say hello in one word." }],
max_tokens: 16,
});
console.log(chat.choices[0].message.content);Or with curl:
curl https://sonichaos.ai/v1/chat/completions \
-H "Authorization: Bearer $SONICHAOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Say hello in one word."}],"max_tokens":16}'API reference
Two surfaces, one credential model. Both authenticate with Authorization: Bearer <token> — the gateway takes an API key or a sandbox token, and the platform API takes a session token.
OpenAI-compatible gateway · /v1
/v1/models/v1/chat/completionsPlatform API · /api
Projects & files
/api/projects/api/projects/api/projects/:id/api/projects/:id/api/projects/:id/sandbox-token/api/projects/:id/files/api/projects/:id/files/*path/api/projects/:id/files/*path/api/projects/:id/files/*path/api/projects/:id/files-presign/*pathSessions & missions
JSON-RPC methods on the WebSocket at /ws, not REST paths.
session.listsession.createsession.opensession.sendsession.editsession.stopsession.approvesession.deletemission.listmission.getmission.createmission.cancelmission.resetworkforce.listestimate.proposeBilling & usage
/api/billing/api/billing/checkout/api/billing/webhook/api/usage/api/usage/limitIdentity & orgs
/api/me/api/me/export/api/me/api/orgs/api/orgs/api/orgs/members/api/orgs/members/api/orgs/members/:userId/api/orgs/members/:userId/api/apikeys/api/apikeys/api/apikeys/:idAuth
/api/auth/signup/api/auth/signin/api/auth/refresh/api/auth/signout/api/auth/switch-org/api/waitlistEvents, analytics & more
/api/events/api/analytics/api/decisions/api/audit/api/healthz/api/ws/ticket/api/personal/api/hf/search/api/hf/models/:id/api/projects/:id/hf/download