Fetch a job
curl --request GET \
--url https://your-sutro-deployment/v1/jobs/{job_id} \
--header 'Authorization: <authorization>'import requests
url = "https://your-sutro-deployment/v1/jobs/{job_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://your-sutro-deployment/v1/jobs/{job_id}', 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://your-sutro-deployment/v1/jobs/{job_id}",
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>"
],
]);
$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://your-sutro-deployment/v1/jobs/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
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://your-sutro-deployment/v1/jobs/{job_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-sutro-deployment/v1/jobs/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyAPI
Fetch a job
Retrieve one Batch job and its metadata.
GET
/
v1
/
jobs
/
{job_id}
Fetch a job
curl --request GET \
--url https://your-sutro-deployment/v1/jobs/{job_id} \
--header 'Authorization: <authorization>'import requests
url = "https://your-sutro-deployment/v1/jobs/{job_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://your-sutro-deployment/v1/jobs/{job_id}', 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://your-sutro-deployment/v1/jobs/{job_id}",
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>"
],
]);
$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://your-sutro-deployment/v1/jobs/{job_id}"
req, _ := http.NewRequest("GET", url, nil)
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://your-sutro-deployment/v1/jobs/{job_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-sutro-deployment/v1/jobs/{job_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodystring
required
The job to retrieve.
Headers
string
required
Deployment API key in the form
Key YOUR_SUTRO_API_KEY.curl https://YOUR-SUTRO-DEPLOYMENT/v1/jobs/JOB_ID \
-H "Authorization: Key YOUR_SUTRO_API_KEY"
Response
The response is{ "job": { ... } }. A job contains:
| Field | Type | Meaning |
|---|---|---|
job_id, status, model | string | Identity, state, and model or Function |
system_prompt | string | null | Standalone-model prompt |
job_priority | integer | 0 or 1 |
datetime_created, datetime_started, datetime_completed | string | null | ISO timestamps |
json_schema | object | null | Structured-output schema |
sampling_params | object | Generation settings |
name, description | string | null | User metadata |
input_tokens, output_tokens, num_rows | integer | null | Usage totals |
job_cost, cost_estimate | number | null | Actual or estimated USD cost |
failure_reason | object | null | Failure detail |
null until available. A missing job returns 404 with { "message": "..." }.⌘I