PiAPI
HomeWorkspace
HomeWorkspace
Join Discord
  1. Seedance
  • Get Started
    • Overview
    • Quickstart
    • Make Instruction: How to Use PiAPI to Build a Workflow on Make?
  • Endpoints
    • Flux
      • Flux with LoRA and Controlnet
      • Available LoRA and Controlnet
      • Flux API with Redux Variation, Fill, Inpaint and Outpaint
      • Create Task
        • Text to Image
        • Image to Image
        • Kontext
      • Get task
    • Gemini
      • Gemini-2.5-flash-image
      • Nano Banana Pro
      • Nano Banana 2
      • Get task
    • Qwen Image
      • Text to Image
      • Image Edit
      • Get task
    • Z-Image
      • Text to Image
      • Get task
    • Seedream
      • Seedream 5 Lite
      • Get Task
    • Faceswap
      • Multi Faceswap
      • Image Faceswap
      • Video Faceswap
      • Get Task
    • Kling
      • Lipsync With PiAPI Kling API Examples
      • Motion Brush With PiAPI Kling API Example
      • Kling Elements Video Generation API
      • Kling Effects Video Generation
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
      • Create Task
      • Kling Virtual Try-On
      • Kling Effects
      • Kling Sound
      • Kling Avatar
      • Kling Motion Control
      • Kling Turbo
      • Kling 3.0
    • Kling omni
      • Kling o1
      • Kling 3.0 omni
      • Get Task
    • Omni Human
      • OmniHuman 1.5
      • Get task
    • Seedance
      • Less-Restriction Models Guide
      • Private Asset Library
      • Seedance 2
        POST
      • Video Watermark Remover
        POST
      • Get task
        GET
    • Veo3
      • Veo3 Text to Video
      • Veo3 Image to Video
      • Veo3.1 Text to Video
      • Veo3.1 Image to Video
      • Get task
    • Sora2
      • Sora2-preview Text to Video
      • Sora2 Text to Video
      • Sora2-Pro Text to Video
      • Sora2 Remove Watermark
      • Get task
    • WanX
      • Generate WanX Task with LoRA Using PiAPI
      • Available LoRA Types for Wanx
      • Use Cases for Wanx LoRA
      • Use Cases for Wanx Control Camera
      • Create Task
      • Get Task
    • Wan
      • Wan2.6 Text to Video
      • Wan2.6 Image to Video
      • Get task
    • Hailuo
      • Generate Video
      • Get Task
    • Skyreels
      • Create Task
      • Get Task
    • Framepack
      • Create Task
      • Get Task
    • Hunyuan Video
      • How to Make a Hunyuan API Call
      • Available Hunyuan Lora models
      • Get Task
      • Generate Video
    • Luma Dream Machine
      • Create Task
      • Get Task
    • LLM
      • How To Avoid Timeouts in Completion API
      • LLM API | Basic Completions
    • Suno(service stopped)
      • Music(service stopped)
      • Lyrics(service stopped)
      • Get task
    • Song(Udio)
      • Song API Task Creation Examples
      • [Udio] Song Extend
      • Get Task
      • Create Task
      • [Udio] Generate Lyrics
    • Mmaudio
      • Get Task
      • Generate Audio
    • DiffRhythm
      • Generate Audio
      • Get Task
    • Ace Step
      • Create Task
        • Text to Audio
        • Audio to Audio
        • Audio Edit
        • Audio Extend
      • Get Task
    • TTS
      • Zeroshot Text-to-Speech F5-TTS
      • Get Task
    • Trellis
      • Trellis Create Task
      • Trellis2 Create Task
      • Get Task
    • Joycaption
      • Image Caption
      • Get Task
    • Midjourney
      • PiAPI Penalties on Midjourney Usage
      • Detailed Explaination on Midjourney Task Result
      • Midjourney V7 API Instructions
      • Create Task
        • Imagine
        • Upscale
        • Variation
        • Reroll
        • Describe
        • Seed
        • Blend
        • Inpaint
        • Outpaint
        • Pan
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
    • AI Hug
      • Get Task
      • Create Task
    • Tools
      • File Upload API
      • Remove Background API
      • Remove Background-Get Task
      • Segment With Prompt API
      • Segment With Prompt API-Get Task
      • Image Upscale(Super Resolution) API
      • Image Upscale-Get Task
      • Video Upscale
      • Video Upscale-Get Task
      • Video Remove Background
      • Video Remove Background-Get task
    • PiAPI Account Management
      • PiAPI Account Info
      • Task List Info
      • User Task History
    • GPT image
      • GPT-image API
    • Claude Code
      • Claude Code Usage Guide
  • Resources
    • Change Log
    • Output Storage
    • Unified API Schema
    • Webhook
    • Bulk Generation Service
    • Billings
    • PiAPI MCP Server
    • Workspace Manual
      • Host-your-account (HYA) | Back-up Account
      • Host-your-account (HYA) | Debug Checklist
      • Host-your-account (HYA) | Connected Account Status
    • Announcements
      • PiAPI 2025 January 1st Pricing Update
      • The discontinued support for midjourney
      • Sunsetting Suno
  • Schemas
    • Schemas
      • motion brush
      • Create Task
      • camera control
      • Cancel Params
      • Float2 Point
      • Control Points
      • txt2video-1.3b
      • txt2video-14b
      • txt2video-14b-lora
      • img2video-14b
      • img2video-14b-lora
      • img2video-14b-keyframe
      • img2video-14b-control-camera
      • wan22-txt2video-14b
      • wan22-img2video-14b
      • hunyuan-txt2video-lora
      • Trellis API/text-to-3D
      • Trellis API/image-to-3D
      • Trellis2 API/image-to-3D
      • Kling omni multi shot
      • VideoGenerationRequest
      • TaskRequest
      • VideoGenerationResponse
      • TaskConfig
      • TaskInput
      • TaskResponse
      • ErrorResponse
    • Response
      • Unified-Task-Response
    • RequestBodies
      • Unified-Task-Request-Body
    • config
    • control_net_setting
    • lora_setting
  1. Seedance

Private Asset Library

Private Asset Library — API Guide#

For face / character / scene reference asset management and video generation with the Seedance 2.0 model family.

0. Overview#

PiAPI's Private Asset Library lets you upload face photos, character reference images, video clips, or audio references once, obtain a stable asset_id, and then reference it as asset://<asset_id> in your Seedance video-generation tasks. Once an asset reaches the Active state, every subsequent generation that references it benefits from stable character consistency across shots and skips re-processing of that asset on every request.
Typical use cases:
Multi-shot short films where the same character appears across cuts
Multiple characters in the same scene that need separate references in the prompt
Workflows where you want assets vetted up-front instead of re-checked on every generation
Asset lifecycle:
1.
Upload → the service asynchronously fetches the URL and ingests the file (usually seconds to a few minutes)
2.
Status transitions: Processing → Active (usable) or Failed (fetch failed / asset rejected / multi-face violation)
3.
Idle assets are garbage-collected after the per-plan TTL; calls to list / get / Seedance references refresh last_used_at
4.
Explicit deletion is also supported; when the last asset of a group is deleted, the group itself is cleaned up automatically

1. Authentication#

All endpoints use the X-API-Key HTTP header. Asset endpoints additionally require an account plan ≥ hobbyist.

2. Quota and TTL (per plan)#

PlanMax AssetsTTL (auto-purged when idle)
hobbyist503 days
developer2007 days
premium50015 days
enterprise100015 days
Assets in the Failed state do not count toward your quota.

3. Upload Assets#

3.1 Single upload#

Request fields:
FieldRequiredDescription
url✅Publicly reachable URL. Must remain reachable for at least 24 hours so the service can fetch it asynchronously.
asset_typeoptionalImage / Video / Audio. Inferred from the URL suffix when omitted.
nameoptionalDisplay name for the asset. Defaults to the last path segment (e.g. example1.png).
Supported types and constraints:
TypeExtensionsSize limitOther
Imagejpeg / jpg / png / webp / bmp / tiff / gif / heic / heif< 30 MBAspect ratio (0.4, 2.5); width/height (300, 6000) px
Videomp4 / mov≤ 50 MB480p / 720p / 1080p; 2–15 s; 24–60 FPS
Audiomp3 / wav≤ 15 MB2–15 s
Response (HTTP 202):
{
  "asset_id": "asset-20260607154123-6nxk8",
  "status": "Processing",
  "upload_at": "2026-06-07T15:41:23Z",
  "expires_at": "2026-06-22T15:41:23Z"
}

3.2 Batch upload (up to 5 items)#

Response (HTTP 202):
{
  "total": 4,
  "success": 4,
  "failed": 0,
  "results": [
    {"asset_id": "asset-20260607154123-aaaa1", "status": "Processing"},
    {"asset_id": "asset-20260607154124-bbbb2", "status": "Processing"},
    {"asset_id": "asset-20260607154124-cccc3", "status": "Processing"},
    {"asset_id": "asset-20260607154125-dddd4", "status": "Processing"}
  ]
}
Individual failures do not block the batch; failed items carry an error field describing the cause.

4. Query Asset Status#

Newly uploaded assets start in Processing. Poll until they reach Active before referencing them in a generation request.

4.1 List (with quota info)#

Query parameters:
ParamDefaultDescription
page1Page number
size20Page size (≤ 100)
statusallComma-separated subset, e.g. active,processing,failed
order-last_used_atSort key; - prefix for descending order
Response:
{
  "items": [
    {
      "asset_id": "asset-20260607154123-aaaa1",
      "name": "char-female",
      "asset_type": "Image",
      "status": "Active",
      "url": "https://your-cdn.com/example1.png",
      "last_used_at": "2026-06-07T15:41:23Z",
      "expires_at": "2026-06-22T15:41:23Z",
      "created_at": "2026-06-07T15:41:23Z"
    }
  ],
  "total": 4,
  "page": 1,
  "size": 20,
  "quota": {
    "used": 4,
    "limit": 500,
    "ttl_days": 15
  }
}
The url field echoes back the original URL you uploaded with — keep it persistent if you want it as a thumbnail preview source.

4.2 Single asset details#

Calling this also refreshes last_used_at (preventing LRU purge).
Response:
{
  "asset_id": "asset-20260607154123-aaaa1",
  "name": "char-female",
  "asset_type": "Image",
  "status": "Active",
  "url": "https://your-cdn.com/example1.png",
  "last_used_at": "2026-06-07T15:50:00Z",
  "expires_at": "2026-06-22T15:50:00Z",
  "created_at": "2026-06-07T15:41:23Z"
}
When status=Failed, the response carries an error object with details:
{
  "asset_id": "asset-...",
  "status": "Failed",
  "error": {
    "code": "ImageFormatNotSupported",
    "message": "Image format heif is not supported by current version"
  }
}

5. Delete Assets#

5.1 Single delete#

Response: HTTP 204 (empty body).

5.2 Batch delete#

Response:
{
  "deleted": 4,
  "failed": 0,
  "results": [
    {"asset_id": "asset-...aaaa1", "status": "deleted"},
    {"asset_id": "asset-...bbbb2", "status": "deleted"},
    {"asset_id": "asset-...cccc3", "status": "deleted"},
    {"asset_id": "asset-...dddd4", "status": "deleted"}
  ]
}

6. Generate Video with Assets (Seedance)#

The bridge between the asset library and Seedance: reference your assets as asset://<asset_id> instead of a regular URL.

6.1 Important constraints#

✅ Supported task types: seedance-2-less-restriction (std) and seedance-2-fast-less-restriction (fast)
❌ Not supported: strict variants (seedance-2 / seedance-2-fast); requests carrying asset:// references will fast-fail. Use the corresponding -less-restriction variant instead.
✅ In the prompt, reference assets using the literal Image 1 / Image 2 / Video 1 / Audio 1 notation. The index matches the position inside image_urls / video_urls / audio_urls.
✅ The alternative @image1 / @video2 / @audio1 reference syntax is also accepted; the service rewrites it to the canonical form automatically.

6.2 Submit a task#

Response:
{
  "code": 200,
  "data": {
    "task_id": "3f5ab17a-0b2e-44a3-b31d-3e6075e2b974",
    "status": "pending"
  },
  "message": "success"
}
On submission the service validates:
1.
Every asset:// reference belongs to the calling account
2.
Each referenced asset has status=Active
3.
task_type is one of the -less-restriction variants
If any check fails the request is rejected before being billed.

6.3 Poll task status#

In-progress response:
{
  "code": 200,
  "data": {
    "task_id": "3f5ab17a-...",
    "status": "processing"
  }
}
Completed response:
{
  "code": 200,
  "data": {
    "task_id": "3f5ab17a-...",
    "status": "completed",
    "input": {
      "prompt": "Cinematic. Photo realistic. A cyber female Image 1 stands in courtyard Image 3. Cyber warrior Image 2 next to her. Cyber boss Image 4 emerges. 5s scene.",
      "image_urls": ["asset://asset-...aaaa1", "asset://asset-...bbbb2", "asset://asset-...cccc3", "asset://asset-...dddd4"],
      "aspect_ratio": "16:9",
      "duration": 5,
      "resolution": "720p"
    },
    "output": {
      "video": "https://img.theapi.app/ephemeral/026610ac-5b23-4105-ac06-30f2044f304d.mp4"
    },
    "meta": {
      "usage": {
        "type": "point",
        "consume": 10000000
      }
    }
  }
}
The video URL is valid for 24 hours — download or consume it within that window.

6.4 Status state machine#

statusMeaning
pendingAccepted, queued for scheduling
processingGeneration in progress
completedSuccess; output.video is ready
failedFailure; inspect error.message

7. End-to-end example (Python)#


8. Common errors#

HTTPMessageMeaning / Resolution
400invalid request: 'url' is requiredMissing url field on upload
400unsupported asset_type: xxxThe file extension is not in the whitelist
400quota exceeded: plan hobbyist allows 50 assets, currently 50Quota full — delete old assets or upgrade plan
403asset not owned by this accountThe referenced asset_id belongs to another account
404asset not foundWrong asset_id or already deleted
409asset still processingWait a few seconds and retry
422asset:// references are only allowed on -less-restriction task typesSwitch task_type to seedance-2-(fast-)less-restriction
422asset xxx status=FailedThe referenced asset failed processing; GET its details to see why

9. Best practices#

1.
URL persistence — the URL you upload must remain reachable until ingestion completes. Once an asset has reached status=Active the original URL is no longer required, but keeping it alive for at least 24 hours is the safe default.
2.
Asset reuse — upload once and reference unlimited times. Every reference refreshes last_used_at, so frequently-used assets never hit the LRU TTL.
3.
Prompt reference order — Image 1 maps to image_urls[0], Image 2 to image_urls[1], etc. Indexes beyond the array length are ignored by the model.
4.
Mixing media types — image_urls, video_urls, and audio_urls can all appear in the same request, with the prompt referencing each via Image N / Video N / Audio N.
5.
Quota visualization — every list response contains quota.{used, limit, ttl_days}. Surface this on your dashboard so users know when they are close to the limit.
6.
Failed-asset hygiene — Failed assets do not count toward quota, but they still clutter the list. Delete them explicitly to keep the view clean.

Change log
2026-06-07: Initial release
Modified at 2026-06-07 10:10:15
Previous
Less-Restriction Models Guide
Next
Seedance 2