Export Sume image model prices to CSV from the endpoints API
Loop the model list, read each endpoint's pricing lines and write one CSV row per model and billable. A Python snapshot you can diff for price changes.

To export Sume's image prices, call GET /v1/images/models for the model ids, call GET /v1/images/models/{id}/endpoints for each one, and write every entry of the endpoint's pricing array (billable, unit, cost_usd) as a CSV row with today's date. Sume documents endpoint pricing as the amount charged to your wallet, with margin already applied, so cost_usd times n is what a call costs; the file is a cost table you can diff, not a list price to adjust.
Run it on a schedule and commit the CSV. A price change then shows up as a one-line diff instead of a surprise on the next invoice.
What is in each pricing line?
From the Sume Image API page (read 2026-10-04), each line has three fields.
| Field | Example | Meaning |
|---|---|---|
billable | output_image | What is being charged for |
unit | image | The unit of the charge |
cost_usd | 0.033 | Charge per unit in USD, margin applied |
What is the script?
Some models, such as ChatGPT Image 2.5, bill by tokens, so one model can produce several lines. The script writes them all and leaves the interpretation to you.
import csv, datetime, os, requests
BASE = "https://api.sume.com/v1/images/models"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
def get(url):
r = requests.get(url, headers=H, timeout=30)
r.raise_for_status()
return r.json()
def main():
today = datetime.date.today().isoformat()
with open(f"sume-image-prices-{today}.csv", "w", newline="") as f:
w = csv.writer(f)
w.writerow(["date", "model", "billable", "unit", "cost_usd"])
for m in get(BASE)["data"]:
for ep in get(f"{BASE}/{m['id']}/endpoints")["endpoints"]:
for p in ep["pricing"]:
w.writerow([today, m["id"], p["billable"], p["unit"], p["cost_usd"]])
if __name__ == "__main__":
main()How do I read the diff?
Keep one file per run and compare the latest two with diff or a spreadsheet. New rows mean a new model, removed rows mean a retired one, and a changed cost_usd means a price move. Check the id list before a deploy so a retired model does not become a runtime error.
Is this the same as the price on a finished call?
For per-image models it should match the usage.cost on a 200 response for one image. Token-billed models depend on quality and size, so use the pricing lines as inputs to an estimate and take the real figure from usage.cost. See the model chooser post for ranking models by these numbers.
Sources
Related posts
More in Pricing
- Agent model token prices Oct 4: Argon, Opus, Sonnet, Sol, Grok
Per-million-token prices for the five agent models launched in September, and why the receipt's usage.billable figure leaves the LLM turn out.
- FLUX.2 tiers: cost per 1,000 images at 1 megapixel, klein to max
At one megapixel, BFL's FLUX.2 list prices work out to $15 for klein 4B, $17 for klein 9B, $30 for pro, $60 for flex and $70 for max per 1,000 images.
- FLUX API per-image price: what 500 images cost at $0.024 to $0.048
BFL lists pay-as-you-go FLUX pricing from $0.024 to $0.048 per image with no subscription. Budget tables for 500 and 2,000 images, plus a retry allowance.
- FLUX video upscale cost: megapixel-second examples for a 10 s clip
BFL prices video upscaling at $0.07 (Precise) or $0.10 (Creative) per megapixel-second. Worked totals for 1080p, 2K and 4K output over 10 seconds.
Written by Sume