⌘K

Spark Asset Create Intl

spark_asset_create_intl

Create an international asset from a media URL and retrieve its ID for subsequent queries.

API Notes

spark_asset_create_intl creates a platform task through the unified generation API; model parameters belong in input[0].params

spark_asset_create_intl returns type: "text" content with a JSON-encoded text string; parse it to read Result

spark_asset_create_intl uses international asset resources; use the international models for subsequent operations and do not assume domestic and international IDs are interchangeable

spark_asset_create_intl requires the GroupId returned by group creation; after creating an asset, use spark_asset_get_intl to confirm readiness

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

Customer-facing model ID

Value: spark_asset_create_intl


input array required

Provide one object containing params; all parameters below belong in input[0].params


Name string required

Asset name

Maximum length: 64 characters


GroupId string required

Parse the task result from spark_asset_create_group_intl and use Result.Id


AssetType string required

Media type. The fully verified workflow uses Image; Video and Audio are protocol options without equivalent end-to-end verification

Options: Image, Video, Audio


URL string required

Accessible URL of the media to import, matching AssetType; replace the placeholder URL before calling


ProjectName string

Omit or use the default project; the subsequent query examples use the default project and do not establish a complete query flow for other projects

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.

A create response with status: "completed" only indicates that creation completed. Use the returned id to query the same platform task, and parse results when the task query returns completed with output

Task query statusAction
in_progressContinue querying the same task_id
completedParse the result’s text
failedRead error.code and error.message

Response Format

The success example on the right shows relevant fields only; actual results may include additional metadata. text remains a JSON-encoded string and must not be read as an already parsed object

FieldTypeDescription
idstringPlatform task ID used for task queries
output[].content[].typestringtext
output[].content[].textstringJSON-encoded string; parse to access Result
output[].content[].urlstringEmpty string, not an asset download URL
usage.coststringCost in USD, currently 0
errorobjectError details when a task fails
metadataobjectTask timing and other metadata, when returned

Parse the result

const content = task.output.flatMap(item => item.content ?? [])
  .find(item => item.type === "text");
const result = JSON.parse(content.text).Result;
const assetId = result.Id;

Pass the parsed Result.Id as Id when querying the asset. Completion means the asset was created, not that moderation finished or the asset is ready

Complete Workflow

Create group → Create asset → Query asset

Use a platform task_id to query its task, the group’s Result.Id as GroupId, and the asset’s Result.Id as the asset query’s Id; these identifiers are not interchangeable

Pricing

This asset model is currently free, with usage.cost: "0" in successful responses. Group creation, asset creation, and asset queries are all free; subsequent image or video generation has separate pricing

Error Handling

Read error.code and error.message for failed tasks. Check parameters, URL accessibility, and asset or group IDs; the wrapper does not guarantee the underlying API’s specific error code. Use the same international asset models throughout the default-project workflow