BerriAI/litellm · error · OCIError

kwarg `messages` must be an array of messages that follow th

Error message

kwarg `messages` must be an array of messages that follow the openai chat standard

What it means

Error "kwarg `messages` must be an array of messages that follow the openai chat standard" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/oci/chat/transformation.py:407

            api_base=api_base,
            api_key=api_key,
            model=model,
            stream=stream,
            fake_stream=fake_stream,
        )

    def validate_environment(
        self,
        headers: dict,
        model: str,
        messages: list[AllMessageValues],
        optional_params: dict,
        litellm_params: dict,
        api_key: str | None = None,
        api_base: str | None = None,
    ) -> dict:
        if not messages:
            raise OCIError(
                status_code=400,
                message="kwarg `messages` must be an array of messages that follow the openai chat standard",
            )
        if optional_params.get("oci_signer") is None:
            creds: Final = resolve_oci_credentials(optional_params)
            missing: Final = [
                k
                for k in (
                    "oci_user",
                    "oci_fingerprint",
                    "oci_tenancy",
                    "oci_compartment_id",
                )
                if not creds.get(k)
            ]
            if missing or not (creds.get("oci_key") or creds.get("oci_key_file")):
                raise OCIError(
                    status_code=401,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Pass messages as an array of OpenAI-standard chat messages.

When it happens

Trigger: Thrown at litellm/llms/oci/chat/transformation.py:407 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/e45dc0b70baca82a. Report an issue: GitHub.