Seedance API in Python: Track the Cost of Each Usable Clip A developer published a Python tutorial for calling ModelGo's asynchronous Seedance 2.5 image-to-video API, showing how to submit a job, persist the task ID, poll for terminal status, and handle 429/503 retries with idempotency keys. The writeup argues that job completion rate and cost per usable clip are different metrics, illustrating a batch that spent $3.00 for two accepted clips, or $1.50 per usable clip, while three of four jobs completed. A job can succeed and still deliver a clip you can't use. If the product changes color halfway through a shot, a second paid render may be the only practical fix. For a recurring product-video batch, track both the completion rate and the cost of the clips your team accepts. Disclosure: This AI-drafted tutorial uses previously published ModelGo test data and API documentation. For a new image-to-video batch, start with one input photo you have rights to use. The code below follows the documented asynchronous endpoint. The published billing example in section 3 comes from a separate test with its own request settings. Set an explicit duration and resolution so that the first test is comparable to the next one. Store the returned task ID next to your asset ID before you poll the job. python import os import time import requests tasks = "https://api.modelgo.ai/v1/content generation/tasks" headers = {"Authorization": f"Bearer {os.environ 'MODELGO API KEY' }"} request = { "model": "doubao-seedance-2.5", "resolution": "720p", "duration": 5, "content": {"type": "text", "text": "Slow push-in. Preserve the product shape, color, and label."}, { "type": "image url", "image url": {"url": os.environ "PRODUCT IMAGE URL" }, "role": "first frame", }, , } created = requests.post tasks, headers=headers, json=request, timeout=30 created.raise for status task id = created.json "id" print f"Task ID: {task id}" for in range 60 : result = requests.get f"{tasks}/{task id}", headers=headers, timeout=15 if result.status code in {429, 503}: time.sleep 20 continue result.raise for status task = result.json if task "status" in {"succeeded", "failed", "cancelled", "canceled", "expired"}: print task "status" On success, retrieve task "content" "video url" in private storage. break time.sleep 10 else: print "Still awaiting a terminal status. Resume polling with the saved task ID." Set PRODUCT IMAGE URL to an image URL the API can fetch. The reference image defines the framing in this example. Keep the API key and the result URL private. If the POST response is lost, avoid blindly submitting it again. Persist an idempotency key before submitting in a batch and reuse that key when retrying the same request. For a new creative attempt after a quality rejection, use a new job ID. Seedance request and status fields https://modelgo.ai/docs/models/video/ark · Retry and idempotency reference https://modelgo.ai/docs/quickstart/openapi For a product shot, ask three questions. Is the product recognizable in every frame? Does the clip preserve the label and color? Does the motion fit the brief? Record one accepted output per asset. Keep technical failure, creative rejection and acceptance as separate outcomes. Here is an illustrative ledger. Replace these example amounts with settled charges from your own account. | Asset | Attempt | Outcome | Settled charge | |---|---|---|---| | A | 1 | Accepted | $1.00 | | B | 1 | Rejected in review | $1.00 | | B | 2 | Accepted | $1.00 | | C | 1 | Technical failure, zero charge in this example | $0.00 | This batch spent $3.00 and delivered 2 usable clips , for $1.50 per usable clip . Three of four API jobs completed, and two of three requested assets shipped. Those denominators answer different questions. Include paid rerenders that produced no accepted clip, reconcile against settled charges and keep pending charges out of the final batch calculation until they settle. For a provider or model comparison, fix the input image, duration, resolution, audio setting and review rules. Compare cost per usable clip and technical completion separately. If you change the prompt or retry allowance mid-test, record the change in the ledger. ModelGo’s published Seedance 2.5 test reports four 1280 × 720 outputs with audio, each 10.08 seconds. The reported total API charge was $8.038059 , or $2.009515 per delivered output rounded to six decimal places. That charge covers the video calls and excludes reference-art generation and funding fees. That gives you an observed cost per output. A production team can calculate its own cost per usable clip once it has the acceptance count and the settled charges for all attempts. Test settings, sample outputs and recorded charges https://modelgo.ai/blog/seedance-2-5