Run a job
Run one model on its input. The files go to your Summer library. Short jobs come back done; long ones answer running with a job id to follow with GET /v1/jobs/. A quoteId caps the charge.
curl --request POST \
--url https://www.summerengine.com/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"model": "<string>",
"input": {},
"quoteId": "<string>",
"webhookUrl": "<string>"
}
'import requests
url = "https://www.summerengine.com/v1/jobs"
payload = {
"model": "<string>",
"input": {},
"quoteId": "<string>",
"webhookUrl": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({model: '<string>', input: {}, quoteId: '<string>', webhookUrl: '<string>'})
};
fetch('https://www.summerengine.com/v1/jobs', 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/jobs",
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([
'model' => '<string>',
'input' => [
],
'quoteId' => '<string>',
'webhookUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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/jobs"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {},\n \"quoteId\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/jobs")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {},\n \"quoteId\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.summerengine.com/v1/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": {},\n \"quoteId\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"job": {
"id": "<string>",
"state": "queued",
"model": "<string>",
"estimatedPrice": "<string>",
"price": "<string>",
"webhookId": "<string>",
"result": {}
}
}{
"job": {
"id": "<string>",
"state": "queued",
"model": "<string>",
"estimatedPrice": "<string>",
"price": "<string>",
"webhookId": "<string>",
"result": {}
}
}{
"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
A new key for each new request; the same key returns the first answer.
1 - 128wait=<seconds, at most 60>: answer with the finished job when it finishes in time.
"wait=60"
Body
A Summer model id from models.list, such as 3d/hunyuan-3d or 3d/default.
1 - 120The model's input, matching its inputSchema.
Show child attributes
Show child attributes
From models.estimate: refuse to charge more than it quoted.
1 - 600Summer POSTs here once, signed, when the job finishes. Needs a signing secret: webhooks.rotate_secret.
2048Response
Done.
Show child attributes
Show child attributes
curl --request POST \
--url https://www.summerengine.com/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"model": "<string>",
"input": {},
"quoteId": "<string>",
"webhookUrl": "<string>"
}
'import requests
url = "https://www.summerengine.com/v1/jobs"
payload = {
"model": "<string>",
"input": {},
"quoteId": "<string>",
"webhookUrl": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({model: '<string>', input: {}, quoteId: '<string>', webhookUrl: '<string>'})
};
fetch('https://www.summerengine.com/v1/jobs', 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/jobs",
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([
'model' => '<string>',
'input' => [
],
'quoteId' => '<string>',
'webhookUrl' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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/jobs"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {},\n \"quoteId\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/jobs")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {},\n \"quoteId\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.summerengine.com/v1/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"input\": {},\n \"quoteId\": \"<string>\",\n \"webhookUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"job": {
"id": "<string>",
"state": "queued",
"model": "<string>",
"estimatedPrice": "<string>",
"price": "<string>",
"webhookId": "<string>",
"result": {}
}
}{
"job": {
"id": "<string>",
"state": "queued",
"model": "<string>",
"estimatedPrice": "<string>",
"price": "<string>",
"webhookId": "<string>",
"result": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"fix_url": "<string>"
}
}
