GLM 音频转文字
curl --request POST \
--url https://api.ppio.com/v3/glm-asr \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file": "<string>",
"prompt": "<string>",
"hotwords": [
"<string>"
]
}
'import requests
url = "https://api.ppio.com/v3/glm-asr"
payload = {
"file": "<string>",
"prompt": "<string>",
"hotwords": ["<string>"]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({file: '<string>', prompt: '<string>', hotwords: ['<string>']})
};
fetch('https://api.ppio.com/v3/glm-asr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/glm-asr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => '<string>',
'prompt' => '<string>',
'hotwords' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/glm-asr"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/glm-asr")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/glm-asr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>"
}音频
GLM 音频转文字
POST
/
v3
/
glm-asr
GLM 音频转文字
curl --request POST \
--url https://api.ppio.com/v3/glm-asr \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file": "<string>",
"prompt": "<string>",
"hotwords": [
"<string>"
]
}
'import requests
url = "https://api.ppio.com/v3/glm-asr"
payload = {
"file": "<string>",
"prompt": "<string>",
"hotwords": ["<string>"]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({file: '<string>', prompt: '<string>', hotwords: ['<string>']})
};
fetch('https://api.ppio.com/v3/glm-asr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/glm-asr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => '<string>',
'prompt' => '<string>',
'hotwords' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/glm-asr"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/glm-asr")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/glm-asr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>"
}使用 GLM-ASR-2512 模型将音频文件转录为文本,支持多语言转录。
请求头
枚举值:
application/jsonBearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
需要转录的音频文件URL或Base64编码字符串,支持的音频文件格式:.wav / .mp3,规格限制:文件大小 ≤ 25 MB、音频时长 ≤ 30 秒
在长文本场景中,可以提供之前的转录结果作为上下文。建议小于8000字。
热词表,用于提升特定领域词汇识别率。格式例如[“人名”,“地名”],建议不超过100个。数组长度:0 - 100
响应
音频转录的完整内容
最后修改于 2026年7月3日
⌘I