BerriAI/litellm · error · OpenAIError

raw_response.text

Error message

raw_response.text

What it means

Error "raw_response.text" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/azure_ai/image_edit/mai_transformation.py:166

                    self._add_image_to_files(
                        files_list=files_list,
                        image=_image,
                        field_name="image",
                    )
                    break

        return data_without_files, files_list

    def transform_image_edit_response(
        self,
        model: str,
        raw_response: httpx.Response,
        logging_obj: "LiteLLMLoggingObj",
    ) -> ImageResponse:
        try:
            response: Final = raw_response.json()
        except Exception:
            raise OpenAIError(message=raw_response.text, status_code=raw_response.status_code)

        if "usage" in response:
            response["usage"] = AzureFoundryMAIImageGenerationConfig.normalize_mai_image_usage(response.get("usage"))

        logging_obj.post_call(
            input="",
            api_key="",
            additional_args={"complete_input_dict": {}},
            original_response=response,
        )

        return convert_to_model_response_object(
            response_object=response,
            model_response_object=ImageResponse(),
            response_type="image_generation",
        )

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the Azure AI error response body for details.

When it happens

Trigger: Thrown at litellm/llms/azure_ai/image_edit/mai_transformation.py:166 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/58b12748e6073be8. Report an issue: GitHub.