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
stringError code
message
stringDetailed error message
output array
Query 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 containing the asset details. Parse it to obtain
Resultwith 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
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information