App öffnen
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
FieldTypeDescription
modelreqstring
messagesreqobject[]
streamboolean
temperaturenumber
max_tokensnumber
top_pnumber
stopstring | string[]

Responses

200Completion or SSE stream
422Validation error
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

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}],
)