{"record":{"id":"8122232e8721685e","repo":"HKUDS/nanobot","slug":"openai-model-clean-model-does-not-support-refe","errorCode":null,"errorMessage":"OpenAI model '{clean_model}' does not support reference images; use a GPT Image model","messagePattern":"OpenAI model '(.+?)' does not support reference images; use a GPT Image model","errorType":"exception","errorClass":"ImageGenerationError","httpStatus":null,"severity":"error","filePath":"nanobot/providers/image_generation.py","lineNumber":1233,"sourceCode":"            \"prompt\": prompt,\n        }\n\n        if not _openai_is_gpt_image_model(clean_model):\n            body[\"response_format\"] = \"b64_json\"\n            body[\"n\"] = 1\n\n        size = _openai_size(clean_model, aspect_ratio, image_size)\n        if size:\n            body[\"size\"] = size\n\n        body.update(self.extra_body)\n        # Drop null-valued params so extraBody can opt out of defaults like response_format.\n        body = {key: value for key, value in body.items() if value is not None}\n\n        refs = list(reference_images or [])\n        if refs:\n            if not _openai_is_gpt_image_model(clean_model):\n                raise ImageGenerationError(\n                    f\"OpenAI model '{clean_model}' does not support reference images; \"\n                    \"use a GPT Image model\"\n                )\n            edit_body = _openai_multipart_form_body(body)\n            logger.info(\n                \"OpenAI Images API request: POST {}/images/edits body={} reference_images={}\",\n                self.api_base,\n                edit_body,\n                len(refs),\n            )\n            response = await self._post_image_edit(\n                headers=edit_headers,\n                body=edit_body,\n                reference_images=refs,\n            )\n        else:\n            logger.info(\n                \"OpenAI Images API request: POST {}/images/generations body={}\",","sourceCodeStart":1215,"sourceCodeEnd":1251,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/providers/image_generation.py#L1215-L1251","documentation":"Error \"OpenAI model '{clean_model}' does not support reference images; use a GPT Image model\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/providers/image_generation.py:1233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}