Python SDK for Seedance 2.5 API, Seedance text-to-video, Seedance image-to-video, and Seedance video editing through the HiAPI unified task API.
Use this SDK when you want a small Python client focused on AI video generation:
- Seedance 2.5 API access through HiAPI's
/v1/tasksendpoint. - Text-to-video with
client.text_to_video(...). - Image-to-video with
client.image_to_video(...). - Video editing with
client.video_edit(...). - Async task polling built in: submit, poll, and read the output URL.
- Zero runtime dependencies: standard library only.
pip install hiapi-seedanceRequires Python 3.8+.
from hiapi_seedance import Seedance
client = Seedance() # uses HIAPI_API_KEY
task = client.text_to_video(
prompt="A 30-second cinematic one-take product film, golden hour, slow dolly in",
duration=30,
aspect_ratio="16:9",
resolution="1080p",
)
print(task.output[0].url)Set your API key:
export HIAPI_API_KEY="sk-your-hiapi-key"Get a key at HiAPI.
from hiapi_seedance import Seedance
client = Seedance(api_key="sk-...")
task = client.text_to_video(
prompt=(
"A one-take AI video prompt: a glass perfume bottle rotates on wet black "
"stone while sunrise light moves across the surface, macro texture, no text."
),
duration=15,
aspect_ratio="16:9",
resolution="1080p",
)
print(task.status, task.output[0].url)task = client.image_to_video(
prompt="Animate the reference image with a slow push-in, drifting fabric, and warm rim light.",
image_urls=["https://example.com/first-frame.png"],
duration=8,
aspect_ratio="9:16",
)task = client.video_edit(
prompt="Keep the original camera movement and timing. Add a blue-white energy bow in the actor's hands.",
video_urls=["https://example.com/source.mp4"],
image_urls=["https://example.com/prop-reference.png"],
)created = client.text_to_video(
prompt="A fashion film in a desert gallery",
duration=30,
wait=False,
)
task = client.wait(created.task_id, poll_interval=3, timeout=900)
print(task.output[0].url)The SDK sends requests to:
POST https://api.hiapi.ai/v1/tasks
Authorization: Bearer $HIAPI_API_KEY
Content-Type: application/json{
"model": "seedance-2-5",
"input": {
"prompt": "A cinematic Seedance 2.5 prompt",
"duration": 30,
"aspect_ratio": "16:9",
"resolution": "1080p"
}
}You can pass additional model fields as keyword arguments:
task = client.text_to_video(
prompt="A multilingual typography loop",
duration=15,
web_search=False,
generate_audio=True,
)Need production prompts and preview examples? Use the companion prompt library:
The default model is seedance-2-5. You can override it per client or per call:
client = Seedance(model="seedance-2-5")
task = client.text_to_video(prompt="...", model="seedance-2-0")Use the fallback model while waiting for Seedance 2.5 availability on your account.
Seedance 2.5 API, Seedance Python SDK, Seedance API Python, Seedance text to video API, Seedance image to video API, AI video generation API, text-to-video Python, image-to-video Python, HiAPI Seedance API.
MIT