Estimate a job before you spend
All guides

Guide · 3 min read

Estimate a job before you spend

Ask for the list or volume price and the current queue wait. Then create the job.

POST /v2/models/goonify/flux2/estimate. Unauthenticated calls return the list price. A live key returns your volume-tier price. The request body is optional.

Sandbox keys (sk_test_) return example media and never charge. Live keys (sk_live_) spend prepaid credits. Failed and cancelled jobs refund.

A cost.usd figure and estimated_wait_seconds before you enqueue work.

Steps

  1. 1

    POST /v2/models/{id}/estimate. The body can be empty.

  2. 2

    Unauthenticated calls return the list price. A live key returns your volume tier.

  3. 3

    Read cost.usd and estimated_wait_seconds.

  4. 4

    Create the job only if you accept the quote.

Install the SDK

pip install "goonify @ git+https://github.com/Goonify/goonify.git#subdirectory=sdks/python"

Modelgoonify/flux2

from goonify import Goonify

client = Goonify()

quote = client.models.estimate("goonify/flux2")
print(quote.cost["usd"], quote.estimated_wait_seconds)

# Sandbox keys (sk_test_) never spend. Live keys (sk_live_) use prepaid credits.

What it looks like

Run it with a sandbox key

Sandbox keys return example media and spend nothing. Switch to a live key when you are ready.

Next recipes