Skip to main content

Generate Media

Generate new images from a text prompt, or enhance existing images using AI. This is a queue-based API — it returns a requestId that can be used to check the status and retrieve results using the get-request-status API.

Endpoint

POST media/generate

Authentication

Include your Enterprise API credentials in the request headers:

sivi-api-key: YOUR_API_KEY

Request Body Example — Generate Image

{
"prompt": "A modern minimalist logo for a coffee shop",
"dimensions": {
"width": 1024,
"height": 1024
},
"bId": "b_s87vFxpfM0R",
"model": "z-image-turbo",
"negativePrompt": "blurry, low quality"
}

Request Body Example — Enhance Image

{
"prompt": "Make this logo more vibrant and professional",
"dimensions": {
"width": 1024,
"height": 1024
},
"bId": "b_s87vFxpfM0R",
"model": "nano-banana:1k",
"siviAssets": [
{ "mId": "w_abc123----photo_001.jpeg" }
],
"assets": {
"photo": [
{ "url": "https://example.com/reference.jpg" }
]
}
}

Request Parameters

ParameterTypeRequiredDescription
promptStringYesText prompt describing the desired image
dimensionsObjectYesOutput image dimensions
dimensions.widthNumberYesImage width (must be positive)
dimensions.heightNumberYesImage height (must be positive)
bIdStringYesBrand ID for style context
modelStringYesAI model to use for generation. See Supported Models for allowed values
siviAssetsArrayNoExisting Sivi media assets to enhance (max 4 total assets)
siviAssets[].mIdStringYesMedia ID of the Sivi asset
assetsObjectNoExternal URL-based assets grouped by type (max 4 total assets)
negativePromptStringNoElements to avoid in the generated image

Asset Limits

  • Maximum of 4 image assets total (combined siviAssets + assets)
  • When assets are provided, the API performs image enhancement instead of generation
  • Without assets, the API performs image generation from the prompt

Response

{
"status": 200,
"body": {
"requestId": "abc123xyz"
}
}

Response Body Parameters

ParameterTypeDescription
requestIdStringRequest ID — use with get-request-status to check results

Error Responses

Authentication Error (401 Unauthorized)

{
"status": 401,
"body": {
"message": "Failed to authenticate request. Please add sivi-api-key header in request"
}
}

Invalid Input (422 Unprocessable Entity)

{
"status": 422,
"body": {
"message": "Prompt is required and must be a string."
}
}

Model Not Supported (422 Unprocessable Entity)

{
"status": 422,
"body": {
"message": "Model 'invalid-model' is not supported."
}
}

Server Error (500 Internal Server Error)

{
"status": 500,
"body": {
"message": "Server internal error"
}
}

Usage Notes

  • Use the returned jId with get-request-status to poll for completion and retrieve the generated image
  • When providing assets, the operation becomes an enhancement — the AI modifies the provided images based on the prompt
  • Without assets, the operation is a pure generation from the text prompt
  • The model must support the requested operation type (generation or enhancement)
  • Dimensions must be supported by the selected model