Skip to content

Create AI Generation Task

FreshPOST
POST https://api.creatify.ai/api/ai_generation/

Create a new AI generation task. The available models and their input parameters can be discovered via the schema endpoint.

Request Body

NameTypeRequiredDescription
modelstringYesModel ID from the schema endpoint
inputsobjectYesInput parameters matching the model's schema

Headers

HeaderTypeRequiredDescription
X-API-IDstringYesYour Creatify API ID
X-API-KEYstringYesYour Creatify API key
Content-TypestringYesapplication/json

Example Request

bash
curl -X POST 'https://api.creatify.ai/api/ai_generation/' \
  -H 'X-API-ID: your-api-id' \
  -H 'X-API-KEY: your-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "image-gen-v1",
    "inputs": {
      "prompt": "A sleek modern smartphone on a marble surface with soft studio lighting",
      "aspect_ratio": "1:1",
      "style": "photorealistic"
    }
  }'

Response

json
{
  "id": "gen-001",
  "status": "pending",
  "model": "image-gen-v1",
  "inputs": {
    "prompt": "A sleek modern smartphone on a marble surface with soft studio lighting",
    "aspect_ratio": "1:1",
    "style": "photorealistic"
  },
  "created_at": "2024-01-15T10:30:00Z"
}

Status Codes

CodeDescription
201Task created successfully
400Bad request -- invalid model or input parameters
401Unauthorized -- invalid API credentials
402Insufficient credits
429Rate limit exceeded
500Internal server error

TIP

Check the schema endpoint first to see available models and their required inputs. Different models have different parameter requirements.