Quote a batch
Price a whole batch of generations at once. No credits are charged and nothing runs yet. Sending the same batch again returns the same quote; changing or reordering items creates a new one.
POST
/v1/generation-batches/quotesHeader parameters
Idempotency-KeystringrequiredA unique string that makes retries safe. Any value 16-255 characters; reuse it only when retrying the exact same request.
min length 16 · max length 255 · matches ^[A-Za-z0-9._:-]+$
X-RoasOS-ProjectstringOptional label to group this request under one of your projects. Appears in your usage records.
min length 1 · max length 64 · matches ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
X-RoasOS-Cost-CenterstringOptional label to attribute this request to a cost center. Appears in your usage records.
min length 1 · max length 64 · matches ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
Request body
requiredapplication/jsonitemsobject[]requiredmin items 1 · max items 8
Show propertiesHide properties
Array of
objectitem_idstringrequiredmin length 1 · max length 64 · matches ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
requestobjectrequiredShow propertiesHide properties
Any of:
object
typestringrequiredAllowed:
imagepromptstringrequiredmin length 1 · max length 10000
webhook_urlstring<uri>modelstringdefault: "nano-banana-pro"
Allowed:
nano-banana-pronano-banana-2gpt-image-2kling-3-imageflux-2-maxgrok-imagine-imageoptionsobjectdefault: {}
Show propertiesHide properties
aspect_ratiostringmin length 1 · max length 32
resolutionstringmax length 32
num_outputsintegermin 1 · max 4
reference_imagesstring<uri>[]max items 9
negative_promptstringmax length 2000
prompt_upsamplingbooleanseedintegermin -2147483648 · max 2147483647
object
typestringrequiredAllowed:
videopromptstringrequiredmin length 1 · max length 10000
webhook_urlstring<uri>modelstringdefault: "kling-3"
Allowed:
veo-3.1grok-imaginewan-2.7seedance-2seedance-2-progemini-omni-flashkling-o3-prokling-o3kling-o3-4kkling-3-prokling-3-4kkling-3optionsobjectdefault: {}
Show propertiesHide properties
aspect_ratiostringmin length 1 · max length 32
resolutionstringmax length 32
durationintegermin 1 · max 60
reference_imagesstring<uri>[]max items 9
reference_videosstring<uri>[]max items 3
imagestring<uri>negative_promptstringmax length 2000
generate_audiobooleanlast_framestring<uri>multi_shotsbooleanprompt_expansionbooleanaudio_urlstring<uri>audio_urlsstring<uri>[]max items 3
object
typestringrequiredAllowed:
audiopromptstringrequiredmin length 1 · max length 10000
webhook_urlstring<uri>modelstringdefault: "elevenlabs-v3"
Allowed:
elevenlabs-v3maya-1minimax-speech-hdminimax-speech-turboqwen3-ttsoptionsobjectdefault: {}
Show propertiesHide properties
voicestringmin length 1 · max length 256
speednumbermin 0.1 · max 5
pitchnumbermin -12 · max 12
stabilitynumbermin 0 · max 1
similarity_boostnumbermin 0 · max 1
languagestringmin length 1 · max length 64
object
typestringrequiredAllowed:
lipsyncpromptstringrequiredmin length 1 · max length 10000
webhook_urlstring<uri>modelstringdefault: "ltx-lipsync"
Allowed:
ltx-lipsyncoptionsobjectrequiredShow propertiesHide properties
aspect_ratiostringmin length 1 · max length 32
imagestring<uri>requiredaudio_urlstring<uri>requiredResponses
200Side-effect-free all-items-valid batch quote
dataobjectrequiredShow propertiesHide properties
kindstringrequiredAllowed:
batch_quotebatch_quote_idstring<uuid>requireditemsobject[]requiredmin items 1 · max items 8
Show propertiesHide properties
Array of
objectitem_idstringrequiredmin length 1 · max length 64 · matches ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
reserved_creditsintegerrequiredmin 0
confirmationobjectrequiredShow propertiesHide properties
generation_typestringrequiredAllowed:
imagevideoaudiolipsyncmodelstringrequiredmin length 1 · max length 200
modestringmin length 1 · max length 160
resolutionstringmin length 1 · max length 32
output_countintegermin 0 · max 16
duration_secondsnumbermin 0 · max 3600
generate_audiobooleanreference_countintegermin 0 · max 16
text_lengthintegermin 0 · max 1000000
total_reserved_creditsintegerrequiredmin 0
pricing_versionstringrequiredmin length 1 · max length 80
expires_atstring<date-time>requiredauthorizationobjectrequiredShow propertiesHide properties
Any of:
object
statusstringrequiredAllowed:
auto_approvedobject
statusstringrequiredAllowed:
approval_requiredauthorize_urlstring<uri>requiredmax length 2048
400The batch or one indexed item is invalid; no quote is issued
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1 · max length 128
messagestringrequiredmin length 1 · max length 2000
retryablebooleanrequiredrequest_idstring<uuid>requiredbalanceintegermin 0
requiredintegermin 0
fieldstringmin length 1 · max length 512
statestringmin length 1 · max length 128
retryWithNewKeybooleanparameterstringmin length 1 · max length 128
allowedstring[]max items 100
403The API key is not authorized for one or more requested models
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1 · max length 128
messagestringrequiredmin length 1 · max length 2000
retryablebooleanrequiredrequest_idstring<uuid>requiredbalanceintegermin 0
requiredintegermin 0
fieldstringmin length 1 · max length 512
statestringmin length 1 · max length 128
retryWithNewKeybooleanparameterstringmin length 1 · max length 128
allowedstring[]max items 100
409The parent idempotency key was reused for a different ordered batch
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1 · max length 128
messagestringrequiredmin length 1 · max length 2000
retryablebooleanrequiredrequest_idstring<uuid>requiredbalanceintegermin 0
requiredintegermin 0
fieldstringmin length 1 · max length 512
statestringmin length 1 · max length 128
retryWithNewKeybooleanparameterstringmin length 1 · max length 128
allowedstring[]max items 100
429Write rate limit exceeded
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1 · max length 128
messagestringrequiredmin length 1 · max length 2000
retryablebooleanrequiredrequest_idstring<uuid>requiredbalanceintegermin 0
requiredintegermin 0
fieldstringmin length 1 · max length 512
statestringmin length 1 · max length 128
retryWithNewKeybooleanparameterstringmin length 1 · max length 128
allowedstring[]max items 100
503Generation preparation, media evidence, pricing, or quote authority is unavailable
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1 · max length 128
messagestringrequiredmin length 1 · max length 2000
retryablebooleanrequiredrequest_idstring<uuid>requiredbalanceintegermin 0
requiredintegermin 0
fieldstringmin length 1 · max length 512
statestringmin length 1 · max length 128
retryWithNewKeybooleanparameterstringmin length 1 · max length 128
allowedstring[]max items 100
Request
curl -X POST "https://api.roasos.com/v1/generation-batches/quotes" \
-H "Idempotency-Key: string" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"item_id": "hero-image",
"request": {
"type": "image",
"prompt": "Studio product photograph of a cobalt hydration bottle",
"model": "nano-banana-pro",
"options": {
"aspect_ratio": "1:1",
"resolution": "1K",
"num_outputs": 1
}
}
},
{
"item_id": "hero-video",
"request": {
"type": "video",
"prompt": "Slow push-in on a skincare bottle in soft morning light",
"model": "kling-3",
"options": {
"aspect_ratio": "9:16",
"resolution": "auto",
"duration": 5,
"generate_audio": true
}
}
}
]
}'const response = await fetch("https://api.roasos.com/v1/generation-batches/quotes", {
method: "POST",
headers: {
"Idempotency-Key": "string",
"Content-Type": "application/json"
},
body: JSON.stringify({
"items": [
{
"item_id": "hero-image",
"request": {
"type": "image",
"prompt": "Studio product photograph of a cobalt hydration bottle",
"model": "nano-banana-pro",
"options": {
"aspect_ratio": "1:1",
"resolution": "1K",
"num_outputs": 1
}
}
},
{
"item_id": "hero-video",
"request": {
"type": "video",
"prompt": "Slow push-in on a skincare bottle in soft morning light",
"model": "kling-3",
"options": {
"aspect_ratio": "9:16",
"resolution": "auto",
"duration": 5,
"generate_audio": true
}
}
}
]
})
});import requests
response = requests.post(
"https://api.roasos.com/v1/generation-batches/quotes",
headers={
"Idempotency-Key": "string",
"Content-Type": "application/json"
},
json={
"items": [
{
"item_id": "hero-image",
"request": {
"type": "image",
"prompt": "Studio product photograph of a cobalt hydration bottle",
"model": "nano-banana-pro",
"options": {
"aspect_ratio": "1:1",
"resolution": "1K",
"num_outputs": 1
}
}
},
{
"item_id": "hero-video",
"request": {
"type": "video",
"prompt": "Slow push-in on a skincare bottle in soft morning light",
"model": "kling-3",
"options": {
"aspect_ratio": "9:16",
"resolution": "auto",
"duration": 5,
"generate_audio": True
}
}
}
]
},
)Response
{
"data": {
"kind": "batch_quote",
"batch_quote_id": "<uuid>",
"items": [
{
"item_id": "string",
"reserved_credits": 0,
"confirmation": {
"generation_type": "image",
"model": "string",
"mode": "string",
"resolution": "string",
"output_count": 0,
"duration_seconds": 0,
"generate_audio": true,
"reference_count": 0,
"text_length": 0
}
}
],
"total_reserved_credits": 0,
"pricing_version": "string",
"expires_at": "2024-01-01T00:00:00Z",
"authorization": {
"status": "auto_approved"
}
}
}{
"error": {
"code": "string",
"message": "string",
"retryable": true,
"request_id": "<uuid>",
"balance": 0,
"required": 0,
"field": "string",
"state": "string",
"retryWithNewKey": true,
"parameter": "string",
"allowed": [
"string"
]
}
}{
"error": {
"code": "string",
"message": "string",
"retryable": true,
"request_id": "<uuid>",
"balance": 0,
"required": 0,
"field": "string",
"state": "string",
"retryWithNewKey": true,
"parameter": "string",
"allowed": [
"string"
]
}
}{
"error": {
"code": "string",
"message": "string",
"retryable": true,
"request_id": "<uuid>",
"balance": 0,
"required": 0,
"field": "string",
"state": "string",
"retryWithNewKey": true,
"parameter": "string",
"allowed": [
"string"
]
}
}{
"error": {
"code": "string",
"message": "string",
"retryable": true,
"request_id": "<uuid>",
"balance": 0,
"required": 0,
"field": "string",
"state": "string",
"retryWithNewKey": true,
"parameter": "string",
"allowed": [
"string"
]
}
}{
"error": {
"code": "string",
"message": "string",
"retryable": true,
"request_id": "<uuid>",
"balance": 0,
"required": 0,
"field": "string",
"state": "string",
"retryWithNewKey": true,
"parameter": "string",
"allowed": [
"string"
]
}
}