Estimate a Sume image batch cost from endpoint pricing lines in Python
Estimate an image batch before you run it: read cost_usd from the model's endpoint pricing line and multiply by n. A short Python script, with a caveat.

The Image API docs state that endpoint pricing lines are the amount charged to your wallet, with margin already applied, so cost_usd times n is what you pay. For a batch, fetch the model's endpoint, take the output_image line and multiply by the number of images. Where a model prices by token or by quality, the line may not be a flat per-image number, so read what it lists.
What the docs say
From the Image API docs.
| Item | Fact |
|---|---|
| Endpoint | GET /v1/images/models/{model_id}/endpoints |
| Pricing line | billable, unit, cost_usd; for example output_image per image |
| Charge | cost_usd times n, margin already applied |
| Failed generations | Not billed |
The estimator
It handles only flat per-image lines and says so otherwise.
import os, requests
def estimate(model, n_total):
r = requests.get(
f"https://api.sume.com/v1/images/models/{model}/endpoints",
headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
timeout=30,
)
lines = r.json()["endpoints"][0]["pricing"]
flat = [p for p in lines if p["billable"] == "output_image" and p["unit"] == "image"]
if not flat:
raise ValueError(f"no flat per-image line: {lines}")
return round(flat[0]["cost_usd"] * n_total, 4)
print(estimate("bytedance-seed/seedream-4.5", 200))Caveats
The catalog changes, so read prices at run time. Quality and size can change the charge on some models; for ChatGPT Image 2.5 the docs say auto quality reserves the max amount, so pin quality before you estimate. Confirm after the run with GET /v1/usage.
Sources
Related posts
More in Pricing
- fal H100 at $2.49/hour vs per-output media API pricing: which fits
fal lists an H100 at $2.49 per hour and video APIs from $0.025 to $0.14 per second. When hourly GPU pricing beats paying per output, and when it does not.
- fal pricing units: per megapixel, per 1,000 tokens, per second
fal's price page quotes per second, per image, per megapixel, per 1,000 tokens and per 1,000 characters. Convert each to dollars per output first.
- $50 in a Sume wallet: cutouts, upscales, transcripts, minutes
What $50 buys at Sume's published API rates: about 2,222 background removals, 250 image upscales, 5,000 transcript minutes or 500 timeline minutes.
- What it costs to finish 100 holiday ads: captions, trim, timeline
Sume's documented prices for captions, trim, timeline render and music, added up for 100 finished ads, plus what the total leaves out. Confirm live first.
Written by Sume