{"record":{"id":"6644a4ef556f6be1","repo":"BerriAI/litellm","slug":"e2b-api-key-not-set-set-e2b-api-key-or-pass-api-k","errorCode":null,"errorMessage":"E2B API key not set. Set E2B_API_KEY or pass api_key=...","messagePattern":"E2B API key not set\\. Set E2B_API_KEY or pass api_key=\\.\\.\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/e2b/sandbox/transformation.py","lineNumber":45,"sourceCode":"\nE2B_API_BASE: Final = \"https://api.e2b.app\"\nE2B_DEFAULT_TEMPLATE: Final = \"code-interpreter-v1\"\nE2B_DEFAULT_DOMAIN: Final = \"e2b.app\"\nJUPYTER_PORT: Final = 49999\nDEFAULT_SANDBOX_TIMEOUT: Final = 300\nMAX_OUTPUT_BYTES: Final = SANDBOX_MAX_OUTPUT_BYTES\n\n\nclass E2BSandboxConfig(BaseSandboxConfig):\n    def _http(self, client: AsyncHTTPHandler | None) -> AsyncHTTPHandler:\n        if client is not None:\n            return client\n        return get_async_httpx_client(llm_provider=httpxSpecialProvider.Sandbox)\n\n    def validate_environment(self, api_key: str | None = None, **kwargs) -> str:\n        key: Final = api_key or get_secret_str(\"E2B_API_KEY\")\n        if not key:\n            raise ValueError(\"E2B API key not set. Set E2B_API_KEY or pass api_key=...\")\n        return key\n\n    async def acreate_sandbox(\n        self,\n        *,\n        template: str | None = None,\n        timeout: int | None = None,\n        allow_internet_access: bool | None = None,\n        api_key: str | None = None,\n        api_base: str | None = None,\n        metadata: dict | None = None,\n        client: AsyncHTTPHandler | None = None,\n        **kwargs,\n    ) -> ContainerHandle:\n        key: Final = self.validate_environment(api_key=api_key)\n        base: Final = api_base or E2B_API_BASE\n        body: Final = {\n            \"templateID\": template or E2B_DEFAULT_TEMPLATE,","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/e2b/sandbox/transformation.py#L27-L63","documentation":"Error \"E2B API key not set. Set E2B_API_KEY or pass api_key=...\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/e2b/sandbox/transformation.py:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set E2B_API_KEY or pass api_key."],"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-15T17:31:12.345Z"}