API Reference

API Documentation

Integrate sangtao.ai into your application via REST API.

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/v2

Quick Start — Hello World

Try your first API call — check your credit balance (zero risk, read-only):

bash
curl https://sangtao.ai/api/v2/account/balance \
  -H "X-Api-Key: YOUR_API_KEY"

Response:

json
{
  "success": true,
  "data": {
    "freeCredit": 50,
    "purchasedCredit": 100,
    "lockedCredit": 0,
    "availableCredit": 150
  }
}
Tip: Get your API key from Settings → API Key in your sangtao.ai dashboard.

What you can build

The API covers the full video creation pipeline — from script to finished video:

Render VideoPOST

You have images/videos + audio ready? Compose them into a polished video with layouts, effects, transitions, and captions.

/render/video
Voiceover VideoPOST

Write a story or script, pick a voice — AI generates matching images and voiceover, then renders the final video.

/voiceover-videos/create
Stock VideoPOST

Same as Voiceover Video, but uses real stock footage instead of AI images. Great for news-style or professional content.

/stock-videos/create
Slideshow VideoPOST

Have a list of photos + a story? Turn them into a narrated slideshow video with AI voiceover and music.

/slideshow-videos/create
Article to VideoPOST

Paste an article URL — AI crawls content, summarizes, finds visuals, generates voiceover, and renders a complete video.

/article-videos/create

Common 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:

JSON
// Success
{ "success": true, "data": { ... } }

// Error
{ "success": false, "error": "Error message" }

HTTP Status Codes

CodeMeaningWhat to do
200SuccessParse the data field
400Validation errorCheck the error message and fix your request
401UnauthorizedCheck your API key or refresh your token
402Insufficient creditsTop up credits before retrying
404Not foundCheck the endpoint URL or resource ID
429Rate limitedWait and retry after the indicated period
500Server errorRetry after a short delay. Contact support if persistent

Rate Limits

LimitValue
Max concurrent jobs per user4 (shared across all endpoints)
Max article-video jobs system-wide30
Polling interval (recommended)3–5 seconds