{"record":{"id":"dd6fca0e42161dd9","repo":"BerriAI/litellm","slug":"failed-to-decrypt-cloudzero-api-key-check-your-sa","errorCode":null,"errorMessage":"Failed to decrypt CloudZero API key. Check your salt key configuration.","messagePattern":"Failed to decrypt CloudZero API key\\. Check your salt key configuration\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/spend_tracking/cloudzero_endpoints.py","lineNumber":104,"sourceCode":"        where={\"param_name\": \"cloudzero_settings\"}\n    )\n    if cloudzero_config is None or cloudzero_config.param_value is None:\n        return {}\n\n    # Handle both dict and JSON string cases\n    if isinstance(cloudzero_config.param_value, dict):\n        settings = cloudzero_config.param_value\n    elif isinstance(cloudzero_config.param_value, str):\n        settings = json.loads(cloudzero_config.param_value)\n    else:\n        settings = dict(cloudzero_config.param_value)\n\n    # Decrypt the API key\n    encrypted_api_key: Final = settings.get(\"api_key\")\n    if encrypted_api_key:\n        decrypted_api_key = decrypt_value_helper(encrypted_api_key, key=\"cloudzero_api_key\", exception_type=\"error\")\n        if decrypted_api_key is None:\n            raise HTTPException(\n                status_code=500,\n                detail={\"error\": \"Failed to decrypt CloudZero API key. Check your salt key configuration.\"},\n            )\n        settings[\"api_key\"] = decrypted_api_key\n\n    return settings\n\n\n@router.get(\n    \"/cloudzero/settings\",\n    tags=[\"CloudZero\"],\n    dependencies=[Depends(user_api_key_auth)],\n    response_model=CloudZeroSettingsView,\n)\nasync def get_cloudzero_settings(\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),\n):\n    \"\"\"","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/spend_tracking/cloudzero_endpoints.py#L86-L122","documentation":"Error \"Failed to decrypt CloudZero API key. Check your salt key configuration.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/spend_tracking/cloudzero_endpoints.py:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure LITELLM_SALT_KEY matches the key used when the CloudZero API key was encrypted; re-enter the API key if the salt changed."],"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-14T00:17:10.932Z"}