mMengbi Router

API / ANTHROPIC

Anthropic native

Call Claude through the native Anthropic protocol to preserve message structure and streaming events.

!

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

01 /

Anthropic native

Use the native Anthropic protocol for Claude models to preserve message structure, streaming events, and model capabilities.

Basic request

POST /v1/messages
bash
curl https://router-api.mengbi-ai.net/v1/messages \
  -H "x-api-key: sk-mengbi-xxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Introduce yourself in one sentence"}]
  }'

Streaming request

Add stream: true to the request body. The response uses text/event-stream; keep reading events instead of parsing it as one JSON document.

json
{
  "model": "claude-sonnet-5",
  "max_tokens": 1024,
  "stream": true,
  "messages": [{"role": "user", "content": "Write a five-line poem"}]
}

NoteA common event sequence is message_start, content_block_delta, message_delta, and message_stop.