Submit a batch of creative tasks
curl --request POST \
--url https://customer.lululab.ai/tasks/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"workflowId": "ImageGenV2",
"input": {
"prompt": "<string>",
"referenceImages": [
{
"url": "<string>",
"mimeType": "<string>"
}
]
},
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"saveGeneratedAssets": true,
"creationSource": "<string>"
}
}
]
'import requests
url = "https://customer.lululab.ai/tasks/batch"
payload = [
{
"workflowId": "ImageGenV2",
"input": {
"prompt": "<string>",
"referenceImages": [
{
"url": "<string>",
"mimeType": "<string>"
}
]
},
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"saveGeneratedAssets": True,
"creationSource": "<string>"
}
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
workflowId: 'ImageGenV2',
input: {prompt: '<string>', referenceImages: [{url: '<string>', mimeType: '<string>'}]},
quoteId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
attributes: {saveGeneratedAssets: true, creationSource: '<string>'}
}
])
};
fetch('https://customer.lululab.ai/tasks/batch', 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://customer.lululab.ai/tasks/batch",
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([
[
'workflowId' => 'ImageGenV2',
'input' => [
'prompt' => '<string>',
'referenceImages' => [
[
'url' => '<string>',
'mimeType' => '<string>'
]
]
],
'quoteId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'attributes' => [
'saveGeneratedAssets' => true,
'creationSource' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://customer.lululab.ai/tasks/batch"
payload := strings.NewReader("[\n {\n \"workflowId\": \"ImageGenV2\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"referenceImages\": [\n {\n \"url\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ]\n },\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"saveGeneratedAssets\": true,\n \"creationSource\": \"<string>\"\n }\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://customer.lululab.ai/tasks/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"workflowId\": \"ImageGenV2\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"referenceImages\": [\n {\n \"url\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ]\n },\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"saveGeneratedAssets\": true,\n \"creationSource\": \"<string>\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://customer.lululab.ai/tasks/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"workflowId\": \"ImageGenV2\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"referenceImages\": [\n {\n \"url\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ]\n },\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"saveGeneratedAssets\": true,\n \"creationSource\": \"<string>\"\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"workflowId": "<string>",
"status": "Created",
"output": {},
"errorMessage": "<string>",
"credits": 123,
"billingStatus": "<string>",
"quotedCredits": 123,
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"attributes": "<unknown>",
"input": "<unknown>"
}
]{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Tasks and recreation
Submit a batch of creative tasks
Submit 1–100 jobs, or at most 20 when the batch contains a video recreation job. Each item needs a distinct quoteId for the same account, workflow, and pricing inputs. Retrying the same batch with the same quotes returns the original tasks.
POST
/
tasks
/
batch
Submit a batch of creative tasks
curl --request POST \
--url https://customer.lululab.ai/tasks/batch \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"workflowId": "ImageGenV2",
"input": {
"prompt": "<string>",
"referenceImages": [
{
"url": "<string>",
"mimeType": "<string>"
}
]
},
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"saveGeneratedAssets": true,
"creationSource": "<string>"
}
}
]
'import requests
url = "https://customer.lululab.ai/tasks/batch"
payload = [
{
"workflowId": "ImageGenV2",
"input": {
"prompt": "<string>",
"referenceImages": [
{
"url": "<string>",
"mimeType": "<string>"
}
]
},
"quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"saveGeneratedAssets": True,
"creationSource": "<string>"
}
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
workflowId: 'ImageGenV2',
input: {prompt: '<string>', referenceImages: [{url: '<string>', mimeType: '<string>'}]},
quoteId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
attributes: {saveGeneratedAssets: true, creationSource: '<string>'}
}
])
};
fetch('https://customer.lululab.ai/tasks/batch', 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://customer.lululab.ai/tasks/batch",
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([
[
'workflowId' => 'ImageGenV2',
'input' => [
'prompt' => '<string>',
'referenceImages' => [
[
'url' => '<string>',
'mimeType' => '<string>'
]
]
],
'quoteId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'attributes' => [
'saveGeneratedAssets' => true,
'creationSource' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://customer.lululab.ai/tasks/batch"
payload := strings.NewReader("[\n {\n \"workflowId\": \"ImageGenV2\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"referenceImages\": [\n {\n \"url\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ]\n },\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"saveGeneratedAssets\": true,\n \"creationSource\": \"<string>\"\n }\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://customer.lululab.ai/tasks/batch")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"workflowId\": \"ImageGenV2\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"referenceImages\": [\n {\n \"url\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ]\n },\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"saveGeneratedAssets\": true,\n \"creationSource\": \"<string>\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://customer.lululab.ai/tasks/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"workflowId\": \"ImageGenV2\",\n \"input\": {\n \"prompt\": \"<string>\",\n \"referenceImages\": [\n {\n \"url\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ]\n },\n \"quoteId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"saveGeneratedAssets\": true,\n \"creationSource\": \"<string>\"\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"workflowId": "<string>",
"status": "Created",
"output": {},
"errorMessage": "<string>",
"credits": 123,
"billingStatus": "<string>",
"quotedCredits": 123,
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"attributes": "<unknown>",
"input": "<unknown>"
}
]{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Body
application/json
Response
Tasks in the same order as the request.