Alert when a Sume image model price changes: Python snapshot script
Compare the billed price of every Sume image model against a saved snapshot with two endpoints and a JSON file, and print only the rows that changed.

Run GET /v1/images/models, fetch each model's endpoints record, and compare pricing[0].cost_usd with a JSON snapshot; the script below prints a line for every model whose billed price changed or that is new. It needs two endpoints and about 25 lines of Python.
The price is the amount charged to your wallet per image, with Sume's margin already applied, so an alert on this field is an alert on your own bill. Facts are from the Sume Image API docs (read 2026-10-03).
What the two endpoints return
Sume serves every model through a single sume endpoint in v1, so endpoints[0] is the only record. Rows with state-dependent prices (ChatGPT Image 2.5 by quality and size, Nano Banana by resolution, Ideogram 4.5 by quality) report the default-tier price, which is the figure the alert tracks.
| Endpoint | Gives you | Field used |
|---|---|---|
| GET /v1/images/models | Every catalog model with capabilities | data[].id |
| GET /v1/images/models/{model_id}/endpoints | Per-endpoint capabilities and billed pricing | endpoints[0].pricing[0].cost_usd |
The script
Run it from a scheduler once a day. The first run writes the snapshot and reports every model as new; later runs report changes only.
import json
import os
import pathlib
import requests
BASE = "https://api.sume.com/v1/images/models"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
SNAP = pathlib.Path("image-prices.json")
def get(url):
r = requests.get(url, headers=H, timeout=30)
r.raise_for_status()
body = r.json()
return body.get("data", body)
def main():
old = json.loads(SNAP.read_text()) if SNAP.exists() else {}
new = {}
for m in get(BASE):
ep = get(f"{BASE}/{m['id']}/endpoints")["endpoints"][0]
new[m["id"]] = ep["pricing"][0]["cost_usd"]
if old.get(m["id"]) != new[m["id"]]:
print(m["id"], old.get(m["id"]), "->", new[m["id"]])
SNAP.write_text(json.dumps(new, indent=1))
if __name__ == "__main__":
main()What to do with an alert
A change in a row you use is a budget input, not an incident: recompute the cost of your standing jobs (images per run times the new price) and decide whether to keep the model. Jobs already submitted are not repriced, since the amount is reserved on submit.
Keep the snapshot file in version control so a price move shows up in a diff next to the code that depends on it.
- Alert on new ids as well: a new model row is a chance to cut cost on a standing job.
- Log
usage.costfrom real responses and compare it with the snapshot weekly. - Do not hard-code prices in application code; read the snapshot.
Sources
Related posts
More in Developers
- Amazon Sponsored Brands video: Sume fps 24-30 fit; 60 and 4K do not
Amazon lists 23.976 to 30 fps and 1280x720, 1920x1080 or 3840x2160. Sume trim offers 24, 25, 30 or 60 fps and stops at 2160 per edge. Which settings line up.
- Android adaptive icon: 108 dp layers, 66 dp safe zone, from Sume
Adaptive icon layers are 108 x 108 dp with a 66 x 66 dp visible zone and 18 dp margins. Generate a transparent foreground on Sume and scale it inside the zone.
- Animate a picture with Kling 3 via API: Python first-frame request
To animate one picture with Kling 3 on Sume, send it as a first_frame in frame_images to POST /v1/videos with model kling-3. Full Python script included.
- 2026 API client checklist from three open specs, and where Sume stands
Three public specs shape a 2026 API client: RateLimit headers, Idempotency-Key, Standard Webhooks. What each says, and what Sume's API does instead.
Written by Sume