YouTube thumbnail test set: n=4 on GPT Image 2.5 high may return 202
Four 1280x720 thumbnail takes cost $0.1425 on GPT Image 2.5 high via Sume, and a slow call can return 202 instead of 200. A Python client that handles both.
A four-take thumbnail test set at 1280x720 on ChatGPT Image 2.5 high costs about $0.1425 on Sume ($0.0356 each), and the call may come back as 202 instead of 200. Sume's image route waits up to 30 seconds, then returns a job envelope if the work is not done; the Image API docs name high quality, 4K and a large n as the likeliest slow configurations. Branch on the status code, not on the body shape.
Treat both outcomes as success. A 202 means Sume accepted and is still working; do not submit again.
What does the client look like?
On 200 the images are in data[].url. On 202 you poll the status URL and fetch the result, and the artifacts carry the Sume-hosted URLs.
import os, time, requests
B = "https://api.sume.com/v1"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
r = requests.post(f"{B}/images", headers={**H, "Idempotency-Key": "thumb-ep42"},
timeout=60, json={"model": "openai/gpt-image-2.5", "n": 4,
"prompt": "YouTube thumbnail: shocked chef, steaming pot, bold empty space left",
"image_size": {"width": 1280, "height": 720}, "quality": "high"})
r.raise_for_status()
if r.status_code == 200:
print([d["url"] for d in r.json()["data"]])
else:
job = r.json()["data"]["job"]["id"]
while not requests.get(f"{B}/jobs/{job}/status", headers=H, timeout=60).json().get("data", {}).get("terminal"):
time.sleep(5)
print(requests.get(f"{B}/jobs/{job}/result", headers=H, timeout=60).json())What does the test set cost by quality?
Four 1280x720 takes of one prompt, no references. Lower tiers are less likely to cross the 30-second wait.
| Quality | Per take | Four takes |
|---|---|---|
| low | $0.0040 | $0.016 |
| medium | $0.00925 | $0.037 |
| high | $0.0356 | $0.1425 |
| xhigh | $0.0631 | $0.2525 |
What about retries?
Reuse the same Idempotency-Key on a retry of the same request, so a lost response returns the original job rather than starting and billing a second one. A client timeout does not cancel the job, so keep the job id. 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
- Zed context_servers for the hosted Sume server: no header means OAuth
Add the hosted Sume server to Zed's settings.json context_servers with a url. With no Authorization header Zed runs the MCP OAuth flow, so start with mcp:read.
- Which MCP server lets Claude Code or Cursor generate video and images?
MCP servers that let Claude Code and Cursor make video and images: Sume, fal, Replicate, Runway, Higgsfield. Endpoints, sign-in, billing, setup.
- Idempotency keys for AI video APIs: retry without paying twice
An idempotency key makes a retried create return the original run or job instead of a second paid one. How Sume's Idempotency-Key works on each API.
- Signed webhooks for Sume video runs: events, retries, verification
Sume sends one HMAC-SHA256 signed POST when a Format, Action, or Agent Completion run completes or fails. Verify the raw body and dedupe on request_id.
Written by Sume