GLM Audio to Text
curl --request POST \
--url https://api.myrouter.ai/v3/glm-asr \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file": "<string>",
"prompt": "<string>",
"hotwords": [
{}
]
}
'import requests
url = "https://api.myrouter.ai/v3/glm-asr"
payload = {
"file": "<string>",
"prompt": "<string>",
"hotwords": [{}]
}
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: [{}]})
};
fetch('https://api.myrouter.ai/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.myrouter.ai/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' => [
[
]
]
]),
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.myrouter.ai/v3/glm-asr"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n {}\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.myrouter.ai/v3/glm-asr")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myrouter.ai/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 {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>"
}Audio
GLM Audio to Text
POST
/
v3
/
glm-asr
GLM Audio to Text
curl --request POST \
--url https://api.myrouter.ai/v3/glm-asr \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"file": "<string>",
"prompt": "<string>",
"hotwords": [
{}
]
}
'import requests
url = "https://api.myrouter.ai/v3/glm-asr"
payload = {
"file": "<string>",
"prompt": "<string>",
"hotwords": [{}]
}
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: [{}]})
};
fetch('https://api.myrouter.ai/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.myrouter.ai/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' => [
[
]
]
]),
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.myrouter.ai/v3/glm-asr"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n {}\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.myrouter.ai/v3/glm-asr")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"file\": \"<string>\",\n \"prompt\": \"<string>\",\n \"hotwords\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.myrouter.ai/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 {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"text": "<string>"
}Transcribes audio files to text using the GLM-ASR-2512 model, with multi-language transcription support.
Request Headers
string
required
Enum:
application/jsonstring
required
Bearer authentication format: Bearer {{API Key}}.
Request Body
string
required
URL or Base64 encoded string of the audio file to transcribe. Supported audio formats: .wav / .mp3. Specifications: file size ≤ 25 MB, audio duration ≤ 30 seconds
string
For long text scenarios, you can provide previous transcription results as context. Recommended to be under 8000 characters.
array
Hotword list to improve recognition accuracy for domain-specific vocabulary. Format example: [“person name”, “place name”]. Recommended not to exceed 100 entries.Array length: 0 - 100
Response
string
The complete transcribed content of the audio
⌘I