API Tips
Image and Audio Requirements
Image formats: JPG (JPEG), PNG, JFIF and other common formats (JPG format recommended)
Image requirements: Less than 5 MB, less than 4096×4096
Input image: Input image should contain a single person with a large face proportion and frontal view for best results. Other types of images may produce poor results
Audio duration: Recommended less than 15 seconds to ensure generation quality. Audio that is too long may cause quality degradation
Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key.
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Value: spark_avatar_picture_omni_v2
image_url string required
Input image URL
audio_url string required
Audio URL for digital human animation
Polling
Since video generation takes time, you need to poll the task status after creation
The initial response returns the task ID and initial status. The actual generation results must be obtained through polling the task status endpoint
Response Format
error object
Error information. Only present when status is failed
code
stringError code
error_message
stringDetailed error message
output array
Generation results. Only present when status is completed
content
arrayList of generated content
type
stringResource type
url
stringContent URL
size
integerFile size
jobId
stringRemote job ID
usage object
Usage statistics. Only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
input_tokens
integerNumber of input tokens (fixed at 0)
output_tokens
integerNumber of output tokens (fixed at 0)
total_tokens
integerTotal number of tokens (actual comfyui_cost)
generated_videos
integerNumber of generated videos
generated_images
integerNumber of generated images
metadata object
Metadata information
Error Codes
| Error Code | Description |
|---|---|
| 003016001 | Image URL missing |
| 003016002 | Audio URL missing |
| 003016095 | Internal generation error |
| 003016096 | Result parsing error |
| 003016097 | HTTP error response |
| 003016098 | Status check error |
| 003016099 | Task creation error |