OpenAI Chat Completions API Compatibility
Please refer to Speech Synthesis (MiMo-TTS Series) - OpenAI API Compatibility for the protocol documentation of the MiMo-TTS series models.
Request Address
https://api.xiaomimimo.com/v1/chat/completions
Request Headers
The API supports the following two authentication methods. Please choose one and add it to the request headers:
api-key: $MIMO_API_KEY
Content-Type: application/json
Request body
- messagesarrayRequiredThe current conversation message list.Hide child attributesDeveloper-provided instructions that the model should follow, regardless of messages sent by the user.Hide child attributesmessages.contentstring | arrayRequiredThe contents of the developer message.Hide child attributesThe contents of the developer message.messages.rolestringRequiredThe role of the message author.
Available options:developermessages.namestringAn optional name for the participant. Provides the model information to differentiate between participants of the same role. - modelstringRequiredModel ID is used to generate the response.
Available options:mimo-v2.5-pro,mimo-v2.5 - frequency_penaltynumber | nullDefault: 0Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Required range:[-2.0, 2.0] - max_completion_tokensinteger | nullAn upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
mimo-v2.5-pro: default131072mimo-v2.5: default32768
[1, 131072] - presence_penaltynumber | nullDefault: 0Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
Required range:[-2.0, 2.0] - response_formatobjectAn object specifying the format that the model must output.Hide child attributesDefault response format. Used to generate text responses.Hide child attributesresponse_format.typestringRequiredThe type of response format being defined. Always
text. - stopstring | array | nullDefault: nullUp to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
- streamboolean | nullDefault: falseIf set to true, the model response data will be streamed to the client as it is generated using server-sent events.
- thinkingobjectThis parameter is used to control whether the model enables the chain of thought.
Note: During the multi-turn tool calls process in thinking mode, the model returns a
reasoning_contentfield alongsidetool_calls. To continue the conversation, it is recommended to keep all previousreasoning_contentin themessagesarray for each subsequent request to achieve the best performance.In thinking mode, the
mimo-v2.5-pro,mimo-v2.5models do not support customizing thetemperatureandtop_pparameters. Even if these parameters are passed in, the actual effective values will be forcibly set by the model to its recommended default values of1.0and0.95.Hide child attributesthinking.typestringRequiredWhether to enable the chain of thought.mimo-v2.5-pro,mimo-v2.5: defaultenabled
enabled,disabled - temperaturenumberWhat sampling temperature to use, between 0 and 1.5. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or
top_pbut not both.In thinking mode, the
mimo-v2.5-pro,mimo-v2.5models do not support customizing thetemperatureparameter. Even if this parameter is passed in, it will be forcibly overridden and take effect with the model's recommended default value of1.0.mimo-v2.5-pro,mimo-v2.5: default1.0
[0, 1.5] - tool_choicestringControls how the model selects a tool.
Note: When a value other than
Available options:autois passed totool_choice, the backend will remove this field by default, and the model response behavior will still be equivalent to theautomode (this logic is subject to future adjustments).auto - toolsarrayA list of tools the model may call. You can provide function tools.
Note: During the multi-turn tool calls process in thinking mode, the model returns a
reasoning_contentfield alongsidetool_calls. To continue the conversation, it is recommended to keep all previousreasoning_contentin themessagesarray for each subsequent request to achieve the best performance.Hide child attributesA function tool that can be used to generate a response.Hide child attributestools.functionobjectRequiredHide child attributestools.function.namestringRequiredThe name of the tool function. Must bea-z,A-Z,0-9, or contain underscores (_) and dashes (-), with a maximum length of 64.
Required string length:1 - 64tools.function.descriptionstringA description of what the function does, used by the model to choose when and how to call the function.tools.function.parametersobjectThe parameters the functions accept, described as a JSON Schema object.
Omittingparametersdefines a function with an empty parameter list.tools.function.strictbooleanDefault: falseWhether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in theparametersfield. Only a subset of JSON Schema is supported whenstrictistrue.tools.typestringRequiredTool type. Currently, onlyfunctionis supported. - top_pnumberDefault: 0.95The probability threshold for nucleus sampling, which controls the diversity of the text that the model generates. A higher
top_pvalue results in more diverse text. A lowertop_pvalue results in more deterministic text.
Because bothtemperatureandtop_pcontrol the diversity of the generated text, we recommend that you set only one of them.In thinking mode, the
Required range:mimo-v2.5-pro,mimo-v2.5models do not support customizing thetop_pparameter. Even if this parameter is passed in, it will be forcibly overridden and take effect with the model's recommended default value of0.95.[0.01, 1.0]
Chat response object (non-streaming output)
- choicesarrayA list of chat completion choices.Hide child attributeschoices.finish_reasonstringThe reason the model stopped generating tokens. This will be
stopif the model hit a natural stop point or a provided stop sequence,lengthif the maximum number of tokens specified in the request was reached,tool_callsif the model called a tool,content_filterif content was omitted due to a flag from our content filters,repetition_truncationif the model detects repetition.choices.indexintegerThe index of the choice in the list of choices.choices.messageobjectA chat completion message generated by the model.Hide child attributeschoices.message.contentstringThe contents of the message.choices.message.reasoning_contentstringThe reasoning contents of the assistant message, before the final answer.choices.message.rolestringThe role of the author of this message.choices.message.tool_callsarrayAfter a function call is initiated, the model returns the tool to be called and the parameters that are Required for the call. This parameter can contain one or more tool response objects.Hide child attributesA call to a function tool created by the model.Hide child attributeschoices.message.tool_calls.functionobjectThe function that the model called.Hide child attributeschoices.message.tool_calls.function.argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.choices.message.tool_calls.function.namestringThe name of the function to call.choices.message.tool_calls.idstringThe ID of the tool call.choices.message.tool_calls.typestringThe type of the tool. Currently, onlyfunctionis supported.choices.message.annotationsarrayAfter web search, the model returns annotations for all referenced URLs.Hide child attributesA call to a web search tool created by the model.Hide child attributeschoices.message.annotations.logo_urlstringLogo url.choices.message.annotations.publish_timestringPublish time.choices.message.annotations.site_namestringSite name.choices.message.annotations.summarystringSummary.choices.message.annotations.titlestringTitle.choices.message.annotations.typestringType.choices.message.annotations.urlstringUrl.choices.message.error_messagestringError message of web search. - createdintegerThe Unix timestamp (in seconds) of when the chat completion was created.
- idstringA unique identifier for the chat completion.
- modelstringThe model to generate the completion.
- objectstringThe object type, which is always
chat.completion. - usageobject | nullUsage statistics for the completion request.Hide child attributesusage.completion_tokensintegerNumber of tokens in the generated completion.usage.prompt_tokensintegerNumber of tokens in the prompt.usage.total_tokensintegerTotal number of tokens used in the request (prompt + completion).usage.completion_tokens_detailsobjectBreakdown of tokens used in a completion.Hide child attributesusage.completion_tokens_details.reasoning_tokensintegerTokens generated by the model for reasoning.usage.prompt_tokens_detailsobjectBreakdown of tokens used in the prompt.Hide child attributesusage.prompt_tokens_details.cached_tokensintegerNumber of tokens served from cache.usage.prompt_tokens_details.audio_tokensintegerAudio input tokens present in the prompt.usage.prompt_tokens_details.image_tokensintegerImage input tokens present in the prompt.usage.prompt_tokens_details.video_tokensintegerVideo input tokens present in the prompt.usage.web_search_usageobjectDetailed usage of the web search API.Hide child attributesusage.web_search_usage.tool_usageintegerNumber of API calls in web search.usage.web_search_usage.page_usageintegerNumber of web pages returned by the web search API.
Chat response chunk object (streaming output)
- choicesarrayA list of chat completion choices.Hide child attributeschoices.deltaobjectA chat completion delta generated by streamed model responses.Hide child attributeschoices.delta.contentstringThe contents of the chunk message.choices.delta.reasoning_contentstringThe reasoning contents of the assistant message, before the final answer.choices.delta.rolestringThe role of the author of this message.choices.delta.tool_callsarrayThe tools to be called by the model and the parameters Required for the calls. It can contain one or more tool response objects.Hide child attributeschoices.delta.tool_calls.indexintegerThe index of the called tool in the
tool_callslist, starting from 0.choices.delta.tool_calls.functionobjectThe function to be called.Hide child attributeschoices.delta.tool_calls.function.argumentsstringThe arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.choices.delta.tool_calls.function.namestringThe name of the function to call.choices.delta.tool_calls.idstringThe ID of the tool call.choices.delta.tool_calls.typestringThe type of the tool. Currently, onlyfunctionis supported.choices.delta.annotationsarrayAfter web search, the model returns annotations for all referenced URLs.Hide child attributesA call to a web search tool created by the model.Hide child attributeschoices.delta.annotations.logo_urlstringLogo url.choices.delta.annotations.publish_timestringPublish time.choices.delta.annotations.site_namestringSite name.choices.delta.annotations.summarystringSummary.choices.delta.annotations.titlestringTitle.choices.delta.annotations.typestringType.choices.delta.annotations.urlstringUrl.choices.delta.error_messagestringError message of web search.choices.finish_reasonstring | nullThe reason the model stopped generating tokens. This will bestopif the model hit a natural stop point or a provided stop sequence,lengthif the maximum number of tokens specified in the request was reached,tool_callsif the model called a tool,content_filterif content was omitted due to a flag from our content filters,repetition_truncationif the model detects repetition.choices.indexintegerThe index of the choice in the list of choices. - createdintegerThe Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
- idstringA unique identifier for the chat completion. Each chunk has the same ID.
- modelstringThe model to generate the completion.
- objectstringThe object type, which is always
chat.completion.chunk. - usageobject | nullUsage statistics for the completion request.Hide child attributesusage.completion_tokensintegerNumber of tokens in the generated completion.usage.prompt_tokensintegerNumber of tokens in the prompt.usage.total_tokensintegerTotal number of tokens used in the request (prompt + completion).usage.completion_tokens_detailsobjectBreakdown of tokens used in a completion.Hide child attributesusage.completion_tokens_details.reasoning_tokensintegerTokens generated by the model for reasoning.usage.prompt_tokens_detailsobjectBreakdown of tokens used in the prompt.Hide child attributesusage.prompt_tokens_details.cached_tokensintegerNumber of tokens served from cache.usage.prompt_tokens_details.audio_tokensintegerAudio input tokens present in the prompt.usage.prompt_tokens_details.image_tokensintegerImage input tokens present in the prompt.usage.prompt_tokens_details.video_tokensintegerVideo input tokens present in the prompt.usage.web_search_usageobjectDetailed usage of the web search API.Hide child attributesusage.web_search_usage.tool_usageintegerNumber of API calls in web search.usage.web_search_usage.page_usageintegerNumber of web pages returned by the web search API.
curl --location --request POST 'https://api.xiaomimimo.com/v1/chat/completions' \
--header "api-key: $MIMO_API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"model": "mimo-v2.5-pro",
"messages": [
{
"role": "system",
"content": "You are MiMo, an AI assistant developed by Xiaomi. Today is date: Tuesday, December 16, 2025. Your knowledge cutoff date is December 2024."
},
{
"role": "user",
"content": "please introduce yourself"
}
],
"max_completion_tokens": 1024,
"temperature": 1.0,
"top_p": 0.95,
"stream": false,
"stop": null,
"frequency_penalty": 0,
"presence_penalty": 0,
"thinking": {
"type": "disabled"
}
}'response
{
"id": "8b51f9e0515949cb8207fbd35ea6ea5c",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Hello! I'm MiMo, Xiaomi's AI assistant created by the Xiaomi LLM-Core team. I'm here to chat, help answer questions, and assist with various tasks—whether it's providing information, brainstorming ideas, or just having a friendly conversation. Feel free to ask me anything, and I'll do my best to help! 😊",
"role": "assistant",
"tool_calls": null
}
}
],
"created": 1776848906,
"model": "mimo-v2.5-pro",
"object": "chat.completion",
"usage": {
"completion_tokens": 72,
"prompt_tokens": 57,
"total_tokens": 129,
"completion_tokens_details": {
"reasoning_tokens": 0
},
"prompt_tokens_details": null
}
}Update Time July 17, 2026