Skip to main content

Assets

Upload media files and subtitle files to the Peako CDN. Uploaded files get a permanent CDN URL you can reference in render requests.

Upload Asset

POST /api/assets/upload

Upload a video, audio, image, or subtitle file. Returns a CDN URL for use in templates and render requests.

Headers:

  • X-API-Key: <your-api-key> (required)

Request Format: multipart/form-data

Fields:

  • file (required) — binary file content

Allowed file types:

TypeMIMEExtensions
Videovideo/*.mp4, .webm, .mov, .mkv, .avi
Audioaudio/*.mp3, .wav, .aac, .m4a, .ogg
Imageimage/*.jpg, .jpeg, .png, .gif, .webp, .svg
Subtitletext/plain.srt, .vtt, .lrc
Subtitletext/x-ssa.ass, .ssa

File Size Limit: 2 GB per file

Response (200 — Success):

{
"url": "https://peako.shin0x.space/assets/550e8400-e29b-41d4-a716-446655440000.mp4"
}

Error Codes:

  • 400 — Invalid file type or extension
  • 401 — Missing or invalid API key
  • 413 — File exceeds 2 GB

Examples:

# Upload a video file
curl -X POST \
-H "X-API-Key: YOUR_KEY" \
-F "file=@my-video.mp4" \
https://peako.shin0x.space/api/assets/upload

# Response:
# { "url": "https://peako.shin0x.space/assets/550e8400.mp4" }

# Upload an image
curl -X POST \
-H "X-API-Key: YOUR_KEY" \
-F "file=@thumbnail.jpg" \
https://peako.shin0x.space/api/assets/upload

# Upload a subtitle file
curl -X POST \
-H "X-API-Key: YOUR_KEY" \
-F "file=@captions.srt" \
https://peako.shin0x.space/api/assets/upload

Notes

  • Uploaded files are stored permanently until manually deleted (no auto-expiry on upload)
  • Rendered output files expire after 7 days
  • The returned url is what you pass as src_url or upload_url in render requests
  • Files must originate from the Peako CDN (peako.shin0x.space/assets/...) to be accepted in render requests — external URLs are blocked for security

Next: Templates