API Notes
spark_asset_create_group must be called before spark_asset_create. The GroupId returned by this API is a required parameter for spark_asset_create
spark_asset_create_group only supports GroupType value AIGC
ProjectName must match an existing project. Passing a non-existent project name will result in error NotFound.ProjectName. Omit this parameter to use the default project
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_asset_create_group
Name string required
Custom asset group name
Max length: 64 characters
GroupType string required
The type of the asset group
Value: AIGC (Digital characters, currently the only supported type)
ProjectName string
Project name. If the project does not exist, the API will return error code NotFound.ProjectName.
Default: default (Recommended to omit this parameter to use the default project)
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
Response Format
error object
Error information, only present when status is failed
code
stringError code
message
stringDetailed error message
output array
Asset group creation results, only present when status is completed
content
arrayList of result content
type
stringContent type
Value:
texturl
stringEmpty string for this API
text
stringJSON-encoded string. Parse it to obtain
Result.Idwhich contains the created asset group IDExample:
{"ResponseMetadata": {...}, "Result": {"Id": "group-20260414180602-52qww"}}
usage object
Usage statistics, only present when status is completed
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information