Log these six fields for every Sume image call
Job id, request id, idempotency key, model, quality, and metadata. A short logging helper that lets you recover, dedupe, and report an image failure later.

For every image call, log six things: the job id, Sume's request id, your idempotency key, the model id, the quality, and a metadata tag. With those you can recover a result after a crash, retry safely, and give support what it needs.
Models change often, as Higgsfield's changelog shows with FLUX 3 Image on 2026-10-01 (Higgsfield changelog, read 2026-10-02). Logging the model id and quality per call lets you compare outputs when you switch.
Why these six?
Each answers a question you will ask later. Sume puts the request id in the error body and in response headers, and its docs say to include it when reporting an issue, never an API key or signed URL.
| Field | Why |
|---|---|
| Job id | Recover with status, events, or result instead of resubmitting |
Request id (req_...) | Safe to share with support |
Idempotency-Key | Exact retries; same key on another payload gives 409 |
| Model id | job.model stays sume/auto for Auto |
quality | Cost and result driver |
metadata | Caller tag stored on the job; not sent to the provider |
What does the helper look like?
One function wraps the call and prints a JSON line. The metadata object is stored on the job, so use it for your campaign or SKU tag.
import json
import os
import requests
URL = "https://api.sume.com/v1/images"
HEADERS = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
def generate(prompt: str, key: str, tag: str) -> dict:
body = {"model": "sume/auto", "prompt": prompt, "mode": "async",
"quality": "medium", "metadata": {"campaign": tag}}
r = requests.post(URL, json=body, timeout=60,
headers={**HEADERS, "Idempotency-Key": key})
payload = r.json()
print(json.dumps({
"status": r.status_code,
"request_id": r.headers.get("x-sume-request-id"),
"idempotency_key": key,
"model": body["model"],
"quality": body["quality"],
"campaign": tag,
"job_id": (payload.get("data") or {}).get("job", {}).get("id"),
}))
return payload
generate("Studio shot of a ceramic mug", "mug-001", "autumn-launch")What should I never log?
Never log API keys, signed URLs, or raw media URLs where others can read them. Store the Sume-hosted URL from the result, not provider URLs. The Errors docs describe the request id, and the Image API docs describe metadata.
Sources
Related posts
More in Developers
- Run LTX-2.5 locally: Python 3.12, CUDA 12.7, three routes
The LTX-2.5 model card recommends Python 3.12+, CUDA 12.7+ and PyTorch 2.7, with a CLI, ComfyUI or Diffusers. What a hosted job on Sume replaces.
- Luma Build tier: 10 concurrent Ray jobs, 20 requests a minute
Luma's Build tier allows 10 concurrent Ray video jobs, 20 requests a minute and $5000 a month. How Sume's plan concurrency and queue capacity differ.
- Luma Dream Machine API prompt rules: 3 to 5000 characters
Luma's Dream Machine API rejects prompts under 3 or over 5000 characters, and loop with keyframes. The pre-submit errors, and where Sume's checks live.
- Luma DELETE /generations/{id} returns 204: what Sume does instead
Luma permanently deletes a generation with DELETE and answers 204. Sume has no job delete; it cancels before generation starts. What that means for cleanup.
Written by Sume