Skip to main content

Python client for the Velvi Seedance 2 video generation API.

Project description

velvi-python

velvi is a thin Python SDK for the Velvi Seedance 2 partner API.

It wraps the partner-facing endpoints under /api/v1/video/seedance2 so external users do not need to manage raw curl requests for task creation, polling, and asset uploads.

Install

pip install velvi

Quickstart

from velvi import Velvi

client = Velvi(
    api_key="velvi_partner_key_here",
    base_url="https://api.velvi.tech",
)

task = client.create(
    model="seedance2-fast",
    prompt="A cinematic close-up of a silver sports car driving through rain at night.",
    duration=5,
    ratio="16:9",
)

result = client.wait(task.id, poll_interval=5.0)
print(result.status)
print(result.content.video_url if result.content else None)

Resource API

from velvi import Velvi, first_frame, reference_image

client = Velvi(api_key="velvi_partner_key_here")

asset = client.assets.upload("frame.png")

task = client.videos.create(
    model="seedance2",
    content=[
        {"type": "text", "text": "The subject smiles softly and turns toward camera."},
        first_frame(asset.asset_ref),
        reference_image("https://example.com/style-reference.png"),
    ],
    return_last_frame=True,
)

result = client.videos.wait(task.id)
print(result.content.video_url)
print(result.content.last_frame_url)

Environment Variables

  • VELVI_API_KEY: default API key if api_key is omitted.
  • VELVI_BASE_URL: default API hostname if base_url is omitted. The SDK appends /api/v1 automatically when needed.

Supported Operations

  • client.create(...)
  • client.get(task_id)
  • client.list(...)
  • client.wait(task_id, ...)
  • client.cancel(task_id)
  • client.assets.upload(...)
  • client.assets.get(...)
  • client.assets.list(...)
  • client.assets.delete(...)

Packaging

Build locally with:

cd sdk/python
python -m build

Then publish with your normal PyPI release flow once the package name and credentials are set up.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

velvi-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

velvi-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file velvi-0.1.0.tar.gz.

File metadata

  • Download URL: velvi-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for velvi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1b24225656c396a7b82d09ccf4ce05ca34d847fe6663fa829d9db32b6d48a9f
MD5 a4c2722a9150c4c5180f7fca58798454
BLAKE2b-256 fd901e9b851f952f422e5e154266a4d25333b3e67ebb1bf008f60ed713187656

See more details on using hashes here.

Provenance

The following attestation bundles were made for velvi-0.1.0.tar.gz:

Publisher: publish-python-sdk.yml on HanzlaJavaid/AI_Talent_Network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file velvi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: velvi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for velvi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 224904b157d2b20b45f0770f3df7596bb6d0295b934fe8f7554862134e3adc4a
MD5 fd49806bd98a90423a31e466b7fa737a
BLAKE2b-256 3ec352e7f0c20574bd12ccdf1668a1a53c62f27a682b03b4a1e19592cf6e7732

See more details on using hashes here.

Provenance

The following attestation bundles were made for velvi-0.1.0-py3-none-any.whl:

Publisher: publish-python-sdk.yml on HanzlaJavaid/AI_Talent_Network

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page