Skip to main content

Content from Prompt

Generate content suggestions based on natural language prompts. This endpoint is useful for getting content and asset recommendations before generating designs.

API Endpoint

POST enterpise/content-from-prompt
GET enterpise/content-from-prompt

Authentication

Note: This API is available exclusively for users on the Enterprise plan and requires an Enterprise admin account API key.

This endpoint requires API key authentication. Include your API key in the request header:

sivi-api-key: YOUR_API_KEY

POST Request Body

{
"type": "displayAds",
"subtype": "displayAds-half-page-ad",
"dimension": { "width": 300, "height": 600 },
"prompt": "generate a design for my t-shirt shop for summer campaign with 20% off",
"language": "english"
}

GET Request Parameters

For GET requests, you can pass the same parameters as in the POST request using a JSON object in the queryParams parameter:

GET enterprise/content-from-prompt?queryParams={"type":"displayAds","subtype":"displayAds-half-page-ad","dimension":{"width":300,"height":600},"prompt":"generate a design for my t-shirt shop for summer campaign with 20% off","language":"english"}

The queryParams should be URL-encoded and contain a valid JSON object with all your request parameters.

POST Request Parameters

ParameterTypeRequiredDescription
promptstringYesNatural language description of the content you need suggestions for
typestringYesPrimary design type (e.g., displayAds, socialMedia). See Supported Types & Subtypes for all available options.
subtypestringYesSpecific format within the type (e.g., displayAds-half-page-ad)
dimensionobjectConditionalWidth and height in pixels (required if type and subtype is "custom")
languagestringNoLanguage for generated content (default: "english"). See Supported Languages for all available options.

Response

{
"contentSuggestions": [{
"title": "T-shirts for summer",
"offer": "Limited Time: Up to 20% Off",
"bulletlist": ["100% cotton", "Easy wash", "Double stitch"]
}],
"assetSuggestions": {
"images": [{
"url": "https://images.hellosivi.com/fit-in/800x800/photos/sKN0gtrFJn4.jpg"
}]
}
}

Examples

GET Example

curl -X GET "https://connect.sivi.ai/api/prod/v2/enterprise/content-from-prompt?queryParams=%7B%22type%22%3A%22displayAds%22%2C%22subtype%22%3A%22displayAds-half-page-ad%22%2C%22dimension%22%3A%7B%22width%22%3A300%2C%22height%22%3A600%7D%2C%22prompt%22%3A%22generate%20a%20design%20for%20my%20t-shirt%20shop%20for%20summer%20campaign%20with%2020%25%20off%22%2C%22language%22%3A%22english%22%7D" \
-H "sivi-api-key: YOUR_PUBLIC_API_KEY"

Note: The queryParams value above is the URL-encoded version of the full JSON object matching the POST request body

POST Example

curl -X POST "https://connect.sivi.ai/api/prod/v2/enterprise/content-from-prompt" \
-H "sivi-api-key: YOUR_PUBLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "displayAds",
"subtype": "displayAds-half-page-ad",
"prompt": "generate a design for my t-shirt shop for summer campaign with 20% off",
"language": "english"
}'

Using with Design Generation

The content suggestions from this endpoint can be directly used with the Designs from Content endpoint to create designs based on the suggested content. This two-step process allows for more control over the final design output by reviewing and potentially modifying the content before generating designs.