{"record":{"id":"7a789772bfb0751c","repo":"BerriAI/litellm","slug":"levoai-api-key-environment-variable-is-required-fo","errorCode":null,"errorMessage":"LEVOAI_API_KEY environment variable is required for Levo integration.","messagePattern":"LEVOAI_API_KEY environment variable is required for Levo integration\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/levo/levo.py","lineNumber":59,"sourceCode":"    def get_levo_config() -> LevoConfig:\n        \"\"\"\n        Retrieves the Levo configuration based on environment variables.\n\n        Returns:\n            LevoConfig: Configuration object containing Levo OTLP settings.\n\n        Raises:\n            ValueError: If required environment variables are missing.\n        \"\"\"\n        # Required environment variables\n        api_key: Final = os.environ.get(\"LEVOAI_API_KEY\", None)\n        org_id: Final = os.environ.get(\"LEVOAI_ORG_ID\", None)\n        workspace_id: Final = os.environ.get(\"LEVOAI_WORKSPACE_ID\", None)\n        collector_url: Final = os.environ.get(\"LEVOAI_COLLECTOR_URL\", None)\n\n        # Validate required env vars\n        if not api_key:\n            raise ValueError(\"LEVOAI_API_KEY environment variable is required for Levo integration.\")\n        if not org_id:\n            raise ValueError(\"LEVOAI_ORG_ID environment variable is required for Levo integration.\")\n        if not workspace_id:\n            raise ValueError(\"LEVOAI_WORKSPACE_ID environment variable is required for Levo integration.\")\n        if not collector_url:\n            raise ValueError(\n                \"LEVOAI_COLLECTOR_URL environment variable is required for Levo integration. \"\n                \"Please contact Levo support to get your collector URL.\"\n            )\n\n        # Use collector URL exactly as provided by the user\n        endpoint: Final = collector_url\n        protocol: Final[Protocol] = \"otlp_http\"\n\n        # Build OTLP headers string\n        # Format: Authorization=Bearer {api_key},x-levo-organization-id={org_id},x-levo-workspace-id={workspace_id}\n        headers_parts: Final = [f\"Authorization=Bearer {api_key}\"]\n        headers_parts.append(f\"x-levo-organization-id={org_id}\")","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/levo/levo.py#L41-L77","documentation":"Configuration guard for the Levo OTLP integration: the LEVOAI_API_KEY environment variable is not set, so the tracer cannot authenticate to the Levo collector and the config getter raises.","triggerScenarios":"Initializing the Levo integration while LEVOAI_API_KEY is unset.","commonSituations":"Env var not exported in the deployment or .env file not loaded.","solutions":["Set the LEVOAI_API_KEY environment variable with your Levo API key."],"exampleFix":"export LEVOAI_API_KEY=...","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}