JoyPix

Get Started With API

Introduction

The JoyPix API allows you to programmatically generate lip-sync videos using our Motion-2 models. This guide will walk you through the basic usage flow and response codes.

Usage Flow

Step 1: Get API Key

Go to the /app/profile page to obtain your JoyPix API Key.

Step 2: Submit Task

Submit a generation task, for example.

POST /v1/lip-sync/motion-2

Header:

Content-Type: application/jsonAuthorization: Bearer ${JoyPix_API_KEY}

Body:

{
  "audio_url": "https://example.com/audio.mp3",
  "image_url": "https://example.com/image.jpg",
  "resolution": "720p",
  "prompt": "the man speak happily",
  "seed": -1
}

Response:

{
  "code": 0,
  "message": "success",
  "data": {
    "task_id": "task_123456789"
    "status": "submitted"
  }
}

Step 3: Get Task Result

GET /v1/tasks/${task_id}

Header:

Authorization: Bearer ${JoyPix_API_KEY}

Response:

{
    "code": 0,    // int, 200 for success, 4xx, client error, 5xx, server error
    "message": "success", // string, eg.success
    "data": {
        "task_id": "task_123456",         // string, task id
        "inputs": "...",          // string, input params
        "model": "motion-2",           // string, model id
        "status":  "completed",             // string, task status, submitted, processing, completed, failed
        "error": "",      // string, fail reason, when status=failed
        "video_url": "https://joypix-output.s3.amazonaws.com/...",        // string, video url , when status=completed
    }
}

API Reference

ItemValue
Base URLhttps://openapi.joypix.ai
Auth HeaderAuthorization: Bearer ${JoyPix_API_KEY}
Content Typeapplication/json

Result Data Struct

{
    "code": 0,
    "msg": "xxx",
    "data": {
       "task_id": "task_id_123456",
       "key": "val"
    }
}

Task Status

StatusDescription
submittedTask is queued
processingTask is running
completedTask finished successfully
failedTask failed (check error field)

Error Codes

CodeDescription
200Success
4xxClient Error
5xxxServer Error

Note

  1. Generated data is currently stored for 72 hours. Please download it as soon as possible.
  2. Failed tasks will have their consumed credits refunded. (If you encounter any unexpected issues, please contact us at openapi@joypix.ai)
  3. API generation records are retained for 1 month. If you have any questions, please provide feedback within this period.