List Batches
Page through your batches at /v1/batches
curl --request GET \
--url https://api.morphllm.com/v1/batches \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.morphllm.com/v1/batches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.morphllm.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.morphllm.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",
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.morphllm.com/v1/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))
}HttpResponse<String> response = Unirest.get("https://api.morphllm.com/v1/batches")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.morphllm.com/v1/batches")
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{
"object": "list",
"data": [
{
"id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f",
"completion_window": "24h",
"metadata": {
"job": "nightly-summaries"
},
"created_at": 1780000000,
"status": "completed",
"model": "morph-glm53flash",
"output_file_id": "file_0e7d6c5b-4a39-4281-9f7e-6d5c4b3a2918",
"error_file_id": "file_7f6e5d4c-3b2a-4190-8e7d-6c5b4a392817",
"in_progress_at": 1780000012,
"finalizing_at": 1780005460,
"completed_at": 1780005470,
"failed_at": null,
"expired_at": null,
"expires_at": 1780086400,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 2,
"completed": 2,
"failed": 0
},
"errors": null,
"usage": {
"input_tokens": 824,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 36,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 860
}
}
],
"first_id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"last_id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"has_more": false
}{
"error": {
"code": "invalid_request_error",
"message": "The request body is missing the `model` field."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key provided."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry in 12 seconds."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}Overview
Lists the key’s batches, newest first.after is an integer offset, not an object id: add limit to it for each next page.Authorizations
Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.
Query Parameters
How many batches to return in this page. Batches per page. Default 20, max 100.
1 <= x <= 10020
Pagination offset into your batches. An integer count, not an object id, so page manually rather than with the SDK auto-paginator.
Offset cursor: how many batches to skip. Add limit to it for each next page.
x >= 020
Response
The requested page of batches.
A page of batches.
Object type of a batch page, always list.
"list"
Batches in this page.
Show child attributes
Show child attributes
[
{
"id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f",
"completion_window": "24h",
"metadata": { "job": "nightly-summaries" },
"created_at": 1780000000,
"status": "completed",
"model": "morph-glm53flash",
"output_file_id": "file_0e7d6c5b-4a39-4281-9f7e-6d5c4b3a2918",
"error_file_id": "file_7f6e5d4c-3b2a-4190-8e7d-6c5b4a392817",
"in_progress_at": 1780000012,
"finalizing_at": 1780005460,
"completed_at": 1780005470,
"failed_at": null,
"expired_at": null,
"expires_at": 1780086400,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": { "total": 2, "completed": 2, "failed": 0 },
"errors": null,
"usage": {
"input_tokens": 824,
"input_tokens_details": { "cached_tokens": 0 },
"output_tokens": 36,
"output_tokens_details": { "reasoning_tokens": 0 },
"total_tokens": 860
}
}
]
Id of the first batch in this page, or null when the page is empty.
"batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c"
Id of the last batch in this page, or null when the page is empty.
"batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c"
Whether more batches exist after this page.
false
curl --request GET \
--url https://api.morphllm.com/v1/batches \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.morphllm.com/v1/batches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.morphllm.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.morphllm.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",
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.morphllm.com/v1/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))
}HttpResponse<String> response = Unirest.get("https://api.morphllm.com/v1/batches")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.morphllm.com/v1/batches")
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{
"object": "list",
"data": [
{
"id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"object": "batch",
"endpoint": "/v1/chat/completions",
"input_file_id": "file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f",
"completion_window": "24h",
"metadata": {
"job": "nightly-summaries"
},
"created_at": 1780000000,
"status": "completed",
"model": "morph-glm53flash",
"output_file_id": "file_0e7d6c5b-4a39-4281-9f7e-6d5c4b3a2918",
"error_file_id": "file_7f6e5d4c-3b2a-4190-8e7d-6c5b4a392817",
"in_progress_at": 1780000012,
"finalizing_at": 1780005460,
"completed_at": 1780005470,
"failed_at": null,
"expired_at": null,
"expires_at": 1780086400,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 2,
"completed": 2,
"failed": 0
},
"errors": null,
"usage": {
"input_tokens": 824,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 36,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 860
}
}
],
"first_id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"last_id": "batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
"has_more": false
}{
"error": {
"code": "invalid_request_error",
"message": "The request body is missing the `model` field."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key provided."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry in 12 seconds."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}