Nova Canvas boto3 read timeout vs Sume's 30 second wait and 202

The AWS SDK read timeout is 60 s and Amazon suggests 300 s for Nova Canvas. Sume's /v1/images waits 30 s, then returns a 202 job. Handle both in Python.

4 min readSume
All posts

A Nova Canvas call that times out in boto3 and a Sume call that returns 202 look like the same bug. They are not. One is a client timeout that you set; the other is a documented answer that tells you to poll.

What each side says

Timeouts and slow requests (Amazon docs, read 2026-10-06; Sume docs)
TopicNova Canvas via AWS SDKSume /v1/images
Default waitSDK read_timeout is 60 swait_timeout_seconds defaults to 30, the platform ceiling
AdviceAmazon recommends at least 300 sBranch on status code
When the wait endsClient times out202 with a job envelope, status_url and result_url
FailureException502 error envelope with retryable and next_action

Handle the three answers

On Sume, 200 means images are in the body, 202 means the job is still running, and 502 means it failed. Do not raise a timeout on 202. Poll status_url until the job is terminal, then read result_url. You can also pass mode: "async" to skip the wait, or mode: "webhook" with a webhook_url.

import os, time, requests

H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
r = requests.post("https://api.sume.com/v1/images", headers=H, timeout=60, json={
    "model": "ideogram/ideogram-v4.5", "quality": "high", "resolution": "2K",
    "prompt": "Add soft window light from the left. Keep the product unchanged.",
    "input_references": [{"type": "image_url", "image_url": {"url": "https://example.com/lamp.jpg"}}]})
if r.status_code == 200:
    print(r.json()["data"][0]["url"])
elif r.status_code == 202:
    job = r.json().get("job", r.json())
    while True:
        s = requests.get(job["status_url"], headers=H, timeout=30).json()
        if s.get("status") in ("completed", "failed"):
            break
        time.sleep(3)
    print(s.get("status"), job["result_url"])
else:
    print(r.status_code, r.json()["error"]["next_action"])

The envelope field names come from the Sume docs on jobs and results; check them against a real 202 before you ship.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume