Skip to main content
POST
/
v3
/
glm-asr
GLM Audio to Text
curl --request POST \
  --url https://api.novita.ai/v3/glm-asr \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "file": "<string>",
  "prompt": "<string>",
  "hotwords": [
    "<string>"
  ]
}
'
import requests

url = "https://api.novita.ai/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.novita.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.novita.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' => [
'<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.novita.ai/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.novita.ai/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.novita.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 \"<string>\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "text": "<string>"
}
Use the GLM-ASR-2512 model to transcribe audio files into text, supporting multi-language transcription.

Request Headers

Content-Type
string
required
Supports: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

file
string
required
The audio file URL or Base64 encoded string to be transcribed. Supported audio formats: .wav / .mp3. Limitations: file size ≤ 25 MB, audio duration ≤ 30 seconds
prompt
string
For long text scenarios, you can provide previous transcription results as context. Recommended to be less than 8000 characters.
hotwords
string[]
Hotword list to improve recognition accuracy for domain-specific vocabulary. Format example: [“person name”, “place name”]. Recommended not to exceed 100 items.Array length: 0 - 100

Response

text
string
The complete transcribed content of the audio
Last modified on July 3, 2026