Music API image_url null: clear a reused request body, with Python
Send image_url as null on Sume music requests only to clear an image from a reused request object. A short urllib script posts to the Music Router.

On Sume's music routes, image_url is a public HTTPS image, or null to clear it. The Music 1.0 page says to send null only when you intentionally clear an image input on a client that reuses request objects. If you build each body from scratch, omit the field. The null is for the case where a shared payload object still carries last scene's image.
Why it exists
A script that generates music for several scenes often keeps one request dict and mutates it. Scene one passes a still as image_url. Scene two has no still, and a stale value would condition the new track on the wrong image. Setting the field to null clears it.
Python sample
This posts to POST /v1/music-router/generate with the standard library. It reads the key from SUME_API_KEY and sets an Idempotency-Key. The prompt controls length, because duration is rejected.
import json, os, urllib.request
body = {
"model": "sume/music-auto",
"prompt": "Warm lo-fi hip hop, 84 BPM, C minor. Dusty Rhodes chords, brushed drums. A 30-second track. Instrumental, no vocals.",
"image_url": None,
}
req = urllib.request.Request(
"https://api.sume.com/v1/music-router/generate",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["SUME_API_KEY"],
"Content-Type": "application/json",
"Idempotency-Key": "music-null-image-001",
},
method="POST",
)
with urllib.request.urlopen(req) as resp:
job = json.load(resp)
print(job.get("id"), job.get("status"))Rules for the field
The price does not change with image conditioning: the Music 1.0 page lists a fixed $0.125 per accepted generation. The job returns a result you read with GET /v1/jobs/:id/result, and job.request.routed_model names the engine that ran.
| Value | Meaning |
|---|---|
| Omitted | No image conditioning. |
| Public HTTPS URL | Image-conditioned generation. |
| null | Clear an image carried in a reused request object. |
| Non-HTTPS or private URL | Not valid; image URLs must be public HTTPS. |
After the call
The job is async by default. The response gives you a job id, and you read GET /v1/jobs/:id/status and then /result. If you add mode: "sync", set wait_timeout_seconds between 0 and 30, and expect a 202 if the track is not done in time.
The result has the track as a Sume media URL. The docs say to use these URLs, because raw provider URLs are not public outputs.
If you pass a still to condition on, the Music page recommends passing the accepted scene still as image_url when a project wants a score that follows its scenes. For a project that asks for one consistent score, keep continuity in the prompt axes.
Sources
Related posts
More in Developers
- Nano Banana 2 Lite's 10 aspect ratios: what to send for 4:5
Lite accepts 10 ratios including 4:5 and 21:9. On Sume, Instagram 1080x1350 is aspect_ratio 4:5, and Nano Banana Pro or 2 list it; Imagen and Grok do not.
- Nano Banana 2 reference slots (10+4+3) vs Sume's flat reference list
Google splits Nano Banana 2 references into 10 object, 4 character and 3 style slots. Sume's input_references is one flat list capped at 10, with no slots.
- Nano Banana 2 thinking_level minimal or high: not on Sume
Google offers thinking_level minimal or high on the Nano Banana 2 variants. Sume's Image API has no such field, so sending it returns 400 unsupported_parameter.
- Native audio in stitched AI clips: which Sume models force it
Gemini Omni Flash 1.1 always makes audio, H3 Max adds stereo, Seedance 2 can. A stitched Timeline render takes its audio from the spine, so plan the sound.
Written by Sume