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_img_effects
image_input1 string required
Reference image URL
template_id string required
Template ID for style generation
Options:
felt_3d_polaroid: Felt 3D Polaroid Style
my_world: Pixel World Style
my_world_universal: Pixel World - Universal Version
plastic_bubble_figure: Plastic Bubble Figure
plastic_bubble_figure_cartoon_text: Plastic Bubble Figure - Cartoon Text Version
furry_dream_doll: Furry Dream Doll
micro_landscape_mini_world: Mini World Doll Style
micro_landscape_mini_world_professional: Micro Landscape Mini World - Professional Version
acrylic_ornaments: Acrylic Ornaments
felt_keychain: Felt Keychain
lofi_pixel_character_mini_card: Lofi Pixel Character Mini Card
angel_figurine: Angel Figurine
lying_in_fluffy_belly: Lying in Fluffy Belly
glass_ball: Glass Ball
earphone_case_style: Earphone Case Style
electronic_pet_egg_style: Electronic Pet Egg Style
patchwork_collage_style: Patchwork Collage Style
claw_machine_style: Claw Machine Style
car_miniature_ornaments: Car Miniature Ornaments
Mid-Autumn_Festival_new_chinese_style: Mid-Autumn Festival - New Chinese Style
Mid-Autumn_Festival_individual: Mid-Autumn Festival Individual
Christmas_green_background: Christmas Green Background
Christmas_tree: Christmas Tree
Spring_Festival_traditional_Chinese_architecture: Spring Festival Red Wall
birthday_photo_gorgeous: Birthday Photo Gorgeous
birthday_photo_red: Birthday Photo Red
birthday_photo_party: Birthday Photo Party
graduation_photo: Graduation Photo
spring_festival_traditional_architecture: Spring Festival Traditional Architecture
spring_festival_gradient_colors: Spring Festival Gradient Colors
width integer
Width of the output image
Range: 512-2048
Default: 1328
height integer
Height of the output image
Range: 512-2048
Default: 1328
Polling
Since image 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
Value:
imageurl
stringImage URL
size
integerImage size in bytes
jobId
stringRemote job ID
usage object
Usage statistics. Only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information
Error Codes
| Error Code | Description |
|---|---|
| 3009001 | Missing image_input1 |
| 3009002 | Missing template_id |
| 3009003 | Invalid template_id |
| 3009004 | Invalid size parameter |
| 3009095 | Internal generation error |
| 3009096 | Result parsing error |
| 3009097 | HTTP error response |
| 3009098 | Status check error |
| 3009099 | Service unavailable |