Short answer
Query the task API bytask_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 singlequota:
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.
Parameter spelling (opposite of the Log Query API)
The task API’s paging parameters are snake_casepage_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’sfinish_time, within 1 second - Its
completion_tokensequals the task’susage.completion_tokens - Its
other.final_quotaequals the task’squota
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
The quota in the task detail differs from the sum of the two log entries?
The quota in the task detail differs from the sum of the two log entries?
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.Why does the settlement entry have no token and no request_id?
Why does the settlement entry have no token and no request_id?
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.Do tasks submitted through the generic video endpoints carry a task_id in the logs?
Do tasks submitted through the generic video endpoints carry a task_id in the logs?
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.Can a system token see other accounts' tasks?
Can a system token see other accounts' tasks?
/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.