列出批处理任务
curl --request GET \
--url https://open.bigmodel.cn/api/paas/v4/batches \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/paas/v4/batches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/paas/v4/batches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/paas/v4/batches")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/paas/v4/batches"
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/paas/v4/batches",
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;
}{
"object": "list",
"data": [
{
"id": "<string>",
"object": "<string>",
"endpoint": "<string>",
"input_file_id": "<string>",
"completion_window": "<string>",
"status": "<string>",
"output_file_id": "<string>",
"error_file_id": "<string>",
"created_at": 123,
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"expired_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"request_counts": 123,
"total": 123,
"completed": 123,
"failed": 123,
"metadata": {}
}
],
"first_id": "<string>",
"last_id": "<string>",
"has_more": true
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}批处理 API
列出批处理任务
获取批量处理任务列表,支持分页。见 批量服务。点击 Try it 按钮可快速试用。
GET
/
paas
/
v4
/
batches
列出批处理任务
curl --request GET \
--url https://open.bigmodel.cn/api/paas/v4/batches \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/paas/v4/batches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/paas/v4/batches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/paas/v4/batches")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/paas/v4/batches"
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/paas/v4/batches",
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;
}{
"object": "list",
"data": [
{
"id": "<string>",
"object": "<string>",
"endpoint": "<string>",
"input_file_id": "<string>",
"completion_window": "<string>",
"status": "<string>",
"output_file_id": "<string>",
"error_file_id": "<string>",
"created_at": 123,
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"expired_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"request_counts": 123,
"total": 123,
"completed": 123,
"failed": 123,
"metadata": {}
}
],
"first_id": "<string>",
"last_id": "<string>",
"has_more": true
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Was this page helpful?
⌘I