Improvement
APICompleted webhooks include task cost
Read the final billed cost from task.cost on any completed task webhook.
Every task.*.completed webhook now includes task.cost, the final USD
charge as a decimal string with eight decimal places:
{
"event": "task.image.generate.completed",
"task": {
"id": "tsk_01KE7XWWEQ4MCGWKBQKJ1G47RP",
"cost": "0.03000000"
}
}This is an excerpt of the payload. The webhook still includes request and
result. Failed task webhooks keep only task.id in the task object.
See webhook payloads.