Get Batch Results
Fetch scored rows from a completed batch at /v1/reflex/asynchronous_batches//results
curl --request GET \
--url https://api.morphllm.com/v1/reflex/asynchronous_batches/{batch_id}/results \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.morphllm.com/v1/reflex/asynchronous_batches/{batch_id}/results"
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/reflex/asynchronous_batches/{batch_id}/results', 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/reflex/asynchronous_batches/{batch_id}/results",
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/reflex/asynchronous_batches/{batch_id}/results"
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/reflex/asynchronous_batches/{batch_id}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.morphllm.com/v1/reflex/asynchronous_batches/{batch_id}/results")
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{
"id": "rbatch-a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"object": "reflex.batch.results",
"status": "completed",
"request_counts": {
"total": 2,
"completed": 2,
"failed": 0
},
"results": [
{
"id": "row-1",
"status": "completed",
"predictions": [
{
"model": "guardrail",
"mode": "multi_label",
"classes": [
{
"class_id": 0,
"label": "jailbreak",
"score": 0.98,
"selected": true
},
{
"class_id": 1,
"label": "benign",
"score": 0.02,
"selected": false
}
]
}
]
},
{
"id": "row-2",
"status": "failed",
"error": {
"type": "input_too_long",
"message": "text exceeds the token limit"
}
}
]
}{
"error": {
"code": "invalid_request_error",
"message": "The request body is missing the `model` field."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key provided."
}
}{
"error": {
"code": "not_found",
"message": "No fine-tuning job found with id ftjob-8f2k1."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry in 12 seconds."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}Overview
Returns the per-row predictions for a completed asynchronous batch. Rows for batches still in progress return once the batch reaches a terminal state — check status first.Authorizations
Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.
Path Parameters
The batch to read results from, once its rows have drained. Batch whose rows you want back.
"rbatch-a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
Response
Batch results.
Async batch status plus a per-row results array.
Identifier of the batch these results belong to.
"rbatch-a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
Object type, always reflex.batch.results.
"reflex.batch.results"
Status of the batch at the time you fetched the results.
"completed"
Final tally of the batch once it has drained.
Show child attributes
Show child attributes
{ "total": 2, "completed": 2, "failed": 0 }
One entry per uploaded row, keyed by your id, returned as inline JSON.
Show child attributes
Show child attributes
[
{
"id": "row-1",
"status": "completed",
"predictions": [
{
"model": "guardrail",
"mode": "multi_label",
"classes": [
{
"class_id": 0,
"label": "jailbreak",
"score": 0.98,
"selected": true
},
{
"class_id": 1,
"label": "benign",
"score": 0.02,
"selected": false
}
]
}
]
},
{
"id": "row-2",
"status": "failed",
"error": {
"type": "input_too_long",
"message": "text exceeds the token limit"
}
}
]
curl --request GET \
--url https://api.morphllm.com/v1/reflex/asynchronous_batches/{batch_id}/results \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.morphllm.com/v1/reflex/asynchronous_batches/{batch_id}/results"
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/reflex/asynchronous_batches/{batch_id}/results', 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/reflex/asynchronous_batches/{batch_id}/results",
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/reflex/asynchronous_batches/{batch_id}/results"
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/reflex/asynchronous_batches/{batch_id}/results")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.morphllm.com/v1/reflex/asynchronous_batches/{batch_id}/results")
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{
"id": "rbatch-a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"object": "reflex.batch.results",
"status": "completed",
"request_counts": {
"total": 2,
"completed": 2,
"failed": 0
},
"results": [
{
"id": "row-1",
"status": "completed",
"predictions": [
{
"model": "guardrail",
"mode": "multi_label",
"classes": [
{
"class_id": 0,
"label": "jailbreak",
"score": 0.98,
"selected": true
},
{
"class_id": 1,
"label": "benign",
"score": 0.02,
"selected": false
}
]
}
]
},
{
"id": "row-2",
"status": "failed",
"error": {
"type": "input_too_long",
"message": "text exceeds the token limit"
}
}
]
}{
"error": {
"code": "invalid_request_error",
"message": "The request body is missing the `model` field."
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key provided."
}
}{
"error": {
"code": "not_found",
"message": "No fine-tuning job found with id ftjob-8f2k1."
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry in 12 seconds."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}