Skip to main content

byteplus-py

A small convenience SDK for BytePlus ModelArk APIs, starting with Seedance video generation. It wraps the official byteplus-python-sdk-v2 Ark runtime and adds fal-style submit, retrieve, wait, and subscribe helpers.

Install

python -m pip install -e ".[dev]"

Configure

Create a .env file:

BYTEPLUS_API_KEY=ark-...

ARK_API_KEY is also supported.

Usage

from byteplus_py import BytePlus
from byteplus_py.seedance import image_url, text

client = BytePlus.from_env()

task = client.seedance.submit(
    model="dreamina-seedance-2-0-fast-260128",
    content=[
        text("A cinematic shot of fruit tea being prepared."),
        image_url(
            "https://ark-doc.tos-ap-southeast-1.bytepluses.com/doc_image/r2v_tea_pic1.jpg",
            role="reference_image",
        ),
    ],
    generate_audio=True,
    ratio="16:9",
    duration=4,
    watermark=False,
)

print(task.id)

For fal-style polling:

result = client.seedance.subscribe(
    model="dreamina-seedance-2-0-fast-260128",
    content=[text("A tiny robot waters a basil plant in morning light.")],
    duration=4,
)

print(result.video_url)

Download a Completed Video

from byteplus_py import BytePlus

client = BytePlus.from_env()
path = client.seedance.download_video("cgt-...", output_dir="downloads")

print(path)

Estimate Video Cost

The Seedance API returns usage.completion_tokens for completed tasks. The SDK can combine that with the video generation rates in docs/byteplus-pricing.md:

task = client.seedance.retrieve("cgt-...")
cost = client.seedance.estimate_cost(task, input_includes_video=True)

print(cost.amount_usd)

Smoke Test

The smoke script submits the multimodal sample from docs/video-api-docs.md and prints only non-secret task data:

python examples/seedance_smoke.py --no-wait

To poll until completion:

python examples/seedance_smoke.py --wait --timeout 900

To wait and download the completed video:

python examples/seedance_smoke.py --wait --download

Metadata

Release files for byteplus-py 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for byteplus-py 0.1.0
File Size Uploaded
byteplus_py-0.1.0.tar.gz 33.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for byteplus-py 0.1.0
File Interpreter ABI Platform
byteplus_py-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.0 kB

Release files / byteplus_py-0.1.0.tar.gz

Download URL byteplus_py-0.1.0.tar.gz
Size 33.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3ece2d65225719fc736961fd9f33cbd53e4e25e7103bbb3ef9296dbbbe791faf
BLAKE2b-256 checksum
How to use checksums
895ee5b7f90e6757671100cffd3c4fcada4d69f6d88894a8411db2433b5d4df6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.

Transparency log

Release files / byteplus_py-0.1.0-py3-none-any.whl

Download URL byteplus_py-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
989a01541a9734815ad83e863ff20181b35ce065ddb338f1667d8ce9a149b648
BLAKE2b-256 checksum
How to use checksums
665dd5cc71131187859b1783304e9493dfd59eb5508d8e0b2a89e618bc985b95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page