Skip to main content

Quick Example

Generate a single image from text in three simple steps:

Step 1: Generate Content

Submit a content generation job:
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": "10 tips for better productivity",
    "format": "image",
    "visualTemplate": "infographic"
  }'
Response:
{
  "success": true,
  "message": "Text processing job created successfully",
  "data": {
    "jobId": "abc123",
    "status": "pending"
  }
}

Step 2: Check Status

Poll the job status:
curl https://api.distylia.com/api/job-status/abc123
Response:
{
  "success": true,
  "data": {
    "id": "abc123",
    "status": "completed",
    "progress": 100
  }
}

Step 3: Get Results

Retrieve the generated content:
curl https://api.distylia.com/api/job-result/abc123
Response includes the content URLs, caption, hashtags, and metadata.

Next Steps