# 提交音频转写

> 提交一段音频发起转写任务,返回 transcription_id 用于轮询结果。

POST
  `https://ikho.cn/developer/api/open/partner/ai/transcriptions/`
  [试一试](/docs/embedded/playground/)

  
## 鉴权

  

  
    `X-Client-Id`
    string
    header
    必填
    
  

  你的 `client_id`,由对接工程师开通时提供。

  

  

  
    `X-Client-Api-Key`
    string
    header
    必填
    
  

  你的 `api_key`,与 `client_id` 一同下发,不同于 `secret`。

  

  

  
    `Content-Type`
    string
    header
    必填
    默认 `application/json`
  

  请求内容类型。

  

  
## 请求体

  

  
    `file_url`
    string
    
    必填
    
  

  音频下载地址。内测期仅接受[合并分片](/docs/api-reference/file/complete-upload/)返回的本平台 `DownloadUrl`(支持 mp3、m4a、wav);其它地址会返回 `IKHO_ERR_FILE_URL_NOT_ALLOWED`。

  

  

  
    `params`
    object
    
    
    
  

  可选转写参数。

  子属性
    

  
    `transcribe`
    object
    
    
    
  

  识别相关参数。

  子属性
      

  
    `language`
    string
    
    
    默认 `auto`
  

  BCP-47 语言码,如 `zh-CN`、`en-US`;`auto` 为自动识别。

  

      

  
    `model`
    string
    
    
    默认 `ikho-asr-pro`
  

  转写模型:`ikho-asr-pro`(精度优先)或 `ikho-asr-fast`(时延优先)。

  

      

  
    `detection_level`
    string
    
    
    默认 `segment`
  

  语种识别粒度:`segment`(按片段)或 `chapter`(按章节)。

  

    

  
    `vad`
    object
    
    
    
  

  静音检测参数。

  子属性
      

  
    `decode_silence`
    boolean
    
    
    默认 `false`
  

  是否对静音区间也进行解码。

  

    

  
    `diarization`
    object
    
    
    
  

  说话人分离参数。

  子属性
      

  
    `enabled`
    boolean
    
    
    默认 `false`
  

  是否识别并标注说话人。

  

      

  
    `return_embedding`
    boolean
    
    
    默认 `false`
  

  是否返回说话人声纹向量。

  

  
## 响应

  

  
    `transcription_id`
    string
    
    
    
  

  任务标识,用于轮询结果。

  

  

  
    `status`
    string
    
    
    
  

  任务状态。提交成功后通常为 `RECEIVED`(任务已受理)。取值见[查询转写任务](/docs/api-reference/transcription/get-task/)。

  

  

  
    `data`
    object
    
    
    
  

  任务完成前为空对象。

  

  

  cURLPython
  

  

  bash
    
  

  
```
curl -X POST "https://ikho.cn/developer/api/open/partner/ai/transcriptions/" \
  -H "X-Client-Id: $CLIENT_ID" \
  -H "X-Client-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://ikho.cn/developer/api/open/partner/files/file_9f3c1a/content",
    "params": {
      "transcribe": { "language": "auto", "model": "ikho-asr-pro", "detection_level": "segment" },
      "vad": { "decode_silence": false },
      "diarization": { "enabled": true, "return_embedding": false }
    }
  }'
```

  ts
    
  

  
```
import requests

resp = requests.post(
    "https://ikho.cn/developer/api/open/partner/ai/transcriptions/",
    headers={
        "X-Client-Id": client_id,
        "X-Client-Api-Key": api_key,
        "Content-Type": "application/json",
    },
    json={
        "file_url": "https://ikho.cn/developer/api/open/partner/files/file_9f3c1a/content",
        "params": {
            "transcribe": {"language": "auto", "model": "ikho-asr-pro", "detection_level": "segment"},
            "vad": {"decode_silence": False},
            "diarization": {"enabled": True, "return_embedding": False},
        },
    },
)
print(resp.json()["transcription_id"])
```

  

  200 响应示例
    
  

  
```
{
  "transcription_id": "task_exec_5c8a2f",
  "status": "RECEIVED",
  "data": {}
}
```
