Connect with your existing SDK
Volcengine image and video models
Requests with remote references additionally require assets:write for protected import into the selected project. Text-only image or video generation does not require import permission.
Use your Lashot key and base_url="https://api.lashot.tianyunai.com/compat/ark/api/v3". Lashot provides model calls, authorization, project access, task archiving and billing. Use platform model names rather than your own Volcengine ep-... endpoints.
The Volcengine Ark SDK connects to Lashot's unified protocol entry, independently of the model's execution channel. Once a model is integrated and opened, use its supported methods without changing the SDK or base URL when a channel changes. Versions, parameters and reference capabilities follow the live model catalog. If a name has multiple entries, use the full platform model identifier returned by the catalog. Text, speech and other SDK resource boundaries are described below.
Install volcengine-ark-runtime and import Ark from volcenginesdkarkruntime. Set max_retries=0. Persist one unique Idempotency-Key per logical request; query an uncertain task before submitting another paid generation. images.generate(model="seedream-4.5", prompt="a lighthouse", size="2K", response_format="url", extra_headers={"Idempotency-Key": saved_key}) uses the image interface. content_generation.tasks.create(model="seedance-1.0-pro-fast", content=[{"type":"text","text":"a lighthouse"}], duration=2, resolution="480p", ratio="16:9", extra_headers={"Idempotency-Key": saved_video_key}) creates video; poll content_generation.tasks.get(task_id=result.id).
All four Seedream models (4.5, 5.0 Lite, 5.0 Pro, 5.5) and the twelve available Seedance variants use their platform model names. Read the live model contract for supported dimensions, duration, audio and reference slots. Image image accepts HTTPS URLs or a list; video content preserves image/video/audio URLs and first/last frame or reference roles. URLs enter the protected asset import pipeline. For private inputs, import assets and use asset references through the unified API. Never forward the platform key to external URLs. extra_body={"project_id":"project-uuid"} selects a project.
Images wait up to about 60 seconds. On HTTP 202 or empty results, query GET /v1/jobs/{lashot_job_id}; do not treat acceptance as success. Private outputs require same-origin authenticated download as described below. Streaming, Base64 output, sequential image generation and Seedream 5.5 layer decomposition are rejected. Text, speech and review models use POST /v1/generations; Ark Chat and every other SDK resource are not implied. Billing uses the customer's assigned policy and frozen task price version.
If you already call Ark, DashScope, Kling, MiniMax, or Qianfan, reuse the supported request fields and change the base URL and key. Private media downloads also need the authorization adapter described below.
Set $LASHOT_BASE to your deployed API address. Local development uses http://localhost:8080; ask your deployment administrator for the production address. These instructions do not imply that a public production service is live.
Create a key on the Keys page and put it in the SDK api_key slot. Creating and reading generations requires generations:write/read; downloading media also requires assets:read and current project access.
What to change
| You use | New base URL |
|---|---|
| Volcengine Ark | $LASHOT_BASE/compat/ark/api/v3 |
| DashScope | $LASHOT_BASE/compat/dashscope/api/v1 |
| Kling | $LASHOT_BASE/compat/kling/v1 |
| MiniMax | $LASHOT_BASE/compat/minimax |
| Baidu Qianfan | $LASHOT_BASE/compat/qianfan/v2 |
Keep the vendor auth style. The server accepts Authorization: Bearer and x-api-key.
Only opened models and fields are allowed; extra parameters return 400. New private projects return root-relative output paths such as /v1/asset-versions/{id}/content. Resolve them against the API origin in $LASHOT_BASE and send the current Bearer key only to that exact same-origin content route. Every download checks current project access and media review. Never send platform credentials to external storage URLs or follow redirects with credentials. Vendor downloaders that fetch media without authorization need this adapter; changing only the base URL and key does not cover media downloads.
Shortest example (Ark image)
On the Ark entry the sandbox model is sandbox-image (lashot sandbox/image).
curl -sS -X POST "$LASHOT_BASE/compat/ark/api/v3/images/generations" \
-H "Authorization: Bearer $LASHOT_KEY" \
-H "content-type: application/json" \
-d '{
"model": "sandbox-image",
"prompt": "a lighthouse at dusk, long exposure",
"size": "1024x1024",
"response_format": "url"
}'
The Python Ark SDK request example prints the task or result; it does not download the file:
from volcenginesdkarkruntime import Ark
import os
client = Ark(
base_url=os.environ["LASHOT_BASE"] + "/compat/ark/api/v3",
api_key=os.environ["LASHOT_KEY"],
)
print(client.images.generate(
model="sandbox-image",
prompt="a lighthouse at dusk, long exposure",
size="1024x1024",
response_format="url",
))
Sync calls wait up to about 60 seconds, then 202 with a job id to poll. Async calls (video and similar) keep the vendor create-then-poll loop.
Next
- New project, or you do not want vendor fields: lashot API.
- Every method and field: All endpoints in the console.