⌘K

Spark Asset Get

spark_asset_get

Spark Asset Get is a SeaArt asset management API for retrieving detailed information of a single asset by its ID.

API Notes

spark_asset_get requires an Id obtained from spark_asset_create. A Status of Active in the response confirms the asset is ready to use

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_get


Id string required

Asset ID to retrieve


ProjectName string

Project name

Default: default


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

Query 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 containing the asset details. Parse it to obtain Result with the following fields:

Id: Asset ID
Name: Asset name
URL: Signed download URL of the asset
AssetType: Media type (Image, Video, Audio)
GroupId: Asset group ID the asset belongs to
Status: Asset status
CreateTime: Creation time
UpdateTime: Last update time
ProjectName: Project name


usage object

Usage statistics, only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information