{"record":{"id":"1e11c1abe7d79f12","repo":"BerriAI/litellm","slug":"failed-to-decrypt-vantage-api-key-check-your-salt","errorCode":null,"errorMessage":"Failed to decrypt Vantage API key. Check your salt key configuration.","messagePattern":"Failed to decrypt Vantage API key\\. Check your salt key configuration\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/spend_tracking/vantage_endpoints.py","lineNumber":102,"sourceCode":"\n    vantage_config: Final = await ConfigRepository(prisma_client).table.find_first(\n        where={\"param_name\": VANTAGE_SETTINGS_PARAM_NAME}\n    )\n    if vantage_config is None or vantage_config.param_value is None:\n        return {}\n\n    if isinstance(vantage_config.param_value, dict):\n        settings = vantage_config.param_value\n    elif isinstance(vantage_config.param_value, str):\n        settings = json.loads(vantage_config.param_value)\n    else:\n        settings = dict(vantage_config.param_value)\n\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=\"vantage_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 Vantage API key. Check your salt key configuration.\"},\n            )\n        settings[\"api_key\"] = decrypted_api_key\n\n    encrypted_integration_token: Final = settings.get(\"integration_token\")\n    if encrypted_integration_token:\n        decrypted_integration_token: Final = decrypt_value_helper(\n            encrypted_integration_token,\n            key=\"vantage_integration_token\",\n            exception_type=\"error\",\n        )\n        if decrypted_integration_token is None:\n            raise HTTPException(\n                status_code=500,\n                detail={\"error\": \"Failed to decrypt Vantage integration token. Check your salt key configuration.\"},\n            )\n        settings[\"integration_token\"] = decrypted_integration_token","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/spend_tracking/vantage_endpoints.py#L84-L120","documentation":"Raised when the stored Vantage api_key in the LiteLLM_Config table cannot be decrypted by decrypt_value_helper, which returns None on failure. Means the value was encrypted with a different or missing LITELLM_SALT_KEY than the one currently configured, so the stored ciphertext is unrecoverable until the salt key is corrected or the setting is re-initialized.","triggerScenarios":"Thrown at litellm/proxy/spend_tracking/vantage_endpoints.py:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure LITELLM_SALT_KEY is unchanged from when the Vantage API key was stored; re-save the key if the salt key rotated."],"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"}