Why is the "usageTotalUsd" Field Missing Sometimes?

The usageTotalUsd field of an ActorRun is sometimes defined and sometimes missing. I can't tell the rhyme or reason for when this happens. For example,
const actorRun = await actorClient.call()
console.log(actorRun.usageTotalUsd)
const actorRun = await actorClient.call()
console.log(actorRun.usageTotalUsd)
may log "undefined" or may log a number. What is reason behind the usageTotalUsd field being missing sometimes? Thank you!
5 Replies
Hall
Hall•4w ago
Someone will reply to you shortly. In the meantime, this might help: -# This post was marked as solved by YBtheS. View answer.
Louis Deconinck
Louis Deconinck•4w ago
Just a very unlikely guess, but perhaps the run you're checking has not finished yet?
like-gold
like-gold•4w ago
The field is not present for Actors that use PPR or PPE pricing models. This is gonna change in the future but for now the field is returned only for a PPU run, with a breakdown of the usage.
ratty-blush
ratty-blushOP•4w ago
Oh okay, thank you. For those with the same issue using PPR, it seems you can get the total run cost by doing actorRun.pricingInfo.pricePerUnitUsd multiplied the number of results. I have not tested this though. I’m just guessing.
like-gold
like-gold•4w ago
Yeah, you can technically do the same with PPE since you have the breakdown of all the events, it's just way more tedious šŸ˜…

Did you find this page helpful?