{"record":{"id":"9c100d7d217378d1","repo":"BerriAI/litellm","slug":"refusing-to-send-the-server-configured-credential","errorCode":null,"errorMessage":"Refusing to send the server-configured {credential_name} to the caller-supplied api_base '{caller_api_base}'. Pass an explicit api_key when overriding api_base for this search provider.","messagePattern":"Refusing to send the server-configured (.+?) to the caller-supplied api_base '(.+?)'\\. Pass an explicit api_key when overriding api_base for this search provider\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/search/transformation.py","lineNumber":138,"sourceCode":"        self,\n        caller_api_base: str | None,\n        default_api_base: str | None,\n        base_env_var: str | None,\n        credential_name: str,\n    ) -> None:\n        \"\"\"\n        Block sending a server-managed credential to a caller-chosen host.\n\n        A caller-supplied api_base is honored when constructing the request URL, so\n        falling back to a server-configured secret while the caller controls the host\n        leaks that secret. The provider default and the operator's own api_base\n        override are the only trusted destinations for a server-managed credential.\n        \"\"\"\n        if not caller_api_base:\n            return\n        if _is_trusted_search_api_base(caller_api_base, default_api_base, base_env_var):\n            return\n        raise ValueError(\n            f\"Refusing to send the server-configured {credential_name} to the \"\n            f\"caller-supplied api_base '{caller_api_base}'. Pass an explicit api_key \"\n            f\"when overriding api_base for this search provider.\"\n        )\n\n    def resolve_server_api_key(\n        self,\n        *,\n        caller_api_key: str | None,\n        caller_api_base: str | None,\n        key_env_vars: tuple[str, ...],\n        base_env_var: str | None,\n        default_api_base: str | None,\n    ) -> str | None:\n        \"\"\"\n        Resolve a single-secret search API key, falling back to a server-managed\n        secret only when the request targets a trusted host.\n","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/base_llm/search/transformation.py#L120-L156","documentation":"Error \"Refusing to send the server-configured {credential_name} to the caller-supplied api_base '{caller_api_base}'. Pass an explicit api_key when overriding api_base for this search provider.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/base_llm/search/transformation.py:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an explicit api_key for the caller-supplied api_base instead of relying on the server-configured credential.","Remove the api_base override to use the server-configured endpoint and credential.","Ensure the overridden api_base matches the provider's expected host."],"exampleFix":null,"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"}