跳转到主要内容
GET
/
openai
/
v1
/
batches
查询批处理任务列表
curl --request GET \
  --url https://api.ppio.com/openai/v1/batches \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>'
import requests

url = "https://api.ppio.com/openai/v1/batches"

headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};

fetch('https://api.ppio.com/openai/v1/batches', 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/openai/v1/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: <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"
"net/http"
"io"
)

func main() {

url := "https://api.ppio.com/openai/v1/batches"

req, _ := http.NewRequest("GET", url, nil)

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.get("https://api.ppio.com/openai/v1/batches")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.ppio.com/openai/v1/batches")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "<string>",
      "object": "<string>",
      "endpoint": "<string>",
      "input_file_id": "<string>",
      "output_file_id": "<string>",
      "error_file_id": "<string>",
      "completion_window": "<string>",
      "in_progress_at": {},
      "expires_at": {},
      "finalizing_at": {},
      "completed_at": {},
      "failed_at": {},
      "expired_at": {},
      "cancelling_at": {},
      "cancelled_at": {},
      "status": "<string>",
      "errors": "<string>",
      "version": 123,
      "created_at": "<string>",
      "updated_at": {},
      "created_by": "<string>",
      "created_by_key_id": "<string>",
      "remark": "<string>",
      "total": 123,
      "completed": 123,
      "failed": 123,
      "metadata": {},
      "request_counts": {
        "total": 123,
        "completed": 123,
        "failed": 123
      }
    }
  ],
  "first_id": "<string>",
  "has_more": true,
  "last_id": "<string>",
  "object": "<string>"
}
查询所有可用的批处理任务列表。

请求头

Content-Type
string
必填
枚举值: application/json
Authorization
string
必填
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。

响应

data
object[]
必填
批处理任务对象数组。
first_id
string
必填
列表中第一个批处理任务的 ID。
has_more
boolean
必填
指示在该列表之外是否还有更多批处理任务。
last_id
string
必填
列表中最后一个批处理任务的 ID。
object
string
必填
对象类型,恒为 list
最后修改于 2026年7月3日