Skip to content

Create AI Script

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

Generate an AI-written video script. Provide either a URL (Creatify will extract product info) or a title and description for the script to be based on.

Credit Cost

1 credit per request

Request Body

NameTypeRequiredDescription
urlstringConditionalProduct URL to generate a script from. Required if title and description are not provided
titlestringConditionalProduct title. Required if url is not provided
descriptionstringConditionalProduct description. Required if url is not provided

TIP

You must provide either url OR both title and description. If you provide all three, the title and description will take precedence over URL extraction.

Headers

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

Example Request (from URL)

bash
curl -X POST 'https://api.creatify.ai/api/ai_scripts/' \
  -H 'X-API-ID: your-api-id' \
  -H 'X-API-KEY: your-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com/product"
  }'

Example Request (from title and description)

bash
curl -X POST 'https://api.creatify.ai/api/ai_scripts/' \
  -H 'X-API-ID: your-api-id' \
  -H 'X-API-KEY: your-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Smart Home Hub",
    "description": "An all-in-one smart home controller that connects all your devices. Voice-controlled, energy-efficient, and easy to set up."
  }'

Response

json
{
  "id": "script-001",
  "status": "pending",
  "created_at": "2024-01-15T10:30:00Z"
}

When processing completes:

json
{
  "id": "script-001",
  "status": "done",
  "script": "Are you tired of juggling multiple apps to control your smart home? Introducing the Smart Home Hub...",
  "created_at": "2024-01-15T10:30:00Z"
}

Status Codes

CodeDescription
201Task created successfully
400Bad request -- must provide either url or title + description
401Unauthorized -- invalid API credentials
402Insufficient credits
429Rate limit exceeded
500Internal server error

TIP

Use AI Scripts to generate the text content, then pass the script to the AI Avatar or URL-to-Video endpoints for video creation.