{
  "openapi": "3.0.3",
  "info": {
    "title": "MinMax开放平台连接器",
    "description": "MiniMax开放平台为企业客户和专业开发者提供服务，包括两种基于大型语言模型的API：文本到文本（T2T）和文本到语音（T2A）。T2T适用于互动娱乐和基于自然语言的生产力提升，如文本创作和改写。T2A适用于语音播报和语音交互。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/3102-6": {
      "x-pointCode": 6,
      "x-mode": "pass_through",
      "x-read-timeout": 25,
      "x-connect-timeout": 5,
      "post": {
        "summary": "Embeddings_向量",
        "description": "embeddings接口支持用户输入文本数据，使用MiniMax自研的Embedding model得到文本对应的浮点向量。通过embeding技术能够将文本转化为高维向量表示，捕捉词语和句子之间的语义关系，从而实现语义相似度计算、文本分类和信息检索等任务。相对于将文本输入直接给模型回答，可以在此之前通过embedding技术在指定的知识库中检索到有关联的上下文，放到模型的输入中，让模型基于上下文做出更流畅、合理的回答。基于此可以实现如长记忆检索、知识库检索等能力。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "operationId": "3102_6_POST",
        "parameters": [
          {
            "name": "GroupId",
            "in": "query",
            "description": "使用发放的值,该值应拼接在调用API的url末尾。可在查看MinMax用户中心查看https://api.minimax.chat/user-center/basic-information",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ds_id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "texts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "model": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/3102-5": {
      "x-pointCode": 5,
      "x-mode": "pass_through",
      "x-read-timeout": 50,
      "x-connect-timeout": 10,
      "post": {
        "summary": "T2A_pro_长文本语音生成",
        "description": "接口支持基于自然语言交互生成回复的能力。接口本身为无状态接口，即单次调用时，模型所接收到的信息量仅为接口传入内容，不涉及业务逻辑，同时模型也不存储您传入的数据。\n\n支持单次合成最高50000字符输入；\n\n支持语调、语速、音量、比特率、采样率相关参数调整特性；\n\n支持音频时长、音频大小等返回参数；\n\n支持时间戳（字幕）返回，精确到句；\n\n支持混音功能，最多四种音色按照比例混合；\n\n支持非法字符检测：非法字符不超过10%（包含10%），音频会正常生成并返回非法字符占比；非法字符超过10%，接口不返回结果（返回报错码），请检测后再次进行请求（非法字符定义：ascii码中的控制符（不含制表符和换行符））；\n\n适用场景：长文本有声化、书籍小说等文字单章节语音合成、录播课程语音合成等",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "audio_file": {
                      "type": "string",
                      "description": "合成的音频下载链接 格式为mp3"
                    },
                    "subtitle_file": {
                      "type": "string",
                      "description": "合成的字幕下载链接  音频文件对应的字幕，精确到句（不超过50字），单位为毫秒，格式为json"
                    },
                    "trace_id": {
                      "type": "string",
                      "description": "用于在咨询/反馈时帮助定位问题"
                    },
                    "extra_info": {
                      "type": "object",
                      "properties": {
                        "audio_length": {
                          "type": "number",
                          "description": "音频时长，精确到毫秒"
                        },
                        "audio_sample_rate": {
                          "type": "number",
                          "description": "默认为24000，如客户请求参数进行调整，会根据请求参数生成"
                        },
                        "audio_size": {
                          "type": "number",
                          "description": "单位为字节"
                        },
                        "bitrate": {
                          "type": "number",
                          "description": "默认为168000，如客户请求参数进行调整，会根据请求参数生成"
                        },
                        "word_count": {
                          "type": "number",
                          "description": "已经发音的字数统计（不算标点等其他符号，包含汉字数字字母）"
                        },
                        "invisible_character_ratio": {
                          "type": "number",
                          "description": "非法字符不超过10%（包含10%），音频会正常生成并返回非法字符占比；最大不超过0.1（10%），超过进行报错"
                        }
                      },
                      "description": "相关额外信息"
                    },
                    "base_resp": {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "number",
                          "description": "1000，未知错误1001，超时1002，触发限流1004，鉴权失败1013，服务内部错误及非法字符超过10%2013，输入格式信息不正常"
                        },
                        "status_msg": {
                          "type": "string",
                          "description": "错误详情"
                        }
                      },
                      "description": "如果请求出错，对应的错误状态码和详情"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "3102_5_POST",
        "parameters": [
          {
            "name": "GroupId",
            "in": "query",
            "description": "该值应拼接在调用API的url末尾。用户的groupid，可在查看MinMax用户中心查看https://api.minimax.chat/user-center/basic-information",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ds_id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "voice_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string"
                  },
                  "speed": {
                    "type": "integer"
                  },
                  "vol": {
                    "type": "integer"
                  },
                  "pitch": {
                    "type": "integer"
                  },
                  "audio_sample_rate": {
                    "type": "integer"
                  },
                  "bitrate": {
                    "type": "integer"
                  },
                  "timber_weights": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "voice_id": {
                          "type": "string"
                        },
                        "weight": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/3102-4": {
      "x-pointCode": 4,
      "x-mode": "pass_through",
      "x-read-timeout": 50,
      "x-connect-timeout": 15,
      "post": {
        "summary": "T2A_语音生成",
        "description": "接口支持基于自然语言交互生成回复的能力。接口本身为无状态接口，即单次调用时，模型所接收到的信息量仅为接口传入内容，不涉及业务逻辑，同时模型也不存储您传入的数据。\n\n支持音量、语调、语速调整；\n\n支持混音功能；\n\n适用场景：短句生成、语音聊天、在线社交等",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "base_resp": {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "number",
                          "description": "1000，未知错误\n\n1001，超时\n\n1002，触发限流\n\n1004，鉴权失败\n\n1013，服务内部错误\n\n2013，输入格式信息不正常"
                        },
                        "status_msg": {
                          "type": "string"
                        }
                      },
                      "description": "该接口调用成功时将直接返回【二进制音频信息】，其content-type为：audio/mpeg，以下示例为调用失败时的返回值"
                    },
                    "trace_id": {
                      "type": "string",
                      "description": "用于在咨询/反馈时帮助定位问题"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "3102_4_POST",
        "parameters": [
          {
            "name": "GroupId",
            "in": "query",
            "description": "该值应拼接在调用API的url末尾。用户的groupid，可在查看MinMax用户中心查看https://api.minimax.chat/user-center/basic-information",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ds_id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "voice_id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string"
                  },
                  "speed": {
                    "type": "integer"
                  },
                  "vol": {
                    "type": "integer"
                  },
                  "pitch": {
                    "type": "integer"
                  },
                  "timber_weights": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "voice_id": {
                          "type": "string"
                        },
                        "weight": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/3102-2": {
      "x-pointCode": 2,
      "x-mode": "pass_through",
      "x-read-timeout": 35,
      "x-connect-timeout": 10,
      "post": {
        "summary": "Chatcompletion_对话",
        "description": "本接口为abab5和abab5.5模型的调用接口（建议使用abab5.5），支持基于自然语言交互生成回复的能力，适用于人设对话以及生产力等典型文本生成文本场景。接口本身为无状态接口，即单次调用时，模型所接收到的信息量仅为接口传入内容，不涉及业务逻辑，同时模型也不存储您传入的数据。如果输入内容或输出内容严重违规，接口会返回内容违规错误信息，回复内容为空。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "number",
                      "description": "请求发起时间 Unixtime, Nanosecond"
                    },
                    "model": {
                      "type": "string",
                      "description": "请求指定的模型"
                    },
                    "reply": {
                      "type": "string",
                      "description": "推荐的最好结果"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string",
                            "description": "文本结果"
                          },
                          "index": {
                            "type": "number",
                            "description": "排名"
                          },
                          "finish_reason": {
                            "type": "string",
                            "description": "结束原因，枚举值\n\nstop：API返回了模型生成的完整结果\n\nlength：模型生成结果超过tokens_to_generate的长度，内容被截断\n\nmax_output：输入+模型输出内容超过模型能力限制"
                          },
                          "choices.delta": {
                            "type": "string",
                            "description": "当request.stream为true，处于流式模式下，回复文本通过delta给出   回复文本分批返回，最后一个回复的delta为空，同时会对整体回复做敏感词检测"
                          }
                        }
                      },
                      "description": "所有结果"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "total_tokens": {
                          "type": "number",
                          "description": "usage.total_tokens"
                        }
                      }
                    },
                    "input_sensitive": {
                      "type": "boolean",
                      "description": "输入命中敏感词"
                    },
                    "output_sensitive": {
                      "type": "boolean",
                      "description": "输出命中敏感词"
                    },
                    "base_resp": {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "number",
                          "description": "状态码  1000，未知错误\n\n1001，超时\n\n1002，触发限流\n\n1004，鉴权失败\n\n1008，余额不足\n\n1013，服务内部错误\n\n1027，输出内容错误\n\n1039，触发限流\n\n2013，输入格式信息不正常"
                        },
                        "status_msg": {
                          "type": "string",
                          "description": "错误详情"
                        }
                      },
                      "description": "错误状态码和详情"
                    },
                    "input_sensitive_type": {
                      "type": "number",
                      "description": "输入命中敏感词类型，当input_sensitive为true时返回  取值为以下其一\n\n1 严重违规\n\n2 色情\n\n3 广告\n\n4 违禁\n\n5 谩骂\n\n6 暴恐\n\n7 其他"
                    },
                    "output_sensitive_type": {
                      "type": "number",
                      "description": "输出命中敏感词类型，当output_sensitive为true时返回，取值同input_sensitive_type"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "3102_2_POST",
        "parameters": [
          {
            "name": "GroupId",
            "in": "query",
            "description": "使用发放的值,该值应拼接在调用API的url末尾。可在查看MinMax用户中心查看https://api.minimax.chat/user-center/basic-information",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ds_id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "role_meta": {
                    "type": "object",
                    "properties": {
                      "user_name": {
                        "type": "string"
                      },
                      "bot_name": {
                        "type": "string"
                      }
                    }
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "sender_type": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "temperature": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/3102-1": {
      "x-pointCode": 1,
      "x-mode": "pass_through",
      "x-read-timeout": 30,
      "x-connect-timeout": 10,
      "post": {
        "summary": "Chatcompletion_pro_对话",
        "description": "本接口为 abab5.5 模型的调用接口，在abab5.5模型下，我们优先推荐您使用本接口，本接口可以提供 chat complation 接口无法满足的相应功能。相比于 chat completion本接口 更新了请求体和返回体的结构，可以更好的适配支持多人多bot对话场景。还额外支持了更好的示例对话，限制返回格式，函数调用，插件这四个功能。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "number",
                      "description": "请求发起时间"
                    },
                    "model": {
                      "type": "string",
                      "description": "请求指定的模型名称"
                    },
                    "reply": {
                      "type": "string",
                      "description": "回复内容"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "finish_reason": {
                            "type": "string",
                            "description": "结束原因，枚举值\n\nstop：接口返回了模型生成完整结果\n\nlength：模型生成结果超过配置的tokens_to_generate长度，内容被截断\n\nmax_output：输入+模型输出内容超过模型最大能力限制"
                          },
                          "messages": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "sender_type": {
                                  "type": "string",
                                  "description": "回复者的类型"
                                },
                                "sender_name": {
                                  "type": "string",
                                  "description": "回复者的名称"
                                },
                                "text": {
                                  "type": "string",
                                  "description": "回复者的文本"
                                }
                              }
                            },
                            "description": "回复结果的具体内容"
                          }
                        }
                      },
                      "description": "所有结果数量 <= 4"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "total_tokens": {
                          "type": "number",
                          "description": "消耗tokens总数，包括输入和输出"
                        }
                      },
                      "description": "tokens数使用情况流式场景下，增量数据包不含该字段；全量（最后一个）数据包含有该字段"
                    },
                    "input_sensitive": {
                      "type": "boolean",
                      "description": "输入命中敏感词"
                    },
                    "output_sensitive": {
                      "type": "boolean",
                      "description": "输出命中敏感词"
                    },
                    "id": {
                      "type": "string",
                      "description": "本次请求的唯一标识，用于排查问题"
                    },
                    "base_resp": {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "number",
                          "description": "1000，未知错误\n\n1001，超时\n\n1002，触发RPM限流\n\n1004，鉴权失败\n\n1008，余额不足\n\n1013，服务内部错误\n\n1027，输出内容错误\n\n1039，触发TPM限流\n\n2013，输入格式信息不正常"
                        },
                        "status_msg": {
                          "type": "string",
                          "description": "错误详情"
                        }
                      },
                      "description": "错误状态码和详情"
                    },
                    "input_sensitive_type": {
                      "type": "number",
                      "description": "输入命中敏感词类型，当input_sensitive为true时返回\n取值为以下其一\n\n1 严重违规\n\n2 色情\n\n3 广告\n\n4 违禁\n\n5 谩骂\n\n6 暴恐\n\n7 其他"
                    },
                    "output_sensitive_type": {
                      "type": "number",
                      "description": "输出命中敏感词类型，当output_sensitive为true时返回\n取值为以下其一\n\n1 严重违规\n\n2 色情\n\n3 广告\n\n4 违禁\n\n5 谩骂\n\n6 暴恐\n\n7 其他"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "3102_1_POST",
        "parameters": [
          {
            "name": "ds_id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "GroupId",
            "in": "query",
            "description": "用户的groupid，可在查看MinMax用户中心查看https://api.minimax.chat/user-center/basic-information",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "bot_setting": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_name": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "sender_type": {
                          "type": "string"
                        },
                        "sender_name": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "reply_constraints": {
                    "type": "object",
                    "properties": {
                      "sender_type": {
                        "type": "string"
                      },
                      "sender_name": {
                        "type": "string"
                      }
                    }
                  },
                  "model": {
                    "type": "string"
                  },
                  "tokens_to_generate": {
                    "type": "integer"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/3102?tab=book"
  },
  "x-apiCode": "3102",
  "x-is-own": true,
  "x-is-op": true
}