GET

/v1/schemas/xiaomi/chat/v1%2Fchat%2Fcompletions?kind=output

kind outputactivity chathash bda4801a…extracted Oct 9, 2026version currentsource upstream spec ↗

Response body

0 properties · 0 required · 0 $defs

This schema isn’t a plain object with properties — showing the raw JSON instead.

application/json
{
  "provider": "xiaomi",
  "activity": "chat",
  "endpointId": "v1/chat/completions",
  "kind": "output",
  "contentHash": "bda4801aec21cba76c4c20cbb827a598334b97854c58778560a8a5d1e9176fde",
  "specRevision": null,
  "provenance": {
    "sourceUrl": "https://mimo.mi.com/static/docs/api/chat/openai-api.md",
    "sourceHash": "1be241b9a882b3c70954e8ec04031cb657b06c8e0b0bbb8511e5b6ec63b82ae7",
    "fetchedAt": 1791522949,
    "extractorVersion": "1",
    "derivation": "generated",
    "verifiedAt": null
  },
  "createdAt": 1791522949,
  "supersededAt": null,
  "schema": {
    "anyOf": [
      {
        "type": "object",
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finish_reason": {
                  "type": "string",
                  "description": "The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, tool_calls if the model called a tool, content_filter if content was omitted due to a flag from our content filters, repetition_truncation if the model detects repetition."
                },
                "index": {
                  "type": "integer",
                  "description": "The index of the choice in the list of choices."
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string",
                      "description": "The contents of the message."
                    },
                    "reasoning_content": {
                      "type": "string",
                      "description": "The reasoning contents of the assistant message, before the final answer."
                    },
                    "role": {
                      "type": "string",
                      "description": "The role of the author of this message."
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "function": {
                            "type": "object",
                            "properties": {
                              "arguments": {
                                "type": "string",
                                "description": "The 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."
                              },
                              "name": {
                                "type": "string",
                                "description": "The name of the function to call."
                              }
                            },
                            "description": "The function that the model called."
                          },
                          "id": {
                            "type": "string",
                            "description": "The ID of the tool call."
                          },
                          "type": {
                            "type": "string",
                            "description": "The type of the tool. Currently, only function is supported."
                          }
                        },
                        "description": "A call to a function tool created by the model."
                      },
                      "description": "After 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."
                    },
                    "annotations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "logo_url": {
                            "type": "string",
                            "description": "Logo url."
                          },
                          "publish_time": {
                            "type": "string",
                            "description": "Publish time."
                          },
                          "site_name": {
                            "type": "string",
                            "description": "Site name."
                          },
                          "summary": {
                            "type": "string",
                            "description": "Summary."
                          },
                          "title": {
                            "type": "string",
                            "description": "Title."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type."
                          },
                          "url": {
                            "type": "string",
                            "description": "Url."
                          }
                        },
                        "description": "A call to a web search tool created by the model."
                      },
                      "description": "After web search, the model returns annotations for all referenced URLs."
                    },
                    "error_message": {
                      "type": "string",
                      "description": "Error message of web search."
                    }
                  },
                  "description": "A chat completion message generated by the model."
                }
              }
            },
            "description": "A list of chat completion choices."
          },
          "created": {
            "type": "integer",
            "description": "The Unix timestamp (in seconds) of when the chat completion was created."
          },
          "id": {
            "type": "string",
            "description": "A unique identifier for the chat completion."
          },
          "model": {
            "type": "string",
            "description": "The model to generate the completion."
          },
          "object": {
            "type": "string",
            "description": "The object type, which is always chat.completion ."
          },
          "usage": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "completion_tokens": {
                "type": "integer",
                "description": "Number of tokens in the generated completion."
              },
              "prompt_tokens": {
                "type": "integer",
                "description": "Number of tokens in the prompt."
              },
              "total_tokens": {
                "type": "integer",
                "description": "Total number of tokens used in the request (prompt + completion)."
              },
              "completion_tokens_details": {
                "type": "object",
                "properties": {
                  "reasoning_tokens": {
                    "type": "integer",
                    "description": "Tokens generated by the model for reasoning."
                  }
                },
                "description": "Breakdown of tokens used in a completion."
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "integer",
                    "description": "Number of tokens served from cache."
                  },
                  "audio_tokens": {
                    "type": "integer",
                    "description": "Audio input tokens present in the prompt."
                  },
                  "image_tokens": {
                    "type": "integer",
                    "description": "Image input tokens present in the prompt."
                  },
                  "video_tokens": {
                    "type": "integer",
                    "description": "Video input tokens present in the prompt."
                  }
                },
                "description": "Breakdown of tokens used in the prompt."
              },
              "web_search_usage": {
                "type": "object",
                "properties": {
                  "tool_usage": {
                    "type": "integer",
                    "description": "Number of API calls in web search."
                  },
                  "page_usage": {
                    "type": "integer",
                    "description": "Number of web pages returned by the web search API."
                  }
                },
                "description": "Detailed usage of the web search API."
              }
            },
            "description": "Usage statistics for the completion request."
          }
        }
      },
      {
        "type": "object",
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finish_reason": {
                  "type": "string",
                  "description": "The reason the model stopped generating tokens: stop : The model reached a natural stop point or a user‑provided stop sequence length : Terminated due to exceeding the model's maximum generation length content_filter : Content was omitted due to a content filter flag"
                },
                "index": {
                  "type": "integer",
                  "description": "The index of the choice in the list of choices."
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string",
                      "description": "The contents of the message."
                    },
                    "role": {
                      "type": "string",
                      "description": "The role of the author of this message."
                    }
                  },
                  "description": "A chat completion message generated by the model."
                }
              }
            },
            "description": "A list of chat completion choices."
          },
          "created": {
            "type": "integer",
            "description": "The Unix timestamp (in seconds) of when the chat completion was created."
          },
          "id": {
            "type": "string",
            "description": "A unique identifier for the chat completion."
          },
          "model": {
            "type": "string",
            "description": "The model to generate the completion."
          },
          "object": {
            "type": "string",
            "description": "The object type, which is always chat.completion ."
          },
          "usage": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "completion_tokens": {
                "type": "integer",
                "description": "Number of tokens in the generated completion."
              },
              "prompt_tokens": {
                "type": "integer",
                "description": "Number of tokens in the prompt."
              },
              "total_tokens": {
                "type": "integer",
                "description": "Total number of tokens used in the request (prompt + completion)."
              },
              "completion_tokens_details": {
                "type": "object",
                "properties": {
                  "reasoning_tokens": {
                    "type": "integer",
                    "description": "Tokens generated by the model for reasoning. Always 0 ."
                  }
                },
                "description": "Breakdown of tokens used in a completion."
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "integer",
                    "description": "Number of tokens served from cache."
                  },
                  "audio_tokens": {
                    "type": "integer",
                    "description": "Audio input tokens present in the prompt."
                  }
                },
                "description": "Breakdown of tokens used in the prompt."
              },
              "seconds": {
                "type": "integer",
                "description": "Audio duration (seconds)."
              }
            },
            "description": "Usage statistics for the completion request."
          }
        }
      },
      {
        "type": "object",
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finish_reason": {
                  "type": "string",
                  "description": "The reason the model stopped generating tokens: stop : The model reached a natural stop point or a user‑provided stop sequence length : Terminated due to exceeding the model's maximum generation length content_filter : Content was omitted due to a content filter flag"
                },
                "index": {
                  "type": "integer",
                  "description": "The index of the choice in the list of choices."
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "content": {
                      "type": "string",
                      "description": "The contents of the message."
                    },
                    "role": {
                      "type": "string",
                      "description": "The role of the author of this message."
                    },
                    "audio": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Unique identifier for this audio response."
                        },
                        "data": {
                          "type": "string",
                          "description": "Base64 encoded audio bytes generated by the model, in the format specified in the request."
                        },
                        "expires_at": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "The Unix timestamp (in seconds) for when this audio response expires. Currently always null ."
                        },
                        "transcript": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Transcript of the audio generated by the model. Currently always null ."
                        }
                      },
                      "description": "If the audio output is requested, this object contains data about the audio response from the model."
                    },
                    "final_text_preview": {
                      "type": "string",
                      "description": "The final audio broadcast text after intelligent optimization and polishing. This field is only returned when the request parameter optimize_text_preview is set to true ."
                    }
                  },
                  "description": "A chat completion message generated by the model."
                }
              }
            },
            "description": "A list of chat completion choices."
          },
          "created": {
            "type": "integer",
            "description": "The Unix timestamp (in seconds) of when the chat completion was created."
          },
          "id": {
            "type": "string",
            "description": "A unique identifier for the chat completion."
          },
          "model": {
            "type": "string",
            "description": "The model to generate the completion."
          },
          "object": {
            "type": "string",
            "description": "The object type, which is always chat.completion ."
          },
          "usage": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "completion_tokens": {
                "type": "integer",
                "description": "Number of tokens in the generated completion."
              },
              "prompt_tokens": {
                "type": "integer",
                "description": "Number of tokens in the prompt."
              },
              "total_tokens": {
                "type": "integer",
                "description": "Total number of tokens used in the request (prompt + completion)."
              },
              "completion_tokens_details": {
                "type": "object",
                "properties": {
                  "reasoning_tokens": {
                    "type": "integer",
                    "description": "Tokens generated by the model for reasoning. Always 0 ."
                  }
                },
                "description": "Breakdown of tokens used in a completion."
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "integer",
                    "description": "Number of tokens served from cache."
                  }
                },
                "description": "Breakdown of tokens used in the prompt."
              }
            },
            "description": "Usage statistics for the completion request."
          }
        }
      }
    ]
  }
}

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"xiaomi","endpointId":"v1/chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}