Estimate a batch image cost from the Sume catalog in Python
Read a model's price from GET /v1/images/models/{id}/endpoints and multiply by n and count. A 14-line Python estimator, with the quality and size caveat.

Read the price from the catalog and multiply: cost_usd x n x number of calls. The model's endpoints route, GET /v1/images/models/{id}/endpoints, returns pricing entries whose cost_usd is Sume's billable price, per the Image API docs. That gives you an estimate before you submit a 100-image batch, with no hard-coded price table to go stale.
Quality-tiered and token-billed models, such as Ideogram 4.5 and GPT Image 2.5, return more than one price line or depend on size, so pick the entry that matches your request.
What does the estimator look like?
It takes the first pricing line; for tiered models, filter it by quality.
import os, requests
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
def estimate(model, n, calls):
url = f"https://api.sume.com/v1/images/models/{model}/endpoints"
r = requests.get(url, headers=H, timeout=30)
r.raise_for_status()
price = r.json()["data"]["endpoints"][0]["pricing"][0]["cost_usd"]
return float(price) * n * calls
print(estimate("qwen/qwen-image", 4, 25))What can make the estimate wrong?
Size, quality and reference count all move price on some models. GPT Image 2.5 is token-billed, and its input tokens are estimates. Treat the figure as a budget, then compare it to usage.cost after the first wave. Prices here are list x 1.25 in dollars per image before whole-cent rounding; the catalog's billable formula reads "list x 1.25, ceil usd cents", so confirm the first charge in usage.cost and budget from the invoice, not from the sum.
Sources
Related posts
More in Developers
- Excel VBA: submit an AI video job and poll it with Application.OnTime
An Excel macro posts a Wan 3.0 job to Sume with ServerXMLHTTP, saves the job id in a cell and re-checks status with Application.OnTime without blocking Excel.
- Express breaks your Sume webhook signature: mount express.raw first
If verifyWebhook returns false in Express, a JSON parser changed the body. Mount express.raw on the webhook route only. Working Node code with the SDK.
- Express receiver for Sume TTS job webhooks: raw body and HMAC
A Node Express route that verifies Sume job webhooks over the raw body, accepts rotated secrets, rejects an empty secret and answers 204 before any work.
- Test a Sume poll loop against a fake local server in Python
Test your Sume job poll loop with a stdlib http.server that answers queued, processing, completed. No network, no credits and no real waits. Runnable code.
Written by Sume