Run up to 500 jobs
No rate limits on paid usage. Every job is priced first: when your paid credits and the app’s own limit cover them all, all are accepted (202) and run in order as your running slots free up (10 at once, up to 40 as you buy more credits). If they do not fit, nothing is accepted: 402 says how many fit and how much more is needed. Optional Idempotency-Key for the whole batch; each job may carry its own idempotencyKey.
curl --request POST \
--url https://www.summerengine.com/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jobs": [
{
"model": "<string>",
"input": {},
"idempotencyKey": "<string>",
"webhookUrl": "<string>"
}
]
}
'import requests
url = "https://www.summerengine.com/v1/batches"
payload = { "jobs": [
{
"model": "<string>",
"input": {},
"idempotencyKey": "<string>",
"webhookUrl": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jobs: [
{
model: '<string>',
input: {},
idempotencyKey: '<string>',
webhookUrl: '<string>'
}
]
})
};
fetch('https://www.summerengine.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://www.summerengine.com/v1/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jobs' => [
[
'model' => '<string>',
'input' => [
],
'idempotencyKey' => '<string>',
'webhookUrl' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.summerengine.com/v1/batches"
payload := strings.NewReader("{\n \"jobs\": [\n {\n \"model\": \"<string>\",\n \"input\": {},\n \"idempotencyKey\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.summerengine.com/v1/batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jobs\": [\n {\n \"model\": \"<string>\",\n \"input\": {},\n \"idempotencyKey\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.summerengine.com/v1/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jobs\": [\n {\n \"model\": \"<string>\",\n \"input\": {},\n \"idempotencyKey\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"batch": {
"id": "<string>",
"estimatedPrice": "<string>",
"jobs": [
{
"id": "<string>",
"state": "queued",
"model": "<string>",
"estimatedPrice": "<string>"
}
]
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"fix_url": "<string>"
}
}Authorizations
A Summer sign-in: an OAuth 2.1 access token, valid one hour. Sign in once with npx -y summer-engine login, then print a token with summer token. Each app you sign in spends your paid credits up to the limit you set in Connected apps.
Headers
One key for the whole batch: a retry with the same key answers the batch it made and never queues it twice.
1 - 128Body
1 - 500 elementsShow child attributes
Show child attributes
Response
Accepted: every job queued, each at the price it holds (no quoteId: each job is priced when the batch is accepted).
Show child attributes
Show child attributes
curl --request POST \
--url https://www.summerengine.com/v1/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jobs": [
{
"model": "<string>",
"input": {},
"idempotencyKey": "<string>",
"webhookUrl": "<string>"
}
]
}
'import requests
url = "https://www.summerengine.com/v1/batches"
payload = { "jobs": [
{
"model": "<string>",
"input": {},
"idempotencyKey": "<string>",
"webhookUrl": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
jobs: [
{
model: '<string>',
input: {},
idempotencyKey: '<string>',
webhookUrl: '<string>'
}
]
})
};
fetch('https://www.summerengine.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://www.summerengine.com/v1/batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jobs' => [
[
'model' => '<string>',
'input' => [
],
'idempotencyKey' => '<string>',
'webhookUrl' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.summerengine.com/v1/batches"
payload := strings.NewReader("{\n \"jobs\": [\n {\n \"model\": \"<string>\",\n \"input\": {},\n \"idempotencyKey\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.summerengine.com/v1/batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jobs\": [\n {\n \"model\": \"<string>\",\n \"input\": {},\n \"idempotencyKey\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.summerengine.com/v1/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jobs\": [\n {\n \"model\": \"<string>\",\n \"input\": {},\n \"idempotencyKey\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"batch": {
"id": "<string>",
"estimatedPrice": "<string>",
"jobs": [
{
"id": "<string>",
"state": "queued",
"model": "<string>",
"estimatedPrice": "<string>"
}
]
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"fix_url": "<string>"
}
}
