BerriAI/litellm · error · HTTPException

Failed to decrypt CloudZero API key. Check your salt key con

Error message

Failed to decrypt CloudZero API key. Check your salt key configuration.

What it means

Error "Failed to decrypt CloudZero API key. Check your salt key configuration." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/spend_tracking/cloudzero_endpoints.py:104

        where={"param_name": "cloudzero_settings"}
    )
    if cloudzero_config is None or cloudzero_config.param_value is None:
        return {}

    # Handle both dict and JSON string cases
    if isinstance(cloudzero_config.param_value, dict):
        settings = cloudzero_config.param_value
    elif isinstance(cloudzero_config.param_value, str):
        settings = json.loads(cloudzero_config.param_value)
    else:
        settings = dict(cloudzero_config.param_value)

    # Decrypt the API key
    encrypted_api_key: Final = settings.get("api_key")
    if encrypted_api_key:
        decrypted_api_key = decrypt_value_helper(encrypted_api_key, key="cloudzero_api_key", exception_type="error")
        if decrypted_api_key is None:
            raise HTTPException(
                status_code=500,
                detail={"error": "Failed to decrypt CloudZero API key. Check your salt key configuration."},
            )
        settings["api_key"] = decrypted_api_key

    return settings


@router.get(
    "/cloudzero/settings",
    tags=["CloudZero"],
    dependencies=[Depends(user_api_key_auth)],
    response_model=CloudZeroSettingsView,
)
async def get_cloudzero_settings(
    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
    """

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Ensure LITELLM_SALT_KEY matches the key used when the CloudZero API key was encrypted; re-enter the API key if the salt changed.

When it happens

Trigger: Thrown at litellm/proxy/spend_tracking/cloudzero_endpoints.py:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/dd6fca0e42161dd9. Report an issue: GitHub.