Generate Content
curl --request POST \
--url https://api.example.com/api/v1/process-text-async \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"format": "<string>",
"visualTemplate": "<string>",
"platform": "<string>",
"slideCount": 123,
"maxDuration": 123,
"customPrompt": "<string>",
"captionsEnabled": true,
"captionsStyle": "<string>",
"captionsPosition": "<string>",
"captionsFontSize": "<string>",
"visualStyleVariant": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/process-text-async"
payload = {
"text": "<string>",
"format": "<string>",
"visualTemplate": "<string>",
"platform": "<string>",
"slideCount": 123,
"maxDuration": 123,
"customPrompt": "<string>",
"captionsEnabled": True,
"captionsStyle": "<string>",
"captionsPosition": "<string>",
"captionsFontSize": "<string>",
"visualStyleVariant": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
format: '<string>',
visualTemplate: '<string>',
platform: '<string>',
slideCount: 123,
maxDuration: 123,
customPrompt: '<string>',
captionsEnabled: true,
captionsStyle: '<string>',
captionsPosition: '<string>',
captionsFontSize: '<string>',
visualStyleVariant: '<string>'
})
};
fetch('https://api.example.com/api/v1/process-text-async', 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://api.example.com/api/v1/process-text-async",
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([
'text' => '<string>',
'format' => '<string>',
'visualTemplate' => '<string>',
'platform' => '<string>',
'slideCount' => 123,
'maxDuration' => 123,
'customPrompt' => '<string>',
'captionsEnabled' => true,
'captionsStyle' => '<string>',
'captionsPosition' => '<string>',
'captionsFontSize' => '<string>',
'visualStyleVariant' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v1/process-text-async"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"format\": \"<string>\",\n \"visualTemplate\": \"<string>\",\n \"platform\": \"<string>\",\n \"slideCount\": 123,\n \"maxDuration\": 123,\n \"customPrompt\": \"<string>\",\n \"captionsEnabled\": true,\n \"captionsStyle\": \"<string>\",\n \"captionsPosition\": \"<string>\",\n \"captionsFontSize\": \"<string>\",\n \"visualStyleVariant\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/api/v1/process-text-async")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"format\": \"<string>\",\n \"visualTemplate\": \"<string>\",\n \"platform\": \"<string>\",\n \"slideCount\": 123,\n \"maxDuration\": 123,\n \"customPrompt\": \"<string>\",\n \"captionsEnabled\": true,\n \"captionsStyle\": \"<string>\",\n \"captionsPosition\": \"<string>\",\n \"captionsFontSize\": \"<string>\",\n \"visualStyleVariant\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/process-text-async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"format\": \"<string>\",\n \"visualTemplate\": \"<string>\",\n \"platform\": \"<string>\",\n \"slideCount\": 123,\n \"maxDuration\": 123,\n \"customPrompt\": \"<string>\",\n \"captionsEnabled\": true,\n \"captionsStyle\": \"<string>\",\n \"captionsPosition\": \"<string>\",\n \"captionsFontSize\": \"<string>\",\n \"visualStyleVariant\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "Invalid format. Must be: image, carousel, or reel"
}
{
"error": "No text provided"
}
{
"error": "Invalid API key"
}
API Reference
Generate Content
Create a content generation job from text input
POST
/
api
/
v1
/
process-text-async
Generate Content
curl --request POST \
--url https://api.example.com/api/v1/process-text-async \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"format": "<string>",
"visualTemplate": "<string>",
"platform": "<string>",
"slideCount": 123,
"maxDuration": 123,
"customPrompt": "<string>",
"captionsEnabled": true,
"captionsStyle": "<string>",
"captionsPosition": "<string>",
"captionsFontSize": "<string>",
"visualStyleVariant": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/process-text-async"
payload = {
"text": "<string>",
"format": "<string>",
"visualTemplate": "<string>",
"platform": "<string>",
"slideCount": 123,
"maxDuration": 123,
"customPrompt": "<string>",
"captionsEnabled": True,
"captionsStyle": "<string>",
"captionsPosition": "<string>",
"captionsFontSize": "<string>",
"visualStyleVariant": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
format: '<string>',
visualTemplate: '<string>',
platform: '<string>',
slideCount: 123,
maxDuration: 123,
customPrompt: '<string>',
captionsEnabled: true,
captionsStyle: '<string>',
captionsPosition: '<string>',
captionsFontSize: '<string>',
visualStyleVariant: '<string>'
})
};
fetch('https://api.example.com/api/v1/process-text-async', 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://api.example.com/api/v1/process-text-async",
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([
'text' => '<string>',
'format' => '<string>',
'visualTemplate' => '<string>',
'platform' => '<string>',
'slideCount' => 123,
'maxDuration' => 123,
'customPrompt' => '<string>',
'captionsEnabled' => true,
'captionsStyle' => '<string>',
'captionsPosition' => '<string>',
'captionsFontSize' => '<string>',
'visualStyleVariant' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v1/process-text-async"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"format\": \"<string>\",\n \"visualTemplate\": \"<string>\",\n \"platform\": \"<string>\",\n \"slideCount\": 123,\n \"maxDuration\": 123,\n \"customPrompt\": \"<string>\",\n \"captionsEnabled\": true,\n \"captionsStyle\": \"<string>\",\n \"captionsPosition\": \"<string>\",\n \"captionsFontSize\": \"<string>\",\n \"visualStyleVariant\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.example.com/api/v1/process-text-async")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"format\": \"<string>\",\n \"visualTemplate\": \"<string>\",\n \"platform\": \"<string>\",\n \"slideCount\": 123,\n \"maxDuration\": 123,\n \"customPrompt\": \"<string>\",\n \"captionsEnabled\": true,\n \"captionsStyle\": \"<string>\",\n \"captionsPosition\": \"<string>\",\n \"captionsFontSize\": \"<string>\",\n \"visualStyleVariant\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/process-text-async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"format\": \"<string>\",\n \"visualTemplate\": \"<string>\",\n \"platform\": \"<string>\",\n \"slideCount\": 123,\n \"maxDuration\": 123,\n \"customPrompt\": \"<string>\",\n \"captionsEnabled\": true,\n \"captionsStyle\": \"<string>\",\n \"captionsPosition\": \"<string>\",\n \"captionsFontSize\": \"<string>\",\n \"visualStyleVariant\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "Invalid format. Must be: image, carousel, or reel"
}
{
"error": "No text provided"
}
{
"error": "Invalid API key"
}
Endpoint
POST /api/v1/process-text-async
Authentication
Requires API key inx-api-key header.
Request Body
string
required
The text content to transform into social media content
string
required
Content format. Options:
image, carousel, reelstring
Visual style template. Options:
infographic, screenshot, meme, minimal, magazine, neon, news, autostring
Target platform. Options:
instagram, tiktok, youtube_shortsnumber
Number of slides for carousel format. Range: 1-5. Only applicable when
format is carouselnumber
Maximum video duration in seconds. Range: 15-180. Only applicable when
format is reelstring
Custom instructions for content generation
boolean
Enable captions for video reels. Only applicable when
format is reelstring
Caption style. Options:
modern, minimal. Requires captionsEnabled: truestring
Caption position. Options:
bottom, center. Requires captionsEnabled: truestring
Caption font size. Options:
small, medium, large. Requires captionsEnabled: truestring
Additional style variant for customization
Response
boolean
Indicates if the request was successful
string
Human-readable status message
object
Example Request
curl -X POST https://api.distylia.com/api/v1/process-text-async \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "5 essential tips for remote work success",
"format": "carousel",
"slideCount": 5,
"visualTemplate": "minimal",
"platform": "instagram"
}'
Example Response
{
"success": true,
"message": "Text processing job created successfully",
"data": {
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending"
}
}
Error Responses
{
"error": "Invalid format. Must be: image, carousel, or reel"
}
{
"error": "No text provided"
}
{
"error": "Invalid API key"
}
Notes
- Jobs are processed asynchronously. Use the returned
jobIdto check status and retrieve results - Processing time varies by format: images (~30s), carousels (~1-2min), reels (~2-5min)
- The
visualTemplateparameter is optional. If set toautoor omitted, the system will choose the best template