Skip to main content
Create a World Labs media asset record and receive an upload URL for an image or video. Upload the binary file to upload_info.upload_url, then reference the returned media_asset.media_asset_id from world_prompt with source: "media_asset". TokenLab records the asset owner. Only the same organization can retrieve or use this media asset in world generation.

Request Body

file_name
string
required
Original file name, up to 64 characters.
kind
string
required
Media type: image or video.
extension
string
Optional extension such as png, jpg, or mp4.
metadata
object
Optional metadata object stored with the upstream media asset.

Response

media_asset
object
Prepared World Labs media asset metadata.
upload_info.upload_url
string
Signed upstream URL where the binary file should be uploaded.
curl -X POST "https://api.tokenlab.sh/v1/worlds/media-assets/prepare-upload" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "file_name": "reference.png",
    "kind": "image",
    "extension": "png"
  }'