Skip to main content

Short answer

Query the task API by task_id; the returned quota is the video’s total cost. The two log entries (pre-charge + settlement) add up to it, and the quota in the “Async tasks” detail view is the same number.
quota ÷ 500,000 = USD. Authenticate with a system token (not an sk- API key); see the Log Query API for how to get one. Do not try to pair log entries one by one through the Log Query API: neither entry carries the task_id, and the settlement entry has an empty request_id.

How the three numbers relate

Seedance videos are billed as “pre-charge at submission, settle the difference on completion”, so one video leaves two log entries while the task API and the task detail view show a single quota: Settlement can also be a refund: a fast 480p 4-second text-to-video task was pre-charged 144,000, used 40,594 tokens × 18.5 × 0.18 = 135,179, so the settlement entry records −8,821 (a $0.02 refund) and the task API quota is 135,179. The first set of numbers comes from a real 2.0 image-to-video task with a reference video: 368,100 tokens × 14 (the video-input pricing tier) × 0.18 (group ratio) = 927,612, i.e. $1.86. The settlement entry’s other field carries final_quota = 927,612, original_quota = 224,999 and adjustment_quota = 702,613, so all three are visible in one record.

Read the real cost by status

Note the two vocabularies differ: the video query endpoint /seedance/api/v3/.../tasks/{id} reports success as succeeded, while the task API /api/task/self reports it as completed; do not copy the condition from your polling code.
Summing quota over failed tasks counts their pre-charge as spend. Filter by status when reconciling programmatically; if you reconcile through the Log Query API instead, pull both type=2 and type=11, the latter being refund entries with a negative quota.

Parameter spelling (opposite of the Log Query API)

The task API’s paging parameters are snake_case page_size and the page number p starts at 1; the Log Query API uses camelCase pageSize with p starting at 0. Getting it wrong does not raise an error, you just get the default page. Verified filters: For batch reconciliation, pull by time window; every item carries task_id, status, quota, submit_time, finish_time and model_name:

If you must cross-check in the logs manually

Three fields on the settlement entry line up with the task API:
  • Its timestamp (created_at) equals the task’s finish_time, within 1 second
  • Its completion_tokens equals the task’s usage.completion_tokens
  • Its other.final_quota equals the task’s quota
The pre-charge entry’s request_id equals the X-Shellapi-Request-Id header of the submission response, so it can be looked up with /api/log/self?request_id=…. Note the response also carries an X-Request-Id header; that is the provider-side request ID and cannot be found in APIYI logs. But pre-charge entries collide when several tasks are submitted in the same second, and the settlement entry has no request_id, so the logs are only suitable for spot-checking individual tasks. Use the task API for programmatic reconciliation.

FAQ

Check the task status first. While submitted / in_progress, quota is only the pre-charge and the second log entry does not exist yet; when failed, quota still shows the pre-charge while the logs gained a negative refund entry, so the two entries sum to 0. For completed tasks the two must match; if they do not, send the task_id to support.
The settlement is booked by the system when the task completes, outside the gateway request path, so it carries no token, group or request_id, and the console labels it “streaming”. This is normal.
On /v1/videos and the other generic endpoints the pre-charge entry’s content does include task ID: cgt-…, but the settlement entry still does not. Those endpoints also pass Seedance’s resolution parameter through incompletely at the moment, so always use the documented path /seedance/api/v3/contents/generations/tasks; see the Video Generation API.
/api/task/self returns only the tasks of the account that owns the token. A system token is equivalent to account credentials, so guard it like a password and keep it out of code repositories.