文本合成
POST /v1/messages
说明
概览
| Method | POST |
|---|---|
| Path | /v1/messages |
| Type | http |
| Status | -2 |
| Module | 2102810 |
| Folder | 78007621 |
请求体
{ "type": "application/json", "parameters": [], "jsonSchema": { "type": "object", "properties": { "model": { "type": "string" }, "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string" }, "name": { "type": "string" }, "content": { "type": "string" } }, "required": [ "role", "name", "content" ], "x-apifox-orders": [ "role", "name", "content" ] } }, "stream": { "type": "boolean" }, "max_completion_tokens": { "type": "integer" }, "temperature": { "type": "number" }, "top_p": { "type": "number" }, "stream_options": { "type": "object", "properties": { "include_usage": { "type": "boolean" } }, "required": [ "include_usage" ], "x-apifox-orders": [ "include_usage" ] } }, "required": [ "model", "messages" ], "x-apifox-orders": [ "model", "messages", "stream", "max_completion_tokens", "temperature", "top_p", "stream_options" ] }, "required": true, "mediaType": "", "examples": [ { "mediaType": "application/json", "value": "{\r\n \"model\": \"MiniMax-M2.1\",\r\n \"messages\": [\r\n {\r\n \"role\": \"system\",\r\n \"name\": \"AI助手\",\r\n \"content\": \"你是一个专业、友好的AI助手。\"\r\n },\r\n {\r\n \"role\": \"user\",\r\n \"name\": \"张三\",\r\n \"content\": \"帮我写一首关于秋天的诗。\"\r\n }\r\n ],\r\n \"stream\": true,\r\n \"max_completion_tokens\": 2048,\r\n \"temperature\": 0.9,\r\n \"top_p\": 0.95,\r\n \"stream_options\": {\r\n \"include_usage\": true\r\n }\r\n}", "name": "示例 1" } ], "oasExtensions": "" }
响应
[ { "id": 165531408, "name": "成功", "code": 200, "contentType": "json", "jsonSchema": { "type": "object", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "finish_reason": { "type": "string" }, "index": { "type": "integer" }, "message": { "type": "object", "properties": { "content": { "type": "string" }, "role": { "type": "string" }, "name": { "type": "string" }, "audio_content": { "type": "string" }, "reasoning_content": { "type": "string" } }, "required": [ "content", "role", "name", "audio_content", "reasoning_content" ], "x-apifox-orders": [ "content", "role", "name", "audio_content", "reasoning_content" ] } }, "x-apifox-orders": [ "finish_reason", "index", "message" ] } }, "created": { "type": "integer" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "type": "object", "properties": { "total_tokens": { "type": "integer" }, "total_characters": { "type": "integer" }, "prompt_tokens": { "type": "integer" }, "completion_tokens": { "type": "integer" }, "completion_tokens_details": { "type": "object", "properties": { "reasoning_tokens": { "type": "integer" } }, "required": [ "reasoning_tokens" ], "x-apifox-orders": [ "reasoning_tokens" ] } }, "required": [ "total_tokens", "total_characters", "prompt_tokens", "completion_tokens", "completion_tokens_details" ], "x-apifox-orders": [ "total_tokens", "total_characters", "prompt_tokens", "completion_tokens", "completion_tokens_details" ] }, "input_sensitive": { "type": "boolean" }, "output_sensitive": { "type": "boolean" }, "input_sensitive_type": { "type": "integer" }, "output_sensitive_type": { "type": "integer" }, "output_sensitive_int": { "type": "integer" }, "base_resp": { "type": "object", "properties": { "status_code": { "type": "integer" }, "status_msg": { "type": "string" } }, "required": [ "status_code", "status_msg" ], "x-apifox-orders": [ "status_code", "status_msg" ] } }, "required": [ "id", "choices", "created", "model", "object", "usage", "input_sensitive", "output_sensitive", "input_sensitive_type", "output_sensitive_type", "output_sensitive_int", "base_resp" ], "x-apifox-orders": [ "id", "choices", "created", "model", "object", "usage", "input_sensitive", "output_sensitive", "input_sensitive_type", "output_sensitive_type", "output_sensitive_int", "base_resp" ] }, "itemSchema": {}, "description": "", "mediaType": "", "headers": [] } ]
响应示例
[ { "name": "成功示例", "responseId": 165531408, "data": "{\r\n \"id\": \"04ecb5d9b1921ae0fb0e8da9017a5474\",\r\n \"choices\": [\r\n {\r\n \"finish_reason\": \"stop\",\r\n \"index\": 0,\r\n \"message\": {\r\n \"content\": \"您好!请问有什么可以帮您?\",\r\n \"role\": \"assistant\",\r\n \"name\": \"MiniMax AI\",\r\n \"audio_content\": \"\",\r\n \"reasoning_content\": \"...省略\"\r\n }\r\n }\r\n ],\r\n \"created\": 1755153113,\r\n \"model\": \"MiniMax-M1\",\r\n \"object\": \"chat.completion\",\r\n \"usage\": {\r\n \"total_tokens\": 249,\r\n \"total_characters\": 0,\r\n \"prompt_tokens\": 26,\r\n \"completion_tokens\": 223,\r\n \"completion_tokens_details\": {\r\n \"reasoning_tokens\": 214\r\n }\r\n },\r\n \"input_sensitive\": false,\r\n \"output_sensitive\": false,\r\n \"input_sensitive_type\": 0,\r\n \"output_sensitive_type\": 0,\r\n \"output_sensitive_int\": 0,\r\n \"base_resp\": {\r\n \"status_code\": 0,\r\n \"status_msg\": \"\"\r\n }\r\n}", "id": "019c27d9-6b13-75ef-b258-e60b32b62298" } ]