stakwork / stak-bounties

0 stars 2 forks source link

Runs: Use attribute in the Response to calculate Request cost #4

Closed Edvardoh closed 1 year ago

Edvardoh commented 1 year ago

For some Requests we need to calculate the cost based on an attribute returned in the response.

For example, for Twitter Requests, we want to use the response.meta.result_count as the Tweet count, and charge the customer $0.005 per Tweet.

Currently we are limited to only applying a cost per instantiation of the Step - ie. per Request. And therefore we need to assume max usage, and end up over-charging the customer if they get less Tweets than the max of 100.

Sample Run: https://jobs.stakwork.com/admin/projects/23482832

Image