Retrieve a batch
curl --request GET \
--url https://api.zerogpu.ai/v1/batches/{batch_id} \
--header 'x-api-key: <api-key>' \
--header 'x-project-id: <api-key>'import requests
url = "https://api.zerogpu.ai/v1/batches/{batch_id}"
headers = {
"x-api-key": "<api-key>",
"x-project-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'x-project-id': '<api-key>'}
};
fetch('https://api.zerogpu.ai/v1/batches/{batch_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/batches/{batch_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-project-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/batches/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-project-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"status": "validating",
"input_file_id": "<string>",
"output_file_id": "<string>",
"error_file_id": "<string>",
"completion_window": "<string>",
"created_at": 123,
"expires_at": 123,
"request_counts": {
"total": 123,
"completed": 123,
"failed": 123
},
"metadata": {}
}Batch API
Retrieve batch
Interactive playground for GET /v1/batches/.
GET
/
v1
/
batches
/
{batch_id}
Retrieve a batch
curl --request GET \
--url https://api.zerogpu.ai/v1/batches/{batch_id} \
--header 'x-api-key: <api-key>' \
--header 'x-project-id: <api-key>'import requests
url = "https://api.zerogpu.ai/v1/batches/{batch_id}"
headers = {
"x-api-key": "<api-key>",
"x-project-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'x-project-id': '<api-key>'}
};
fetch('https://api.zerogpu.ai/v1/batches/{batch_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/v1/batches/{batch_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-project-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/v1/batches/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-project-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"status": "validating",
"input_file_id": "<string>",
"output_file_id": "<string>",
"error_file_id": "<string>",
"completion_window": "<string>",
"created_at": 123,
"expires_at": 123,
"request_counts": {
"total": 123,
"completed": 123,
"failed": 123
},
"metadata": {}
}Poll a batch by ID. Use this while
status is in_progress or cancelling; stop when the status is terminal (completed, failed, expired, or cancelled).
When complete, download results with output_file_id and error_file_id via Files API.Path Parameters
Response
Batch object
Available options:
batch Available options:
validating, in_progress, finalizing, completed, failed, expired, cancelling, cancelled 
