{"record":{"id":"86461dda891e9fff","repo":"odysseus-dev/odysseus","slug":"choose-a-registered-image-endpoint","errorCode":null,"errorMessage":"Choose a registered image endpoint","messagePattern":"Choose a registered image endpoint","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"routes/gallery/gallery_routes.py","lineNumber":1298,"sourceCode":"        if not requested_base:\n            db = SessionLocal()\n            try:\n                ep = _first_visible_image_endpoint(db, user)\n                if not ep:\n                    raise HTTPException(400, \"No image generation endpoint configured. Serve a diffusion model via Cookbook first.\")\n                base = ep.base_url.rstrip(\"/\")\n                api_key = ep.api_key\n            finally:\n                db.close()\n        else:\n            # Resolve the client-supplied base to a registered visible endpoint.\n            # Admins are not exempted — gallery proxy routes must use a DB row\n            # so the outbound URL never depends directly on request-body input.\n            db = SessionLocal()\n            try:\n                ep = _visible_image_endpoint_for_base(db, requested_base, user)\n                if not ep:\n                    raise HTTPException(403, \"Choose a registered image endpoint\")\n                base = ep.base_url.rstrip(\"/\")\n                api_key = ep.api_key\n            finally:\n                db.close()\n\n        if not base.endswith(\"/v1\"):\n            base += \"/v1\"\n\n        is_openai = _is_openai_api_base(base)\n\n        if is_openai:\n            # OpenAI path: /v1/images/edits with gpt-image-1.\n            # Mask convention differs from Stable Diffusion:\n            #   SD:     white pixels = regenerate, black = keep\n            #   OpenAI: transparent alpha = regenerate, opaque = keep\n            # So we convert the incoming PNG mask into an alpha-channel PNG.\n            if not api_key:\n                raise HTTPException(400, \"OpenAI endpoint has no api_key stored — edit it in Endpoints settings.\")","sourceCodeStart":1280,"sourceCodeEnd":1316,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/gallery/gallery_routes.py#L1280-L1316","documentation":"Error \"Choose a registered image endpoint\" 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 one of the registered image endpoints from the dropdown.","Register the endpoint first in Settings if it is missing."],"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-15T17:31:12.345Z"}