# 提交音频转写

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

POST
  https://platform.ikho.cn/developer/api/open/partner/ai/transcriptions/
  试一试 

  
## 鉴权

  

  
    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
    
    必填
    
  

  可公网访问的音频下载地址,通常为合并分片返回的 DownloadUrl(支持 mp3、m4a、wav)。

  

  

  
    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
    
    
    
  

  任务状态。刚提交时通常为 PENDING。取值见查询转写任务。

  

  

  
    data
    object
    
    
    
  

  任务完成前为空对象。

  

  

  cURLPython
  

  

  bash
    
  

  
```
curl -X POST "https://platform.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://storage.ikho.cn/download/9f3c1a?...",
    "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(
    class="tk-str">"https:class="tk-cmt">//platform.ikho.cn/developer/api/open/partner/ai/transcriptions/",
    headers={
        class="tk-str">"X-Client-Id": client_id,
        class="tk-str">"X-Client-Api-Key": api_key,
        class="tk-str">"Content-Type": class="tk-str">"application/json",
    },
    json={
        class="tk-str">"file_url": class="tk-str">"https:class="tk-cmt">//storage.ikho.cn/download/9f3c1a?...",
        class="tk-str">"params": {
            class="tk-str">"transcribe": {class="tk-str">"language": class="tk-str">"auto", class="tk-str">"model": class="tk-str">"ikho-asr-pro", class="tk-str">"detection_level": class="tk-str">"segment"},
            class="tk-str">"vad": {class="tk-str">"decode_silence": False},
            class="tk-str">"diarization": {class="tk-str">"enabled": True, class="tk-str">"return_embedding": False},
        },
    },
)
print(resp.json()[class="tk-str">"transcription_id"])
```

  

  200 响应示例
    
  

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