{"record":{"id":"8fbe081f65abe254","repo":"BerriAI/litellm","slug":"advisor-tool-definition-sets-api-base-without-a","errorCode":null,"errorMessage":"advisor tool definition sets 'api_base' without 'api_key'. A caller-supplied api_base is only honored alongside a caller-supplied api_key, so the proxy's own credentials are never sent to a caller-chosen destination.","messagePattern":"advisor tool definition sets 'api_base' without 'api_key'\\. A caller-supplied api_base is only honored alongside a caller-supplied api_key, so the proxy's own credentials are never sent to a caller-chosen destination\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py","lineNumber":214,"sourceCode":"    the caller-chosen ``api_base``. A caller-supplied ``api_base`` is also\n    required to be https with TLS verification on, and SSRF-validated so it\n    can't target a private/internal/cloud-metadata address, mirroring\n    ``proxy.auth.auth_utils.check_complete_credentials``. https with TLS\n    verification is required because ``validate_url`` only rewrites the\n    connection to a DNS-pinned IP for http, or for https with\n    ``litellm.ssl_verify`` disabled; otherwise it returns the URL unchanged\n    and relies on certificate validation to block DNS rebinding, so this\n    closes the same gap without threading the pinned URL through the whole\n    ``anthropic_messages()`` call chain.\n    \"\"\"\n    if not _allow_client_side_advisor_credentials():\n        return None, None\n    api_key: Final[str | None] = advisor_tool.get(\"api_key\")\n    api_base: Final[str | None] = advisor_tool.get(\"api_base\")\n    if api_base is None:\n        return api_key, None\n    if not api_key:\n        raise ValueError(\n            \"advisor tool definition sets 'api_base' without 'api_key'. A \"\n            \"caller-supplied api_base is only honored alongside a \"\n            \"caller-supplied api_key, so the proxy's own credentials are \"\n            \"never sent to a caller-chosen destination.\"\n        )\n    if not api_base.startswith(\"https://\"):\n        raise ValueError(f\"advisor tool definition sets 'api_base'={api_base!r}, which must use the https scheme.\")\n    if getattr(litellm, \"ssl_verify\", True) is False:\n        raise ValueError(\n            \"advisor tool definition sets 'api_base' but the proxy has TLS verification \"\n            \"disabled (litellm.ssl_verify=False), so a caller-supplied api_base can't be \"\n            \"safely validated against DNS rebinding.\"\n        )\n    if getattr(litellm, \"user_url_validation\", True):\n        validate_url(api_base)\n    return api_key, api_base\n\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py#L196-L232","documentation":"Error \"advisor tool definition sets 'api_base' without 'api_key'. A caller-supplied api_base is only honored alongside a caller-supplied api_key, so the proxy's own credentials are never sent to a caller-chosen destination.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide 'api_key' alongside 'api_base' in the advisor tool definition, or remove the custom api_base."],"exampleFix":null,"handlingStrategy":null,"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"}