{"record":{"id":"338652968e4e8398","repo":"BerriAI/litellm","slug":"admin-only-endpoint-not-allowed-to-access-this-338652","errorCode":null,"errorMessage":"Admin-only endpoint. Not allowed to access this.","messagePattern":"Admin-only endpoint\\. Not allowed to access this\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"litellm/proxy/spend_tracking/vantage_endpoints.py","lineNumber":142,"sourceCode":"\n@router.get(\n    \"/vantage/settings\",\n    tags=[\"Vantage\"],\n    dependencies=[Depends(user_api_key_auth)],\n    response_model=VantageSettingsView,\n)\nasync def get_vantage_settings(\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n):\n    \"\"\"\n    View current Vantage settings.\n\n    Returns the current Vantage configuration with the API key masked for security.\n    Only admin users (Proxy Admin or Admin Viewer) can view Vantage settings.\n    \"\"\"\n    # Admin Viewer follows the read-parity rule.\n    if not _user_has_admin_view(user_api_key_dict):\n        raise HTTPException(\n            status_code=403,\n            detail={\"error\": CommonProxyErrors.not_allowed_access.value},\n        )\n\n    try:\n        settings: Final = await _get_vantage_settings()\n\n        if not settings:\n            return VantageSettingsView(\n                api_key_masked=None,\n                integration_token_masked=None,\n                base_url=None,\n                status=None,\n            )\n\n        masked_settings: Final = _sensitive_masker.mask_dict(settings)\n\n        return VantageSettingsView(","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/spend_tracking/vantage_endpoints.py#L124-L160","documentation":"Standard admin gate for GET /vantage/settings: the caller's authenticated key lacks proxy-admin or admin-viewer role, so the read-parity check _user_has_admin_view returned False. Fires whenever a non-admin virtual key tries to view Vantage configuration.","triggerScenarios":"Thrown at litellm/proxy/spend_tracking/vantage_endpoints.py:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call this endpoint with a proxy admin (master) key instead of a regular virtual key."],"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-14T05:17:10.506Z"}