{
  "openapi": "3.0.0",
  "info": {
    "title": "MiMo",
    "version": "1.0.0",
    "description": "API reference for MiMo on Ace Data Cloud."
  },
  "servers": [
    {
      "url": "https://api.acedata.cloud",
      "description": "Ace Data Cloud API"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token from https://platform.acedata.cloud"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/mimo/chat/completions": {
      "post": {
        "summary": "MiMo Chat Completion API",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Chat completion or server-sent events. Stream usage is included when requested.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string"
                    },
                    "created": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "model": {
                      "type": "string"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "message": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string",
                                "enum": [
                                  "assistant"
                                ]
                              },
                              "content": {
                                "type": "string",
                                "nullable": true
                              },
                              "reasoning_content": {
                                "type": "string"
                              },
                              "tool_calls": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "function"
                                      ]
                                    },
                                    "function": {
                                      "type": "object",
                                      "properties": {
                                        "name": {
                                          "type": "string"
                                        },
                                        "arguments": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "name",
                                        "arguments"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "type",
                                    "function"
                                  ]
                                }
                              }
                            }
                          },
                          "finish_reason": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "completion_tokens": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "total_tokens": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "prompt_tokens_details": {
                          "type": "object",
                          "properties": {
                            "cached_tokens": {
                              "type": "integer",
                              "minimum": 0
                            }
                          }
                        },
                        "completion_tokens_details": {
                          "type": "object",
                          "properties": {
                            "reasoning_tokens": {
                              "type": "integer",
                              "minimum": 0
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access denied or request rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "No healthy model capacity is currently available.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      }
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "mimo-v2.6-pro",
                      "mimo-v2.6-flash"
                    ],
                    "default": "mimo-v2.6-pro"
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "role"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {
                          "type": "string",
                          "nullable": true
                        },
                        "tool_calls": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "function"
                                ]
                              },
                              "function": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "arguments": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "name",
                                  "arguments"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "type",
                              "function"
                            ]
                          }
                        },
                        "tool_call_id": {
                          "type": "string"
                        },
                        "reasoning_content": {
                          "type": "string",
                          "description": "Preserve assistant reasoning when continuing tool calls."
                        }
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  },
                  "stream_options": {
                    "type": "object",
                    "properties": {
                      "include_usage": {
                        "type": "boolean"
                      }
                    }
                  },
                  "thinking": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "enabled",
                          "disabled"
                        ]
                      }
                    }
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "function"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "function"
                          ]
                        },
                        "function": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "parameters": {
                              "type": "object",
                              "additionalProperties": true
                            }
                          },
                          "required": [
                            "name"
                          ]
                        }
                      }
                    }
                  },
                  "tool_choice": {
                    "type": "string",
                    "enum": [
                      "auto"
                    ],
                    "description": "Other values are not supported by this MiMo contract."
                  },
                  "max_completion_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 131072,
                    "description": "Maximum total reasoning and final-output tokens."
                  }
                }
              },
              "example": {
                "model": "mimo-v2.6-pro",
                "messages": [
                  {
                    "role": "user",
                    "content": "Explain how a rainbow forms."
                  }
                ],
                "max_completion_tokens": 256
              }
            }
          }
        },
        "operationId": "mimo_chat_completions",
        "description": "MiMo 2.6 integration contract. Availability follows the service status in the console."
      }
    }
  }
}
