{"record":{"id":"eb57ef34f36fab83","repo":"BerriAI/litellm","slug":"invalid-size-format-size-expected-format-wi","errorCode":null,"errorMessage":"Invalid size format: '{size}'. Expected format 'WIDTHxHEIGHT' (e.g., '1024x1024').","messagePattern":"Invalid size format: '(.+?)'\\. Expected format 'WIDTHxHEIGHT' \\(e\\.g\\., '1024x1024'\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/image_edit/mai_transformation.py","lineNumber":80,"sourceCode":"\n    def _validate_size_param(self, size: str) -> None:\n        known_sizes: Final = {\n            \"1024x1024\",\n            \"1792x1024\",\n            \"1024x1792\",\n            \"512x512\",\n            \"256x256\",\n        }\n\n        if size in known_sizes:\n            return\n\n        if \"x\" in size:\n            try:\n                tuple(map(int, size.lower().split(\"x\", 1)))\n                return\n            except ValueError:\n                raise ValueError(f\"Invalid size format: '{size}'. Expected format 'WIDTHxHEIGHT' (e.g., '1024x1024').\")\n\n        raise ValueError(\n            f\"Unsupported size value: '{size}'. Use a known size (e.g., '1024x1024') or a custom 'WIDTHxHEIGHT' string.\"\n        )\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        api_key: str | None = None,\n        litellm_params: dict | None = None,\n        api_base: str | None = None,\n    ) -> dict:\n        api_key = AzureFoundryModelInfo.get_api_key(api_key)\n\n        if not api_key:\n            raise ValueError(\n                f\"Azure AI API key is required for model {model}. \"","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/image_edit/mai_transformation.py#L62-L98","documentation":"Error \"Invalid size format: '{size}'. Expected format 'WIDTHxHEIGHT' (e.g., '1024x1024').\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/image_edit/mai_transformation.py:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the 'WIDTHxHEIGHT' format, e.g. '1024x1024'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}