Moonborn — API · openai-compat
OpenAI-compatible chat completion shim (model = persona://<id>)
Accepts the OpenAI Chat Completions request shape; routes to the persona chat runtime when model starts with `persona://`. Streaming uses SSE with OpenAI-shaped delta chunks.
POST/v1/chat/completionsscope · Bearer (API key or session JWT)
Request body
| Field | Type | Description |
|---|---|---|
| modelreq | string | |
| messagesreq | object[] | |
| stream | boolean | |
| temperature | number | |
| max_tokens | number | |
| top_p | number | |
| stop | string | string[] |
Responses
200Completion or SSE stream
422Validation error
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/chat/completions \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<string>",
"messages": [
{
"role": "system",
"content": null
}
]
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.openai_compat.openaiCompatChatCompletions({
model: "<string>",
messages: [{"role":"system","content":null}],
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.openai_compat.openai_compat_chat_completions(
model="<string>",
messages=[{"role":"system","content":null}],
)