Introduction
Reference for Introduction.
Introduction
The sangtao.ai API lets you programmatically create AI-powered videos, voiceovers, and images. All endpoints follow REST conventions and return JSON responses.
Base URL
https://sangtao.ai/api/v2Quick Start — Hello World
Try your first API call — check your credit balance (zero risk, read-only):
curl https://sangtao.ai/api/v2/account/balance \
-H "X-Api-Key: YOUR_API_KEY"Response:
{
"success": true,
"data": {
"freeCredit": 50,
"purchasedCredit": 100,
"lockedCredit": 0,
"availableCredit": 150
}
}What you can build
The API covers the full video creation pipeline — from script to finished video:
You have images/videos + audio ready? Compose them into a polished video with layouts, effects, transitions, and captions.
/render/videoWrite a story or script, pick a voice — AI generates matching images and voiceover, then renders the final video.
/voiceover-videos/createSame as Voiceover Video, but uses real stock footage instead of AI images. Great for news-style or professional content.
/stock-videos/createHave a list of photos + a story? Turn them into a narrated slideshow video with AI voiceover and music.
/slideshow-videos/createPaste an article URL — AI crawls content, summarizes, finds visuals, generates voiceover, and renders a complete video.
/article-videos/createCommon use cases
• You have a list of photos and a story — create a slideshow video with AI voiceover and background music
• Your news site publishes articles — auto-convert each article into a narrated video for social media
• You have a script and want professional stock footage — generate a video with real-world visuals and AI voice
• You build a content creation tool — integrate our API so your users can generate videos without leaving your platform
• You have pre-made assets (images, audio files) — compose them into a finished video with transitions and effects
Response Format
All endpoints return a consistent JSON envelope:
// Success
{ "success": true, "data": { ... } }
// Error
{ "success": false, "error": "Error message" }HTTP Status Codes
| Code | Meaning | What to do |
|---|---|---|
| 200 | Success | Parse the data field |
| 400 | Validation error | Check the error message and fix your request |
| 401 | Unauthorized | Check your API key or refresh your token |
| 402 | Insufficient credits | Top up credits before retrying |
| 404 | Not found | Check the endpoint URL or resource ID |
| 429 | Rate limited | Wait and retry after the indicated period |
| 500 | Server error | Retry after a short delay. Contact support if persistent |
Rate Limits
| Limit | Value |
|---|---|
| Max concurrent jobs per user | 4 (shared across all endpoints) |
| Max article-video jobs system-wide | 30 |
| Polling interval (recommended) | 3–5 seconds |