LogoMiMo API Docs
LogoMiMo API Docs
HomepageWelcome

Quick Start

Pricing & Rate Limits

API Reference

Guides

Support

FAQ

Anthropic Compatible API

Use the Anthropic-compatible endpoint to interact with MiMo models via the Messages API format.

Endpoint

POST https://api.mimo-v2.com/anthropic/v1/messages

Authentication

Authenticate requests using the following header:

HeaderFormat
api-key<your-api-key>

You can generate API keys from Settings → API Keys in your Mimo dashboard.

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID. Options: mimo-v2-pro, mimo-v2-omni, mimo-v2-flash
messagesarrayYesArray of message objects
max_tokensintegerYesMaximum tokens to generate
systemstringNoSystem prompt
temperaturenumberNoSampling temperature (default: 1.0)
top_pnumberNoNucleus sampling (default: 0.95)
streambooleanNoEnable streaming (default: false)
stop_sequencesarrayNoStop sequences

Message Object

FieldTypeDescription
rolestringOne of: user, assistant
contentstring/arrayMessage content (text or content block array)

Example Request

curl https://api.mimo-v2.com/anthropic/v1/messages \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_API_KEY" \
  -d '{
    "model": "mimo-v2-pro",
    "max_tokens": 1024,
    "system": "You are a helpful assistant.",
    "messages": [
      {"role": "user", "content": "Hello, who are you?"}
    ]
  }'

Response Format

{
  "id": "msg_xxx",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Hello! I am MiMo..."
    }
  ],
  "model": "mimo-v2-pro",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 50,
    "output_tokens": 100
  }
}

Response Fields

FieldDescription
idUnique identifier for the message
typeAlways message
roleAlways assistant
contentArray of content blocks
content[].typeContent block type (e.g., text)
content[].textThe generated text
modelThe model used
stop_reasonWhy the model stopped: end_turn, max_tokens, or stop_sequence
usageToken usage statistics

Streaming Response

When stream is set to true, the API returns Server-Sent Events (SSE). The stream consists of a sequence of typed events.

Streaming Request Example

curl https://api.mimo-v2.com/anthropic/v1/messages \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_API_KEY" \
  -d '{
    "model": "mimo-v2-pro",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello!"}
    ],
    "stream": true
  }'

Streaming Event Format

The stream emits a series of SSE events with different types:

event: message_start
data: {"type":"message_start","message":{"id":"msg_xxx","type":"message","role":"assistant","content":[],"model":"mimo-v2-pro","stop_reason":null,"usage":{"input_tokens":50,"output_tokens":0}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"!"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":15}}

event: message_stop
data: {"type":"message_stop"}

Stream Event Types

EventDescription
message_startIndicates the start of the message with metadata
content_block_startMarks the beginning of a new content block
content_block_deltaContains incremental text content
content_block_stopMarks the end of a content block
message_deltaContains message-level updates (e.g., stop reason)
message_stopIndicates the end of the stream

Unlike the OpenAI streaming format, Anthropic-compatible streaming uses typed events with an event: field followed by a data: field for each SSE event.

Table of Contents

Endpoint
Authentication
Request Parameters
Message Object
Example Request
Response Format
Response Fields
Streaming Response
Streaming Request Example
Streaming Event Format
Stream Event Types