{
  "openapi": "3.0.3",
  "info": {
    "title": "百度云-语音技术",
    "description": "采用国际领先的流式端到端语音语言一体化建模算法，将语音快速准确识别为文字，支持手机应用语音交互、语音内容分析、机器人对话等多个场景。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/2567-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 35,
      "x-connect-timeout": 35,
      "post": {
        "summary": "语音识别极速版",
        "description": "将60秒内的语音快速识别为文字，适用于手机语音输入、语音搜索、人机对话等语音交互场景。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "err_no": {
                              "type": "number",
                              "description": "错误码"
                            },
                            "err_msg": {
                              "type": "string",
                              "description": "错误码描述"
                            },
                            "sn": {
                              "type": "string",
                              "description": "语音数据唯一标识，系统内部产生。如果反馈及debug请提供sn"
                            },
                            "result": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "识别结果数组，提供1-5 个候选结果， 优先使用第一个结果。utf-8 编码。"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2567_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "format": {
                    "type": "string",
                    "description": "语音文件的格式，pcm 或者 wav 或者 amr。不区分大小写。推荐pcm文件\n"
                  },
                  "rate": {
                    "type": "number",
                    "description": "采样率，16000，固定值"
                  },
                  "channel": {
                    "type": "number",
                    "description": "声道数，仅支持单声道，请填写固定值 1"
                  },
                  "cuid": {
                    "type": "string",
                    "description": "用户唯一标识，用来区分用户，计算UV值。建议填写能区分用户的机器 MAC 地址或 IMEI 码，长度为60字符以内。"
                  },
                  "dev_pid": {
                    "type": "number",
                    "description": "只能用80001，极速版输入法模型，支持普通话(纯中文识别)"
                  },
                  "lm_id": {
                    "type": "number",
                    "description": "自训练平台模型id"
                  },
                  "speech": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "本地语音文件的的二进制语音数据 ，需要进行base64 编码。与len参数连一起使用。"
                  },
                  "len": {
                    "type": "number",
                    "description": "本地语音文件的的字节数，单位字节"
                  }
                },
                "required": [
                  "ds_id",
                  "format",
                  "rate",
                  "channel",
                  "cuid",
                  "dev_pid",
                  "speech",
                  "len"
                ]
              }
            }
          }
        }
      }
    },
    "/2567-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 50,
      "x-connect-timeout": 50,
      "post": {
        "summary": "短语音识别",
        "description": "百度短语音识别可以将 60 秒以下的音频识别为文字。适用于语音对话、语音控制、语音输入等场景。\n支持中文普通话（能识别简单的常用英语）、英语、粤语、四川话识别。原接口订购地址：https://cloud.baidu.com/product/speech/asr",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "err_no": {
                              "type": "number",
                              "description": "错误码"
                            },
                            "err_msg": {
                              "type": "string",
                              "description": "错误码描述"
                            },
                            "sn": {
                              "type": "string",
                              "description": "语音数据唯一标识，系统内部产生。如果反馈及debug请提供sn"
                            },
                            "result": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "识别结果数组，提供1-5 个候选结果， 优先使用第一个结果。utf-8 编码。"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2567_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "format": {
                    "type": "string",
                    "description": "语音文件的格式，pcm/wav/amr/m4a。不区分大小写。推荐pcm文件"
                  },
                  "rate": {
                    "type": "number",
                    "description": "采样率，16000、8000，固定值"
                  },
                  "channel": {
                    "type": "number",
                    "description": "声道数，仅支持单声道，请填写固定值 1"
                  },
                  "cuid": {
                    "type": "string",
                    "description": "用户唯一标识，用来区分用户，计算UV值。建议填写能区分用户的机器 MAC 地址或 IMEI 码，长度为60字符以内。"
                  },
                  "dev_pid": {
                    "type": "number",
                    "description": "不填写lan参数生效，都不填写，默认1537（普通话 输入法模型）"
                  },
                  "lm_id": {
                    "type": "string",
                    "description": "自训练平台模型id，填dev_pid = 1537生效"
                  },
                  "speech": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "本地语音文件的的二进制语音数据 ，需要进行base64 编码。与len参数连一起使用。"
                  },
                  "len": {
                    "type": "number",
                    "description": "本地语音文件的字节数，单位字节"
                  }
                },
                "required": [
                  "ds_id",
                  "format",
                  "rate",
                  "channel",
                  "cuid",
                  "speech",
                  "len"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/2567?tab=book"
  },
  "x-apiCode": "2567",
  "x-is-own": false,
  "x-is-op": false
}