Create AI Script
FreshPOSTPOST 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
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Conditional | Product URL to generate a script from. Required if title and description are not provided |
title | string | Conditional | Product title. Required if url is not provided |
description | string | Conditional | Product 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
| Header | Type | Required | Description |
|---|---|---|---|
X-API-ID | string | Yes | Your Creatify API ID |
X-API-KEY | string | Yes | Your Creatify API key |
Content-Type | string | Yes | application/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
| Code | Description |
|---|---|
201 | Task created successfully |
400 | Bad request -- must provide either url or title + description |
401 | Unauthorized -- invalid API credentials |
402 | Insufficient credits |
429 | Rate limit exceeded |
500 | Internal 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.