TikTok Video Maker
Generate talking videos programmatically using the LovelyBots API. This skill lets you queue a video from a script and source image, poll until it's ready, and return the final video URL.
Get your API key at: https://lovelybots.com/developer
API base URL for bots: https://api.lovelybots.com/api
What This Skill Does
- - Submits a video generation job (script + source image → queued video)
- Polls the job status until completed (or failed)
- Returns the final video URL
- Reports credits remaining after each request
- Accepts image as file upload, URL, or base64 (single
image field)
Setup
- 1. Create a LovelyBots account at https://lovelybots.com
- Activate a subscription plan (required for API video generation)
- Create an API token at https://lovelybots.com/developer
Set your LovelyBots API key as an environment variable:
CODEBLOCK0
Or add it to your openclaw.json:
CODEBLOCK1
Critical Tips for Agents
- 1. Use the API host for bot calls:
https://api.lovelybots.com/api. Do not use the web app host for API requests. - Always send
Authorization: Bearer $LOVELYBOTS_API_KEY on every API request. - Treat
video.id and voice_id as UUID strings. Never assume numeric IDs. - Poll
GET /api/videos/:id until terminal status (completed or failed) with timeout and retry guards. - If using image URLs, they must be public
http/https URLs. Localhost/private-network URLs are blocked. - Keep auth/user flows on
https://lovelybots.com (dashboard/login/docs), and keep automation calls on api.lovelybots.com. - On non-2xx API responses, surface the error and stop retrying blindly.
Example Prompts
- - "Generate a 30-second product ad video using my image at https://example.com/image.jpg with this script: Welcome to our summer sale..."
- "Make a video with the TikTok Video Maker — use image [url-or-base64-or-upload] and script: [text]"
- "Queue a video generation job and give me the download link when it's done"
- "Create a talking video for my TikTok ad using LovelyBots"
How to Generate a Video
Step 1 — Submit the job
Best quality input recommendation:
- - Use a clear, front-facing portrait image.
- Use
9:16 orientation (for example 1080x1920).
CODEBLOCK2
Response:
CODEBLOCK3
Step 2 — Poll for completion
CODEBLOCK4
Response when processing:
CODEBLOCK5
Agent Status Update (recommended)
When status is queued or processing, immediately report progress to the user (including share_url) before continuing to poll.
Template:
CODEBLOCK6
Response when complete:
CODEBLOCK7
Response if failed:
CODEBLOCK8
Step 3 — Return the video URL to the user
Once status is completed, return video_url to the user. The video is ready to download or share.
Polling Strategy
Poll every 5–10 seconds. Most videos complete within 60–120 seconds. If status is still processing after 5 minutes, surface an error to the user.
Suggested polling loop (bash):
CODEBLOCK9
Key Differentiators
- - Consistent identity output — stable presenter look across generated videos
- Failed renders are refunded — you only pay for successful videos
- Editable after generation — not locked output like HeyGen/Synthesia
- No credit burns on retries — reliable for automated pipelines
API Reference
| Method | Path | Description |
|---|
| POST | /api/create | Submit a video generation job |
| POST |
/api/videos | Alias for /api/create |
| GET | /api/videos/:id | Get job status and video URL |
| GET | /api/voices | List available voices (filter by gender/age) |
POST /api/create — Request Body
| Field | Type | Required | Description |
|---|
| script | string | ✓ | The spoken text for the video |
| image |
file or string | ✓ | Unified image input. Can be multipart file upload, http/https URL, or base64/data URL |
| public | boolean | | Whether the video appears in the public feed (default: true) |
| gender | string | |
male or
female — skips AI detection, speeds up response |
| age | string | |
young_adult,
adult,
mature,
middle_aged, or
older |
| action_prompt | string | | Optional action/performance guidance |
| camera_prompt | string | | Optional camera/framing guidance |
| voice_id | string (UUID) | | Specific voice ID from
GET /api/voices — skips AI detection and auto-selection entirely |
Image guidance:
- - Use front-facing portrait images for best lip-sync stability.
- Use
9:16 orientation (recommended 1080x1920). - If
image is a URL, it must be publicly reachable (localhost and private-network hosts are blocked).
GET /api/voices — Response
| Field | Type | Description |
|---|
| voices[].id | string (UUID) | Use as voice_id in create requests |
| voices[].name |
string | Voice display name |
| voices[].gender | string |
male or
female |
| voices[].age | string |
young_adult,
adult,
mature,
middle_aged, or
older |
GET /api/videos/:id — Response
| Field | Type | Description |
|---|
| id | string (UUID) | Job ID |
| status |
string | queued / processing / completed / failed |
| video_url | string | Download URL (only when completed) |
| share_url | string | Public shareable page URL (always present) |
| credits_remaining | integer | Videos remaining in your plan this month |
| error | string | Error message (only when failed) |
Troubleshooting
| Problem | Likely Cause | Fix |
|---|
| INLINECODE40 | Missing/incorrect Bearer token | Regenerate token at https://lovelybots.com/developer and send INLINECODE42 |
INLINECODE43 errors (Please select a plan, monthly limit, or IP not allowed) |
Plan/usage/IP restrictions | Ensure subscription is active, check monthly limit, and verify token IP allowlist settings |
|
404 Video not found | Wrong
video.id or token user mismatch | Use the UUID returned by create response, and poll using the same API token owner |
|
422 image is required or image URL errors | Missing image or blocked URL | Send
image as upload/URL/base64. If URL, it must be public
http/https (no localhost/private network) |
|
429 Rate limit exceeded | Too many requests | Increase polling interval, add jitter/backoff, retry later |
|
cf-mitigated: challenge header appears | Request sent to proxied host | Use
https://api.lovelybots.com/api/... (DNS-only API host), not
https://lovelybots.com/api/... |
| Poll loop times out | Long render time or transient API/network issue | Raise
MAX_WAIT_SECONDS, inspect API error payload, and retry with same
video.id |
Links
- - Get API key: https://lovelybots.com/developer
- API base URL: https://api.lovelybots.com/api
- Public feed: https://lovelybots.com/feed
- Full docs: https://lovelybots.com/openclaw
- Homepage: https://lovelybots.com
TikTok 视频制作器
通过 LovelyBots API 以编程方式生成口播视频。此技能允许您从脚本和源图像排队生成视频,轮询直到视频准备就绪,并返回最终视频 URL。
在此获取您的 API 密钥:https://lovelybots.com/developer
机器人 API 基础 URL:https://api.lovelybots.com/api
此技能的功能
- - 提交视频生成任务(脚本 + 源图像 → 排队生成视频)
- 轮询任务状态直至完成(或失败)
- 返回最终视频 URL
- 每次请求后报告剩余积分
- 接受文件上传、URL 或 base64 格式的图像(单个 image 字段)
设置
- 1. 在 https://lovelybots.com 创建 LovelyBots 账户
- 激活订阅计划(API 视频生成必需)
- 在 https://lovelybots.com/developer 创建 API 令牌
将您的 LovelyBots API 密钥设置为环境变量:
bash
export LOVELYBOTSAPIKEY=yourapikey_here
或将其添加到您的 openclaw.json:
json
{
skills: {
entries: {
tiktok-video-maker: {
env: {
LOVELYBOTSAPIKEY: yourapikey_here
}
}
}
}
}
给代理的关键提示
- 1. 使用 API 主机进行机器人调用:https://api.lovelybots.com/api。请勿使用 Web 应用主机进行 API 请求。
- 每次 API 请求始终发送 Authorization: Bearer $LOVELYBOTSAPIKEY。
- 将 video.id 和 voice_id 视为 UUID 字符串。切勿假定为数字 ID。
- 轮询 GET /api/videos/:id 直到终端状态(completed 或 failed),并设置超时和重试保护。
- 如果使用图像 URL,它们必须是公共的 http/https URL。本地主机/私有网络 URL 将被阻止。
- 将身份验证/用户流程保留在 https://lovelybots.com(仪表板/登录/文档),将自动化调用保留在 api.lovelybots.com。
- 对于非 2xx API 响应,显示错误并停止盲目重试。
示例提示
- - 使用我在 https://example.com/image.jpg 的图像生成一个 30 秒的产品广告视频,脚本为:欢迎来到我们的夏季促销...
- 使用 TikTok 视频制作器制作一个视频 — 使用图像 [url-or-base64-or-upload] 和脚本:[text]
- 排队生成一个视频任务,完成后给我下载链接
- 使用 LovelyBots 为我的 TikTok 广告创建一个口播视频
如何生成视频
第 1 步 — 提交任务
最佳质量输入建议:
- - 使用清晰、正面的肖像图像。
- 使用 9:16 方向(例如 1080x1920)。
bash
curl -X POST https://api.lovelybots.com/api/create \
-H Authorization: Bearer $LOVELYBOTSAPIKEY \
-H Content-Type: application/json \
-d {
script: 欢迎来到我们的夏季促销。使用代码 SAVE20 即可在本周享受全场 20% 折扣。,
image: https://example.com/your-image-1080x1920.jpg,
public: false,
action_prompt: 主体热情微笑并向镜头挥手。,
camera_prompt: 中近景,静态镜头,电影级灯光,4k。
}
响应:
json
{
id: b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde,
status: queued,
credits_remaining: 1,
share_url: https://lovelybots.com/videos/b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde/share/abc123token
}
第 2 步 — 轮询完成状态
bash
curl https://api.lovelybots.com/api/videos/$VIDEO_ID \
-H Authorization: Bearer $LOVELYBOTSAPIKEY
处理中的响应:
json
{
id: b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde,
status: processing,
credits_remaining: 9,
share_url: https://lovelybots.com/videos/b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde/share/abc123token
}
代理状态更新(推荐)
当 status 为 queued 或 processing 时,立即向用户报告进度(包括 share_url),然后再继续轮询。
模板:
text
状态更新:
任务 ID:
状态:
剩余积分:
分享 URL:
完成时的响应:
json
{
id: b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde,
status: completed,
video_url: https://lovelybots.com/videos/b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde.mp4,
share_url: https://lovelybots.com/videos/b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde/share/abc123token,
credits_remaining: 9
}
失败时的响应:
json
{
id: b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde,
status: failed,
error: 无法处理图像,
credits_remaining: 10,
share_url: https://lovelybots.com/videos/b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde/share/abc123token
}
第 3 步 — 向用户返回视频 URL
一旦状态为 completed,向用户返回 video_url。视频即可下载或分享。
轮询策略
每 5-10 秒轮询一次。大多数视频在 60-120 秒内完成。如果状态在 5 分钟后仍为 processing,则向用户显示错误。
建议的轮询循环(bash):
bash
VIDEO_ID=b6f9a32d-3c53-4a6c-9d8c-2f0f7a1b4cde
POLLINTERVALSECONDS=8
MAXWAITSECONDS=300
START_TS=$(date +%s)
HEADERS_FILE=$(mktemp)
trap rm -f $HEADERS_FILE EXIT
extractjsonfield() {
local key=$1
if command -v jq >/dev/null 2>&1; then
jq -r --arg key $key .[$key] // empty
return
fi
if command -v python3 >/dev/null 2>&1; then
python3 -c import json,sys; key=sys.argv[1]; data=json.load(sys.stdin); value=data.get(key, ); print( if value is None else value) $key
return
fi
echo 请安装 jq 或 python3 来解析此轮询循环中的 API 响应。 >&2
return 127
}
while true; do
NOW_TS=$(date +%s)
if [ $((NOWTS - STARTTS)) -ge $MAXWAITSECONDS ]; then
echo 等待视频完成超时(${MAXWAITSECONDS}s)。 >&2
break
fi
HTTP_RESPONSE=$(curl -sS --connect-timeout 10 --max-time 30 \
-D $HEADERS_FILE \
-w $\n%{httpcode} https://api.lovelybots.com/api/videos/$VIDEOID \
-H Authorization: Bearer $LOVELYBOTSAPIKEY)
CURL_EXIT=$?
if [ $CURL_EXIT -ne