XRToken API Docs

Create asset

API Configuration
After saving, the Try It panel below sends real requests with this key.
Base: api.xrtoken.ai

Add an asset to a specified asset group. Asset files are referenced via URL and support image, video, and audio types.

After creation, the asset status is Processing. Once processing completes, it changes to Active. Poll asset status via GET /v1/assets/{assetId}.

After successful creation, assets can be referenced in video generation and other endpoints using the asset://<ASSET_ID> format.

File size limits:

TypeFormatsMax Size
ImageJPEG, PNG, WebP, GIF, BMP, TIFF, HEIC, HEIF30 MB
VideoMP4, MOV50 MB
AudioWAV, MP315 MB

Image Asset Upload Guidelines

Per-image requirements:

  • Formats: JPEG, PNG, WebP, BMP, TIFF, GIF, HEIC / HEIF
  • Aspect ratio (width/height): (0.4, 2.5)
  • Width/height pixels: (300, 6000)
  • Size: under 30 MB per image

Multi-asset group recommendations: To ensure generated video preserves facial features and clothing details consistent with uploaded assets, it is recommended to upload multiple images of the same person into the same asset group following these guidelines:

Face close-up

  • Purpose: Upload a facial close-up to ensure the generated video face matches the asset
  • Orientation: Portrait, face occupying approximately 2/3 of the frame
  • Content: Front-facing, neutral expression close-up, shoulders and above

Clothing detail

  • Purpose: Upload three-view images (front / side / back) of the same person to ensure clothing details match
  • Orientation: Landscape, three views arranged side by side
POST
/v1/assets

Authorization

BearerAuth
AuthorizationBearer <token>

API key authentication (OpenAI format). Pass in the Authorization header:

Authorization: Bearer tr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X post "https://api.xrtoken.ai/v1/assets" \  -H "Content-Type: application/json" \  -d '{    "group_id": "group-xxxxxxxxxxxx",    "url": "https://example.com/image.png",    "asset_type": "Image"  }'
{
  "Id": "string",
  "Name": "string",
  "AssetType": "Image",
  "Status": "Active",
  "GroupId": "string",
  "URL": "string",
  "CreateTime": "string",
  "UpdateTime": "string",
  "Error": {
    "Code": "string",
    "Message": "string"
  }
}
{
  "error": "model field is required",
  "type": "invalid_request_error"
}
{
  "error": "invalid or missing API key",
  "type": "auth_error"
}
{
  "error": "string",
  "type": "invalid_request_error"
}
{
  "error": "rate limit exceeded",
  "type": "rate_limit_error"
}
{
  "error": "upstream provider error",
  "type": "server_error"
}