Python SDK for BytePlus ModelArk APIs, starting with Seedance video generation.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file byteplus_py-0.1.0.tar.gz.
File metadata
- Download URL: byteplus_py-0.1.0.tar.gz
- Upload date:
- Size: 33.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ece2d65225719fc736961fd9f33cbd53e4e25e7103bbb3ef9296dbbbe791faf
|
|
| MD5 |
28569eb5ac540bf0f06942960cddd674
|
|
| BLAKE2b-256 |
895ee5b7f90e6757671100cffd3c4fcada4d69f6d88894a8411db2433b5d4df6
|
Provenance
The following attestation bundles were made for byteplus_py-0.1.0.tar.gz:
Publisher:
publish.yml on ZeroSpaceStudios/byteplus-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
byteplus_py-0.1.0.tar.gz -
Subject digest:
3ece2d65225719fc736961fd9f33cbd53e4e25e7103bbb3ef9296dbbbe791faf - Sigstore transparency entry: 1842244712
- Sigstore integration time:
-
Permalink:
ZeroSpaceStudios/byteplus-py@110f41e27e4abf16d7f2d74b0758942a6e01d390 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ZeroSpaceStudios
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@110f41e27e4abf16d7f2d74b0758942a6e01d390 -
Trigger Event:
release
-
Statement type:
File details
Details for the file byteplus_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: byteplus_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
989a01541a9734815ad83e863ff20181b35ce065ddb338f1667d8ce9a149b648
|
|
| MD5 |
11d894645934d7178e5ced35993c1b2e
|
|
| BLAKE2b-256 |
665dd5cc71131187859b1783304e9493dfd59eb5508d8e0b2a89e618bc985b95
|
Provenance
The following attestation bundles were made for byteplus_py-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on ZeroSpaceStudios/byteplus-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
byteplus_py-0.1.0-py3-none-any.whl -
Subject digest:
989a01541a9734815ad83e863ff20181b35ce065ddb338f1667d8ce9a149b648 - Sigstore transparency entry: 1842244912
- Sigstore integration time:
-
Permalink:
ZeroSpaceStudios/byteplus-py@110f41e27e4abf16d7f2d74b0758942a6e01d390 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ZeroSpaceStudios
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@110f41e27e4abf16d7f2d74b0758942a6e01d390 -
Trigger Event:
release
-
Statement type: