⌘K

Spark Asset Create Group

spark_asset_create_group

Spark Asset Create Group is a SeaArt asset management API for creating asset groups to organize media files in the asset library.

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 string

Error code

message string

Detailed error message


output array

Asset group creation results, only present when status is completed

content array

List of result content

type string

Content type

Value: text

url string

Empty string for this API

text string

JSON-encoded string. Parse it to obtain Result.Id which contains the created asset group ID

Example: {"ResponseMetadata": {...}, "Result": {"Id": "group-20260414180602-52qww"}}


usage object

Usage statistics, only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information