AI Dance Generator API: Generate Dance Videos Programmatically

Mar 9, 2026

The AI Dance Generator public API lets you generate dance videos programmatically — from your own apps, automation scripts, or workflows. Upload a character image, provide a reference dance video (or a TikTok link), and our AI dance video generator handles the rest.

Whether you're building a content creation pipeline, integrating AI video generation into your product, or automating social media workflows, the Dance Generator REST API gives you full control over the dance video creation process.

This guide covers authentication, all available endpoints, request/response examples, and best practices for integrating the AI dance generator API into your project.

Getting Started with the Dance Generator API

1. Create an API Key

Log in to your Dance Generator account and navigate to Settings → API Keys. Click Create to generate a new key.

Your key will look like sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Copy it immediately — it's only shown once.

2. Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer sk-your-api-key-here

3. Base URL

https://dancegenerator.ai/api/v1

All endpoints are prefixed with /api/v1.


AI Dance Generator API Endpoints

Check Credits

Check your current credit balance before generating AI dance videos.

GET /api/v1/credits

Example:

curl https://dancegenerator.ai/api/v1/credits \
  -H "Authorization: Bearer sk-your-api-key"

Response:

{
  "remaining_credits": 500,
  "cost_reference": {
    "per_second": 7,
    "example_10s_video": 70
  }
}

Cost is calculated as video_duration_in_seconds × 7 credits.


Upload a Character Image

Upload the character image that will be animated in the dance video.

POST /api/v1/upload/image
  • Format: multipart/form-data
  • Allowed types: JPG, PNG, WebP
  • Max size: 10 MB

Example:

curl https://dancegenerator.ai/api/v1/upload/image \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "file=@/path/to/character.jpg"

Response:

{
  "url": "https://file.dancegenerator.ai/abc123.jpg",
  "filename": "character.jpg",
  "size": 1024000
}

Save the url — you'll need it for the generate request.


Upload a Reference Video (Optional)

If you have a local dance video to use as reference, upload it first.

POST /api/v1/upload/video
  • Format: multipart/form-data
  • Allowed types: MP4, MOV
  • Max size: 100 MB

Example:

curl https://dancegenerator.ai/api/v1/upload/video \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "file=@/path/to/dance.mp4"

Response:

{
  "url": "https://file.dancegenerator.ai/videos/def456.mp4",
  "filename": "dance.mp4",
  "size": 5120000
}

Generate an AI Dance Video

This is the core endpoint of the AI dance generator API. Submit a character image and a reference dance video (or a TikTok URL) to generate a dance video using AI.

POST /api/v1/generate

Request body (JSON):

FieldTypeRequiredDescription
character_image_urlstringYesURL of the character image (from upload endpoint)
reference_video_urlstringEither this or tiktok_urlURL of the reference dance video
tiktok_urlstringEither this or reference_video_urlTikTok video link to use as dance reference
promptstringNoText prompt for generation (max 2500 chars)
character_orientationstringNo"image" (default, max 10s) or "video" (max 30s)
keep_original_soundbooleanNoKeep reference video's audio (default: true)

Example with uploaded video:

curl https://dancegenerator.ai/api/v1/generate \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "character_image_url": "https://file.dancegenerator.ai/abc123.jpg",
    "reference_video_url": "https://file.dancegenerator.ai/videos/def456.mp4",
    "prompt": "Make the character dance energetically",
    "character_orientation": "image"
  }'

Example with TikTok URL:

curl https://dancegenerator.ai/api/v1/generate \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "character_image_url": "https://file.dancegenerator.ai/abc123.jpg",
    "tiktok_url": "https://www.tiktok.com/@user/video/1234567890",
    "character_orientation": "image"
  }'

Response (201):

{
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending",
  "cost_credits": 70,
  "remaining_credits": 430,
  "estimated_duration_seconds": 180,
  "created_at": "2026-03-09T10:00:00.000Z"
}

The AI dance video generation typically takes 2-3 minutes. Use the task ID to poll for results.


Check Task Status

Poll this endpoint to check if your video is ready.

GET /api/v1/tasks/:taskId

Example:

curl https://dancegenerator.ai/api/v1/tasks/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer sk-your-api-key"

Response (in progress):

{
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "processing",
  "progress": 50,
  "result": null,
  "cost_credits": 70,
  "created_at": "2026-03-09T10:00:00.000Z",
  "completed_at": null,
  "error": null
}

Response (completed):

{
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "success",
  "progress": 100,
  "result": {
    "video_url": "https://..."
  },
  "cost_credits": 70,
  "created_at": "2026-03-09T10:00:00.000Z",
  "completed_at": "2026-03-09T10:03:22.000Z",
  "error": null
}

Status values:

StatusDescription
pendingQueued for processing
processingVideo is being generated
successDone — result.video_url contains the video
failedGeneration failed — credits are automatically refunded

List Tasks

Retrieve your task history with pagination and optional status filtering.

GET /api/v1/tasks

Query parameters:

ParameterTypeDefaultDescription
statusstringFilter by status: pending, processing, success, failed
pagenumber1Page number
limitnumber20Results per page (max 100)

Example:

curl "https://dancegenerator.ai/api/v1/tasks?status=success&page=1&limit=10" \
  -H "Authorization: Bearer sk-your-api-key"

Response:

{
  "tasks": [
    {
      "task_id": "550e8400-e29b-41d4-a716-446655440000",
      "status": "success",
      "cost_credits": 70,
      "created_at": "2026-03-09T10:00:00.000Z",
      "completed_at": "2026-03-09T10:03:22.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 42
  }
}

Complete AI Dance Video Generation Workflow

Here's a full workflow showing how to generate a dance video via the API from start to finish using curl:

# Step 1: Upload your character image
curl https://dancegenerator.ai/api/v1/upload/image \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "[email protected]"
# → Note the "url" from the response

# Step 2: Generate a dance video using a TikTok reference
curl https://dancegenerator.ai/api/v1/generate \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "character_image_url": "YOUR_UPLOADED_IMAGE_URL",
    "tiktok_url": "https://www.tiktok.com/@dancer/video/1234567890"
  }'
# → Note the "task_id" from the response

# Step 3: Poll for results (repeat until status is "success" or "failed")
curl https://dancegenerator.ai/api/v1/tasks/YOUR_TASK_ID \
  -H "Authorization: Bearer sk-your-api-key"
# → When status is "success", download the video from result.video_url

API Error Handling

All Dance Generator API errors follow a consistent JSON format:

{
  "error": "error_code",
  "message": "Human-readable description",
  "details": {}
}

Common error codes:

HTTP StatusError CodeDescription
401invalid_api_keyAPI key is missing, invalid, or deleted
402insufficient_creditsNot enough credits — top up your account
404task_not_foundTask doesn't exist or belongs to another user
413file_too_largeUpload exceeds size limit
415unsupported_media_typeFile format not supported
422validation_errorInvalid request parameters
500internal_errorServer error — try again later
502provider_errorAI provider temporarily unavailable

Tips for Using the AI Dance Generator API

  • Polling interval: We recommend polling the task status every 5-10 seconds. Most AI dance videos complete within 2-3 minutes.
  • Credits refund: If a dance video generation task fails, credits are automatically refunded to your account.
  • TikTok integration: You can pass a TikTok URL directly as a dance reference — the API handles downloading and processing the video for you.
  • File deduplication: Uploading the same file twice returns the same URL without consuming extra storage.
  • CORS enabled: All API endpoints support cross-origin requests, so you can call the dance generator API from browser-based applications.

FAQ

What is the AI Dance Generator API?

The AI Dance Generator API is a RESTful public API that lets developers programmatically generate dance videos. You provide a character image and a reference dance video, and our AI creates a realistic dance animation of your character performing the dance moves.

What video formats does the dance generator API support?

The API accepts MP4 and MOV files for reference videos, and JPG, PNG, and WebP for character images. You can also pass a TikTok URL directly instead of uploading a video file.

How much does it cost to generate a dance video via API?

The AI dance generator uses a credit-based pricing model. Each second of generated video costs 7 credits. For example, a 10-second dance video costs 70 credits. If generation fails, credits are automatically refunded.

Can I use the dance generator API in my own application?

Yes. The Dance Generator public API is designed for integration. All endpoints support CORS, so you can call them from web apps, mobile backends, automation scripts, or any HTTP client.


Ready to start building with the AI dance generator API? Head to Settings → API Keys to create your first key.

Thomas

Thomas