• Docs
  • API reference
  • SDKs & tools
  • Models
  • Changelog
Sign inGet an API key
DocsAPI referenceSDKs & toolsModelsChangelog

Start here

IntroductionGetting startedAuthenticationPricing and billingBeta

Concepts

TasksPrompts and imagesDestinationsWebhooksRate limits

Models

The model fieldChoosing an image modelVideo models

Guides

Generate imagesGenerate videoImage to imageEnhance prompts
Estimate costPoll for results
  1. Docs
  2. /
  3. Guides
  4. /
  5. Production

Estimate cost

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

PreviousRate imagesNextPoll for results

On this page

Use it as a preflightNext steps

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": {
    "estimated_cost": "0.06",
    "currency": "usd",
    "estimate_kind": "exact"
  }
}
FieldMeaning
estimated_costUSD as a decimal string. The amount a real request would hold
estimate_kindexact for an explicit model. upper_bound for image auto, which holds $0.20 per image

Keep estimated_cost 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

  • Pricing and billing: the formulas, the balance, and holds.
  • Generate images: send the body for real.
  • Video models: the tiers and durations that set a video's price.