Estimate request cost¶
Topics: clients, generation, requests
Set dry_run=True on an image or text async request, then submit it through the matching simple-client dry-run method.
The API evaluates current pricing and returns kudos without creating a job.
request = image_request().model_copy(update={"dry_run": True})
estimate = AIHordeAPISimpleClient().image_generate_request_dry_run(request)
print(estimate.kudos)
Verify that the response is ImageGenerateAsyncDryRunResponse or TextGenerateAsyncDryRunResponse and contains a
non-negative kudos value. The estimate is point-in-time data; worker availability and pricing can change before live
submission.
Dry-run calls require network access but need no cleanup because they create no follow-up resource. To return to live
behavior, construct a new request with dry_run=False; avoid mutating and reusing a request shared across tasks.