BerriAI/litellm · error · ValueError

PHOENIX_API_KEY must be set when using Phoenix Cloud (app.ph

Error message

PHOENIX_API_KEY must be set when using Phoenix Cloud (app.phoenix.arize.com).

What it means

Error "PHOENIX_API_KEY must be set when using Phoenix Cloud (app.phoenix.arize.com)." thrown in BerriAI/litellm.

Source

Thrown at litellm/integrations/arize/arize_phoenix.py:436

                        endpoint = f"{collector_endpoint}v1/traces"
                    else:
                        endpoint = f"{collector_endpoint}/v1/traces"
                else:
                    endpoint = collector_endpoint
                protocol = "otlp_http"
        else:
            endpoint = "http://localhost:6006/v1/traces"
            protocol = "otlp_http"
            verbose_logger.debug(
                "No PHOENIX_COLLECTOR_ENDPOINT found, using default local Phoenix endpoint: %s", endpoint
            )

        otlp_auth_headers = None
        if api_key is not None:
            auth_header_key = "authorization" if protocol == "otlp_grpc" else "Authorization"
            otlp_auth_headers = f"{auth_header_key}=Bearer {api_key}"
        elif "app.phoenix.arize.com" in endpoint:
            raise ValueError("PHOENIX_API_KEY must be set when using Phoenix Cloud (app.phoenix.arize.com).")

        project_name: Final = os.environ.get("PHOENIX_PROJECT_NAME") or "default"

        return ArizePhoenixConfig(
            otlp_auth_headers=otlp_auth_headers,
            protocol=protocol,
            endpoint=endpoint,
            project_name=project_name,
        )

    async def async_health_check(self):
        config: Final = self.get_arize_phoenix_config()

        if not config.otlp_auth_headers:
            return {
                "status": "unhealthy",
                "error_message": "PHOENIX_API_KEY environment variable not set",
            }

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Set PHOENIX_API_KEY when connecting to Phoenix Cloud (app.phoenix.arize.com).

When it happens

Trigger: Thrown at litellm/integrations/arize/arize_phoenix.py:436 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/ba6a953060eb19f8. Report an issue: GitHub.