Skip to content
Developers
API docs / Features

MAKEUGC PLATFORM API · DOCS V2

AI Script Writer

Create ad scripts from text descriptions or product images.

Workflow

  1. Choose text-only writing or product-image writing.
  2. Provide a description and the tone you want.
  3. Use the returned script with Talking Actors, Product in Hand or Text to Speech.
These operations return text synchronously. No additional credit charge is applied for this operation.
Send X-Api-Key on every MakeUGC request. POST operations require an active paid subscription and a positive credit balance; custom voice creation also requires a plan with custom voices.
Requests are strict JSON: unknown fields, user_id and webhook_url are rejected. Use polling for jobs; these endpoints do not send webhooks.
The outer status boolean indicates request success. Most jobs use data.status: processing, completed or failed; Upscale documents its own statuses. Poll every 5–10 seconds and require a non-empty result URL (or voice_id) before using output.
API credit units × 100 = website display credits. A timeout, network error or 5xx may occur after acceptance: do not automatically resubmit a paid operation. If submission_unknown is true, check the project or contact support with x-request-id; reserved credits remain held until the result is resolved.

Example IDs and media URLs are placeholders. Replace them with values from your account and accessible media files.

Write a script #

POST /scripts/generate

Create a spoken ad script and optional avatar suggestions from a product description and tone.

Request body

Parameter Description
description
string
Required
description input.

Allowed: At least 1 characters; Up to 500 characters

style
string
Required
style input.

Allowed: At least 1 characters; Up to 100 characters

max_character
integer
Optional
max character input.

Allowed: Minimum 1; Maximum 1500

Request example

cURL
curl --fail-with-body --max-time 120 -X POST "https://app.makeugc.ai/api/platform/scripts/generate" \
  -H "X-Api-Key: $MAKEUGC_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "description": "A lightweight ceramic travel cup that keeps coffee warm.",
  "style": "Friendly, conversational",
  "max_character": 800
}'
JavaScript
// Run on your server with Node.js 20+.
const apiKey = process.env.MAKEUGC_API_KEY;
if (!apiKey) throw new Error("Set MAKEUGC_API_KEY first");

const response = await fetch("https://app.makeugc.ai/api/platform/scripts/generate", {
  method: "POST",
  headers: {
    "X-Api-Key": apiKey,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "description": "A lightweight ceramic travel cup that keeps coffee warm.",
  "style": "Friendly, conversational",
  "max_character": 800
}),
  signal: AbortSignal.timeout(120000),
});
const text = await response.text();
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${text} (request ${response.headers.get("x-request-id")})`);
}
const result = JSON.parse(text);
console.log(result);
Python
# Install the requests package before running.
import os
import requests

payload = {
    "description": "A lightweight ceramic travel cup that keeps coffee warm.",
    "style": "Friendly, conversational",
    "max_character": 800
}

response = requests.post(
    "https://app.makeugc.ai/api/platform/scripts/generate",
    headers={"X-Api-Key": os.environ["MAKEUGC_API_KEY"]},
    json=payload,
    timeout=120,
)
if not response.ok:
    raise RuntimeError(f"HTTP {response.status_code}: {response.text} "
                       f"(request {response.headers.get('x-request-id')})")
print(response.json())

200 response example

JSON response
{
  "status": true,
  "data": {
    "script": "Meet your new everyday coffee companion.",
    "avatar_ids": [
      "avatar_123"
    ]
  }
}

All requests require X-Api-Key. See errors & retries for unsuccessful responses.

Write a script from product images #

POST /scripts/product

Use one or two product images with your description to write a product ad script.

Request body

Parameter Description
description
string
Required
description input.

Allowed: At least 1 characters; Up to 1000 characters

style
string
Required
style input.

Allowed: At least 1 characters; Up to 100 characters

image_url
string
Required
Public HTTP(S) media URL. Private addresses, credentials and data URIs are not accepted.
second_image_url
string
Optional
Public HTTP(S) media URL. Private addresses, credentials and data URIs are not accepted.

Request example

cURL
curl --fail-with-body --max-time 120 -X POST "https://app.makeugc.ai/api/platform/scripts/product" \
  -H "X-Api-Key: $MAKEUGC_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "description": "A ceramic travel cup",
  "style": "Enthusiastic product demo",
  "image_url": "https://your-cdn.example/product.jpg"
}'
JavaScript
// Run on your server with Node.js 20+.
const apiKey = process.env.MAKEUGC_API_KEY;
if (!apiKey) throw new Error("Set MAKEUGC_API_KEY first");

const response = await fetch("https://app.makeugc.ai/api/platform/scripts/product", {
  method: "POST",
  headers: {
    "X-Api-Key": apiKey,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "description": "A ceramic travel cup",
  "style": "Enthusiastic product demo",
  "image_url": "https://your-cdn.example/product.jpg"
}),
  signal: AbortSignal.timeout(120000),
});
const text = await response.text();
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${text} (request ${response.headers.get("x-request-id")})`);
}
const result = JSON.parse(text);
console.log(result);
Python
# Install the requests package before running.
import os
import requests

payload = {
    "description": "A ceramic travel cup",
    "style": "Enthusiastic product demo",
    "image_url": "https://your-cdn.example/product.jpg"
}

response = requests.post(
    "https://app.makeugc.ai/api/platform/scripts/product",
    headers={"X-Api-Key": os.environ["MAKEUGC_API_KEY"]},
    json=payload,
    timeout=120,
)
if not response.ok:
    raise RuntimeError(f"HTTP {response.status_code}: {response.text} "
                       f"(request {response.headers.get('x-request-id')})")
print(response.json())

200 response example

JSON response
{
  "status": true,
  "data": {
    "script": "This is the cup I take everywhere.",
    "avatar_ids": []
  }
}

All requests require X-Api-Key. See errors & retries for unsuccessful responses.