taotaojt9988 / xzai-me-media
Use when the user asks to generate a video, make an AI video, create an image or poster from text, do text-to-speech, or give an agent media generation — e.g. "generate a video of a corgi running in snow", "make me a 15s promo video", "turn this text into speech". Covers Seedance 2.0/2.5 video (10s/15s/30s), Seedream 5.0 images, 7-voice TTS and OpenAI-compatible chat via the xzai.me API, with async polling and local download.
|---|---|
| video | Seedance text-to-video / image-to-video | 4–20 min |
| image | Seedream 5.0 text-to-image / image reference | ~1 min |
| tts | Text to speech (WAV) | seconds |
| chat | OpenAI-compatible chat (glm-5.3-flash) | seconds |
| models | List available models | — |
| status <task_id> | Check a video/image task | — |
Video Models (the #1 mistake is here)
--model | duration | notes |
|---|---|---|
| (omit) | 10 s | Seedance 2.0 Fast, the default, cheapest |
seedance-2.0-fast-15 | 15 s | must be spelled exactly |
seedance-2.0-mini | 15 s | must pass --duration 15 too |
seedance-2.5 | 30 s | only 30 s; also supports 21:9 |
**The API silently falls back to the 10-second Fast model if the model name
is wrong or --duration is missing for mini.** The CLI validates the
combination and refuses to submit an inconsistent pair — never bypass it by
calling the raw endpoint with unvalidated values.
Ratios: 16:9 / 9:16 / 1:1 / 3:4 / 4:3 (plus 21:9 for 2.5 and fast-15).
Reference images: pass --images url1 url2 (max 10). One image = first
frame; multiple = multi-reference.
Procedure
Confirm the key works:
python scripts/xiaozhi.py models. If this
fails with 401, the key is wrong — stop and check before submitting paid
jobs.Choose parameters deliberately: video or image; ratio; duration
(video). State them in your reply so the user can correct before you
submit — generation consumes credits.Submit and wait: the CLI polls automatically and prints progress.
Videos take 4–20 minutes; do not re-submit while a task is pending —
duplicate submissions burn credits. Usestatus <task_id>in a new call
instead.Download immediately: the CLI saves output to
--out. Result URLs on
the CDN expire; a local copy is the only durable deliverable. Completion
criterion: the file exists on disk and is non-empty.- Report the local path, not the remote URL, to the user.
Image Notes
Output size approximates but does not exactly match the requested ratio
(16:9 came out 2848×1600 in testing). If exact dimensions matter, check
the file after download.- Up to 10 reference image URLs per job via
--images. - Styles: pass
--style web_image_style_2D(also_3D,_portrait, …).
Pitfalls
Two auth schemes:
api.phpendpoints use thex-tokenheader;/v1/*endpoints useAuthorization: Bearer. The CLI handles this; if
you ever call the API directly, don't mix them.Failed tasks auto-refund (state 2), so a failed video doesn't cost
credits — but a duplicate submission while waiting does.TTS limit: 1–500 characters per call; longer text must be split.
Audio URLs expire in ~24 h.Context window of the chat model is 1,048,576 tokens — don't assume
small-context limits, but do not send more than ~1M tokens.- Errors are standard OpenAI-shaped JSON; 402 means insufficient credits.
Verification
After any generation, confirm the output file exists and open/inspect it
(e.g.ffprobefor video, image dimensions for images).python scripts/xiaozhi.py status <task_id>returns authoritative task
state: 0=pending, 1=done, 2=failed (refunded), -1=not found.