API / OPENAI

OpenAI-compatible

Use Chat Completions with Codex and most OpenAI-compatible clients.

!

This page is the preview integration contract for individual Mengbi Router users. Examples will remain compatible when the production gateway opens.

01 /

OpenAI-compatible

For the OpenAI SDK, Codex, and most clients that support Chat Completions.

Chat Completions

POST /v1/chat/completions
bash
curl https://router-api.mengbi-ai.net/v1/chat/completions \
  -H "Authorization: Bearer sk-mengbi-xxxxxx" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Streaming request

Add stream: true to the Chat Completions request. The response uses standard OpenAI SSE chunks and ends with data: [DONE].

json
{
  "model": "gpt-5.6-sol",
  "stream": true,
  "messages": [{"role": "user", "content": "Write a short introduction"}]
}