API Tips
Image Requirements
Image Format: Only supports JPG, JPEG, PNG formats. JPG format is recommended
Image File Size: Maximum 5 MB
Image Resolution: Minimum 600 * 800, maximum 4096 * 4096
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_style_template
req_key string required
Image stylization style key. Different styles use different req_key values
Options:
img2img_ghibli_style_usage: Influencer Anime Style
img2img_real_mix_style_usage: Realistic Style
img2img_makoto_style_usage: Angel Style
img2img_cartoon_style_usage: Anime Style
img2img_rev_animated_style_usage: Princess Style
img2img_blueline_style_usage: Dreamy Style
img2img_water_ink_style_usage: Ink Wash Style
i2i_ai_create_monet_usage: New Monet Garden
img2img_water_paint_style_usage: Watercolor Style
img2img_comic_style_usage: Monet Garden / Exquisite Marvel / Cyber Mechanical (use with sub_req_key)
img2img_exquisite_style_usage: Exquisite Korean Comic
img2img_pretty_style_usage: Chinese Ink Style / Romantic Light (use with sub_req_key)
img2img_ceramics_style_usage: Ceramic Doll
img2img_chinese_style_usage: Chinese Red
img2img_clay_style_usage: Cute Clay / Cute Doll (use with sub_req_key)
img2img_3d_style_usage: 3D Game Z-Era / Animation Movie / Doll (use with sub_req_key)
sub_req_key string
Sub-style key. Must match the selected req_key. Some styles require this parameter, some do not
Options:
img2img_comic_style_monet: Monet Garden
img2img_comic_style_marvel: Exquisite Marvel
img2img_comic_style_future: Cyber Mechanical
img2img_pretty_style_ink: Chinese Ink Style
img2img_pretty_style_light: Romantic Light
img2img_clay_style_3d: Cute Clay
img2img_clay_style_bubble: Cute Doll
img2img_3d_style_era: 3D Game Z-Era
img2img_3d_style_movie: Animation Movie
img2img_3d_style_doll: Doll
image_urls array required (one of two)
Image URL array. Only supports 1 image
Either image_urls or binary_data_base64 must be provided (one of two)
binary_data_base64 array required (one of two)
Base64 encoded image array. Only supports 1 image
Either image_urls or binary_data_base64 must be provided (one of two)
return_url boolean
Whether to return image URL (URL valid for 24 hours)
logo_info object
Watermark information
add_logo
booleanWhether to add watermark.
trueto add,falseto not addDefault:
false
position
integerWatermark position
0: Bottom right
1: Bottom left
2: Top left
3: Top rightOptions:
0,1,2,3Default:
0
language
integerWatermark language
0: Chinese (AI生成)
1: English (Generated by AI)Options:
0,1Default:
0
opacity
numberWatermark opacity.
1means completely opaqueRange:
0-1Default:
1
logo_text_content
stringCustom watermark text content
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 |
|---|---|
| 003008001 | Missing req_key |
| 003008002 | Invalid req_key |
| 003008003 | Invalid sub_req_key |
| 003008004 | Missing image |
| 003008005 | Invalid image count |
| 003008095 | Internal generation error |
| 003008096 | Result parsing error |
| 003008097 | HTTP error response |
| 003008098 | Status check error |
| 003008099 | Task creation error / Service unavailable |