{"record":{"id":"ce30a89f0fcabfaf","repo":"odysseus-dev/odysseus","slug":"dall-e-3-doesn-t-support-image-edits-pick-gpt-im","errorCode":null,"errorMessage":"dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2","messagePattern":"dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":1367,"sourceCode":"            height = int(body.get(\"height\") or 1024)\n            # gpt-image-1 only accepts 1024x1024, 1024x1536, 1536x1024 (no 'auto'\n            # for edits). Pick the closest to preserve aspect, default square.\n            if width > height * 1.15:\n                size = \"1536x1024\"\n            elif height > width * 1.15:\n                size = \"1024x1536\"\n            else:\n                size = \"1024x1024\"\n\n            files = {\n                \"image\": (\"source.png\", src_buf.getvalue(), \"image/png\"),\n                \"mask\": (\"mask.png\", mask_buf.getvalue(), \"image/png\"),\n            }\n            # Honor explicit model selection from the editor; fall back to gpt-image-1.\n            # dall-e-3 has no edit endpoint — refuse it loudly so the user picks again.\n            oa_model = chosen_model or \"gpt-image-1\"\n            if \"dall-e-3\" in oa_model:\n                raise HTTPException(400, \"dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2\")\n            data = {\n                \"model\": oa_model,\n                \"prompt\": body.get(\"prompt\", \"\"),\n                \"size\": size,\n                \"n\": \"1\",\n            }\n            headers = {\"Authorization\": f\"Bearer {api_key}\"}\n            try:\n                async with httpx.AsyncClient(timeout=120) as client:\n                    r = await client.post(_join_checked_gallery_endpoint(base, \"/images/edits\"), headers=headers, data=data, files=files)\n                    if r.status_code != 200:\n                        logger.error(\"inpaint_proxy OpenAI edit: status %s\", r.status_code)\n                        raise HTTPException(r.status_code, \"OpenAI edit failed\")\n                    result = r.json()\n                    raw_b64 = None\n                    if result.get(\"data\"):\n                        item = result[\"data\"][0]\n                        # gpt-image-1 returns b64_json by default; dall-e-2 may return url","sourceCodeStart":1349,"sourceCodeEnd":1385,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L1349-L1385","documentation":"Error \"dall-e-3 doesn't support image edits — pick gpt-image-1 or dall-e-2\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Pick gpt-image-1 or dall-e-2 for image edits.","Use dall-e-3 only for text-to-image generation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}