Estimate cost

Price an image or video request before creating it. The estimate endpoints validate the same body as generate and hold nothing.

POST /image/generate/estimate and POST /video/generate/estimate take the same body as generate. They validate it the same way and return the price. No task is created and nothing is held on your balance.

curl https://api.mynth.io/image/generate/estimate \
  -H "Authorization: Bearer $MYNTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"black-forest-labs/flux.2-pro","prompt":"A lighthouse at dusk","count":2}'
{
  "data": {
    "estimatedCost": "0.06",
    "currency": "usd",
    "estimateKind": "exact"
  }
}
FieldMeaning
estimatedCostUSD as a decimal string. The amount a real request would hold
estimateKindexact for an explicit model. upper_bound for image auto, which holds $0.20 per image

Keep estimatedCost as a decimal. Parse it with a decimal library if you add amounts up, because floats drift. --dry-run in the CLI prints the same number, and --json prints the object. Local input files are not uploaded on a dry run.

Use it as a preflight#

A body the model cannot serve fails here the same way it would on generate, so the estimate also checks a request before you spend anything. Before a batch, compare the total with available from GET /balance, which needs a key with the manage scope.

The formulas behind the number, and how the hold becomes a charge, are on pricing.

Next steps#