{
  "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": {
    "/2546-5": {
      "x-pointCode": 5,
      "x-mode": "mapping",
      "x-read-timeout": 20,
      "x-connect-timeout": 20,
      "post": {
        "summary": "语种识别",
        "description": "可自动识别文本内容的语言种类，轻量高效，无需额外实现判断方式，使面向客户的服务体验更佳。原接口订购地址;https://cloud.tencent.com/product/tmt",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "Response": {
                              "type": "object",
                              "properties": {
                                "RequestId": {
                                  "type": "string",
                                  "description": "唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。"
                                },
                                "Lang": {
                                  "type": "string",
                                  "description": "识别出的语言种类，参考语言列表\nzh : 中文\nen : 英文\njp : 日语\nkr : 韩语\nde : 德语\nfr : 法语\nes : 西班牙文\nit : 意大利文\ntr : 土耳其文\nru : 俄文\npt : 葡萄牙文\nvi : 越南文\nid : 印度尼西亚文\nms : 马来西亚文\nth : 泰文"
                                }
                              }
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回说明"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "o为成功，其余为失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2546_5_POST",
        "parameters": [
          {
            "name": "Text",
            "in": "query",
            "description": "待识别的文本，文本统一使用utf-8格式编码，非utf-8格式编码字符会翻译失败。单次请求的文本长度需要低于2000。",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    },
    "/2546-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 20,
      "x-connect-timeout": 20,
      "post": {
        "summary": "图片翻译",
        "description": "提供中文到英文、英文到中文两种语言的图片翻译服务，可自动识别图片中的文本内容并翻译成目标语言，识别后的文本按行翻译，后续会提供可按段落翻译的版本。原接口订购地址;https://cloud.tencent.com/product/tmt",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "Response": {
                              "type": "object",
                              "properties": {
                                "ImageRecord": {
                                  "type": "object",
                                  "properties": {
                                    "Value": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "0": {
                                            "type": "object",
                                            "properties": {
                                              "H": {
                                                "type": "number",
                                                "description": "高度"
                                              },
                                              "SourceText": {
                                                "type": "string",
                                                "description": "识别出的源文"
                                              },
                                              "TargetText": {
                                                "type": "string",
                                                "description": "翻译后的译文"
                                              },
                                              "W": {
                                                "type": "number",
                                                "description": "宽度"
                                              },
                                              "X": {
                                                "type": "number",
                                                "description": "X坐标"
                                              },
                                              "Y": {
                                                "type": "number",
                                                "description": "Y坐标"
                                              }
                                            }
                                          }
                                        }
                                      }
                                    }
                                  },
                                  "description": "图片翻译结果，翻译结果按识别的文本每一行独立翻译，后续会推出按段落划分并翻译的版本"
                                },
                                "RequestId": {
                                  "type": "string",
                                  "description": "唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。"
                                },
                                "SessionUuid": {
                                  "type": "string",
                                  "description": "请求的SessionUuid返回"
                                },
                                "Source": {
                                  "type": "string",
                                  "description": "源语言"
                                },
                                "Target": {
                                  "type": "string",
                                  "description": "目标语言"
                                }
                              }
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回说明"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其余为失败！"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2546_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "SessionUuid": {
                    "type": "string",
                    "description": "唯一id，返回时原样返回"
                  },
                  "Data": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10000000,
                    "description": "图片数据的Base64字符串，图片大小上限为4M，建议对源图片进行一定程度压缩"
                  },
                  "Source": {
                    "type": "string",
                    "description": "源语言，支持语言列表：\nauto：自动识别（识别为一种语言）\nzh：简体中文\nzh-TW：繁体中文\nen：英语\nja：日语\nko：韩语\nru：俄语\nfr：法语\nde：德语\nit：意大利语\nes：西班牙语\npt：葡萄牙语\nms：马来西亚语\nth：泰语\nvi：越南语"
                  },
                  "Target": {
                    "type": "string",
                    "description": "目标语言，各源语言的目标语言支持列表如下：\nzh（简体中文）：en（英语）、ja（日语）、ko（韩语）、ru（俄语）、fr（法语）、de（德语）、it（意大利语）、es（西班牙语）、pt（葡萄牙语）、ms（马来语）、th（泰语）、vi（越南语）\nzh-TW（繁体中文）：en（英语）、ja（日语）、ko（韩语）、ru（俄语）、fr（法语）、de（德语）、it（意大利语）、es（西班牙语）、pt（葡萄牙语）、ms（马来语）、th（泰语）、vi（越南语）\nen（英语）：zh（中文）、ja（日语）、ko（韩语）、ru（俄语）、fr（法语）、de（德语）、it（意大利语）、es（西班牙语）、pt（葡萄牙语）、ms（马来语）、th（泰语）、vi（越南语）\nja（日语）：zh（中文）、en（英语）、ko（韩语）\nko（韩语）：zh（中文）、en（英语）、ja（日语）\nru：俄语：zh（中文）、en（英语）\nfr：法语：zh（中文）、en（英语）\nde：德语：zh（中文）、en（英语）\nit：意大利语：zh（中文）、en（英语）\nes：西班牙语：zh（中文）、en（英语）\npt：葡萄牙语：zh（中文）、en（英语）\nms：马来西亚语：zh（中文）、en（英语）\nth：泰语：zh（中文）、en（英语）\nvi：越南语：zh（中文）、en（英语）"
                  },
                  "ProjectId": {
                    "type": "number",
                    "description": "项目ID，可以根据控制台-账号中心-项目管理中的配置填写，如无配置请填写默认项目ID:0"
                  }
                },
                "required": [
                  "ds_id",
                  "SessionUuid",
                  "Data",
                  "Source",
                  "Target",
                  "ProjectId"
                ]
              }
            }
          }
        }
      }
    },
    "/2546-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 20,
      "x-connect-timeout": 20,
      "post": {
        "summary": "语种识别",
        "description": "可自动识别文本内容的语言种类，轻量高效，无需额外实现判断方式，使面向客户的服务体验更佳。 原接口订购地址;https://cloud.tencent.com/product/tmt",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "Response": {
                              "type": "object",
                              "properties": {
                                "Lang": {
                                  "type": "string",
                                  "description": "识别出的语言种类，参考语言列表\nzh : 中文\nen : 英文\njp : 日语\nkr : 韩语\nde : 德语\nfr : 法语\nes : 西班牙文\nit : 意大利文\ntr : 土耳其文\nru : 俄文\npt : 葡萄牙文\nvi : 越南文\nid : 印度尼西亚文\nms : 马来西亚文\nth : 泰文"
                                },
                                "RequestId": {
                                  "type": "string",
                                  "description": "唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。"
                                }
                              }
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回说明"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其余为失败！"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2546_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "Text": {
                    "type": "string",
                    "description": "待识别的文本，文本统一使用utf-8格式编码，非utf-8格式编码字符会翻译失败。单次请求的文本长度需要低于2000。"
                  }
                },
                "required": [
                  "ds_id",
                  "Text"
                ]
              }
            }
          }
        }
      }
    },
    "/2546-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 20,
      "x-connect-timeout": 20,
      "post": {
        "summary": "语音翻译",
        "description": "本接口提供音频内文字识别 + 翻译功能，目前开放中到英的语音翻译服务。 待识别和翻译的音频文件可以是 pcm、mp3、amr和speex 格式，音频内语音清晰，采用流式传输和翻译的方式。原接口订购地址;https://cloud.tencent.com/product/tmt",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "Response": {
                              "type": "object",
                              "properties": {
                                "RecognizeStatus": {
                                  "type": "number",
                                  "description": "语音识别状态 1-进行中 0-完成"
                                },
                                "RequestId": {
                                  "type": "string",
                                  "description": "唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。"
                                },
                                "Seq": {
                                  "type": "number",
                                  "description": "第几个语音分片"
                                },
                                "SessionUuid": {
                                  "type": "string",
                                  "description": "请求的SessionUuid直接返回"
                                },
                                "Source": {
                                  "type": "string",
                                  "description": "源语言"
                                },
                                "SourceText": {
                                  "type": "string",
                                  "description": "识别出的源文"
                                },
                                "Target": {
                                  "type": "string",
                                  "description": "目标语言"
                                },
                                "TargetText": {
                                  "type": "string",
                                  "description": "翻译出的译文"
                                },
                                "VadSeq": {
                                  "type": "number",
                                  "description": "当请求的Mode参数填写bvad是，启动VadSeq。此时Seq会被设置为后台vad（静音检测）后的新序号，而VadSeq代表客户端原始Seq值"
                                }
                              }
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回说明"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "返回标识：0为成功，其余为失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2546_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  },
                  "SessionUuid": {
                    "type": "string",
                    "description": "一段完整的语音对应一个SessionUuid"
                  },
                  "Source": {
                    "type": "string",
                    "description": "\t音频中的语言类型，支持语言列表\nzh : 中文\nen : 英文"
                  },
                  "Target": {
                    "type": "string",
                    "description": "翻译目标语⾔言类型 ，支持的语言列表\nzh : 中文\nen : 英文"
                  },
                  "AudioFormat": {
                    "type": "number",
                    "description": "pcm : 146 amr : 33554432 mp3 : 83886080"
                  },
                  "Seq": {
                    "type": "number",
                    "description": "语音分片的序号，从0开始"
                  },
                  "IsEnd": {
                    "type": "number",
                    "description": "是否最后一片语音分片，0-否，1-是"
                  },
                  "Data": {
                    "type": "string",
                    "description": "语音分片内容的base64字符串，音频内容应含有效并可识别的文本"
                  }
                },
                "required": [
                  "ds_id",
                  "SessionUuid",
                  "Source",
                  "Target",
                  "AudioFormat",
                  "Seq",
                  "IsEnd",
                  "Data"
                ]
              }
            }
          }
        }
      }
    },
    "/2546-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 20,
      "x-connect-timeout": 20,
      "post": {
        "summary": "文本翻译",
        "description": "提供中文到英文、英文到中文的等多种语言的文本内容翻译服务， 经过大数据语料库、多种解码算法、翻译引擎深度优化，在新闻文章、生活口语等不同语言场景中都有深厚积累，翻译结果专业评价处于行业领先水平。原接口订购地址;https://cloud.tencent.com/product/tmt",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "Response": {
                              "type": "object",
                              "properties": {
                                "RequestId": {
                                  "type": "string",
                                  "description": "唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。"
                                },
                                "Source": {
                                  "type": "string",
                                  "description": "源语言"
                                },
                                "Target": {
                                  "type": "string",
                                  "description": "目标语言"
                                },
                                "TargetText": {
                                  "type": "string",
                                  "description": "图片翻译结果，翻译结果按识别的文本每一行独立翻译，后续会推出按段落划分并翻译的版本"
                                }
                              }
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回说明"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "o为成功，其余为失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "2546_1_POST",
        "parameters": [
          {
            "name": "SourceText",
            "in": "query",
            "description": "待翻译的文本，文本统一使用utf-8格式编码，非utf-8格式编码字符会翻译失败，请传入有效文本，html标记等非常规翻译文本会翻译失败。单次请求的文本长度需要低于2000。",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ProjectId",
            "in": "query",
            "description": "项目ID，可以根据腾讯控制台-账号中心-项目管理中的配置填写，如无配置请填写默认项目ID:0",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "Target",
            "in": "query",
            "description": "目标语言，参照支持语言列表\nzh : 简体中文\nzh-TW : 繁体中文\nen : 英文\njp : 日语\nkr : 韩语\nde : 德语\nfr : 法语\nes : 西班牙文\nit : 意大利文\ntr : 土耳其文\nru : 俄文\npt : 葡萄牙文\nvi : 越南文\nid : 印度尼西亚文\nms : 马来西亚文\nth : 泰文\nauto : 自动识别源语言，只能用于source字段",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Source",
            "in": "query",
            "description": "源语言，参照Target支持语言列表",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "ds_id": {
                    "type": "string",
                    "description": "数据源"
                  }
                },
                "required": [
                  "ds_id"
                ]
              }
            }
          }
        }
      }
    }
  },
  "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/2546?tab=book"
  },
  "x-apiCode": "2546",
  "x-is-own": false,
  "x-is-op": true
}