Query T2A Async V2 Task Status
curl --request GET \
--url https://api.minimaxi.com/v1/query/t2a_async_query_v2 \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.minimaxi.com/v1/query/t2a_async_query_v2"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.minimaxi.com/v1/query/t2a_async_query_v2', 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.minimaxi.com/v1/query/t2a_async_query_v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/query/t2a_async_query_v2"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.minimaxi.com/v1/query/t2a_async_query_v2")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/query/t2a_async_query_v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"task_id": 95157322514444,
"status": "Processing",
"file_id": 95157322514496,
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}异步长文本语音合成
查询语音生成任务状态
使用本接口,查询异步语音合成任务状态。
GET
/
v1
/
query
/
t2a_async_query_v2
Query T2A Async V2 Task Status
curl --request GET \
--url https://api.minimaxi.com/v1/query/t2a_async_query_v2 \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.minimaxi.com/v1/query/t2a_async_query_v2"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.minimaxi.com/v1/query/t2a_async_query_v2', 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.minimaxi.com/v1/query/t2a_async_query_v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/query/t2a_async_query_v2"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.minimaxi.com/v1/query/t2a_async_query_v2")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/query/t2a_async_query_v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"task_id": 95157322514444,
"status": "Processing",
"file_id": 95157322514496,
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}注:该 API 限制每秒最多查询 10 次。
授权
查询参数
任务 ID,提交任务时返回的信息
响应
200 - application/json
任务 ID
该任务的当前状态。
- Processing: 该任务正在处理中
- Success: 该任务已完成
- Failed: 任务失败
- Expired: 任务已过期
可用选项:
success, failed, expired, processing 本次请求的状态码及其详情
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I