List Batches
curl --request GET \
--url https://api.example.com/v1/batchesimport requests
url = "https://api.example.com/v1/batches"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/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.example.com/v1/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/v1/batches"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/v1/batches")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"completion_window": "<string>",
"created_at": 123,
"endpoint": "<string>",
"id": "<string>",
"job_id": "<string>",
"input_file_id": "<string>",
"request_counts": {
"completed": 123,
"failed": 123,
"total": 123
},
"status": "validating",
"cancelled_at": 123,
"cancelling_at": 123,
"completed_at": 123,
"error_file_id": "<string>",
"errors": {
"data": [
{
"code": "<string>",
"line": 123,
"message": "<string>",
"param": "<string>"
}
],
"object": "list"
},
"expired_at": 123,
"expires_at": 123,
"failed_at": 123,
"finalizing_at": 123,
"in_progress_at": 123,
"metadata": {},
"model": "",
"object": "batch",
"output_file_id": "<string>",
"price_1m_tokens": 0,
"processing_cost": 0,
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}
],
"first_id": "<string>",
"last_id": "<string>",
"has_more": true,
"object": "list"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}batches
List Batches
List all batches.
GET
/
v1
/
batches
List Batches
curl --request GET \
--url https://api.example.com/v1/batchesimport requests
url = "https://api.example.com/v1/batches"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/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.example.com/v1/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/v1/batches"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/v1/batches")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"completion_window": "<string>",
"created_at": 123,
"endpoint": "<string>",
"id": "<string>",
"job_id": "<string>",
"input_file_id": "<string>",
"request_counts": {
"completed": 123,
"failed": 123,
"total": 123
},
"status": "validating",
"cancelled_at": 123,
"cancelling_at": 123,
"completed_at": 123,
"error_file_id": "<string>",
"errors": {
"data": [
{
"code": "<string>",
"line": 123,
"message": "<string>",
"param": "<string>"
}
],
"object": "list"
},
"expired_at": 123,
"expires_at": 123,
"failed_at": 123,
"finalizing_at": 123,
"in_progress_at": 123,
"metadata": {},
"model": "",
"object": "batch",
"output_file_id": "<string>",
"price_1m_tokens": 0,
"processing_cost": 0,
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}
],
"first_id": "<string>",
"last_id": "<string>",
"has_more": true,
"object": "list"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Response
Successful Response
A list of batch objects.
Show child attributes
Show child attributes
The ID of the first batch in the list.
The ID of the last batch in the list.
Whether there are more batches available after this list.
The object type, which is always list.
Allowed value:
"list"⌘I

