{"record":{"id":"a3ae18e42aa9c031","repo":"HKUDS/nanobot","slug":"missing-key-message","errorCode":null,"errorMessage":"{missing_key_message}","messagePattern":"\\{missing_key_message\\}","errorType":"exception","errorClass":"ImageGenerationError","httpStatus":null,"severity":"error","filePath":"nanobot/providers/image_generation.py","lineNumber":382,"sourceCode":"    model_options = (\"openai/gpt-5.4-image-2\",)\n    missing_key_message = (\n        \"OpenRouter API key is not configured. Set providers.openrouter.apiKey.\"\n    )\n\n    def _default_base_url(self) -> str:\n        return \"https://openrouter.ai/api/v1\"\n\n    async def generate(\n        self,\n        *,\n        prompt: str,\n        model: str,\n        reference_images: list[str] | None = None,\n        aspect_ratio: str | None = None,\n        image_size: str | None = None,\n    ) -> GeneratedImageResponse:\n        if not self.api_key:\n            raise ImageGenerationError(self.missing_key_message)\n\n        content: str | list[dict[str, Any]]\n        references = list(reference_images or [])\n        if references:\n            blocks: list[dict[str, Any]] = [{\"type\": \"text\", \"text\": prompt}]\n            blocks.extend(\n                {\"type\": \"image_url\", \"image_url\": {\"url\": image_path_to_data_url(path)}}\n                for path in references\n            )\n            content = blocks\n        else:\n            content = prompt\n\n        body: dict[str, Any] = {\n            \"model\": model,\n            \"messages\": [{\"role\": \"user\", \"content\": content}],\n            \"modalities\": [\"image\", \"text\"],\n            \"stream\": False,","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/providers/image_generation.py#L364-L400","documentation":"Error \"{missing_key_message}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/providers/image_generation.py:382 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"}