BerriAI/litellm · error · ValueError

integration_token must be provided for Vantage destination (

Error message

integration_token must be provided for Vantage destination (set VANTAGE_INTEGRATION_TOKEN env var or pass in destination_config)

What it means

FocusVantageDestination.__init__ raises ValueError when api_key is present but integration_token is missing. Vantage's cost-import API authenticates with a pair: an account-level API key plus a per-integration token; both are mandatory, and this check runs after the api_key check.

Source

Thrown at litellm/integrations/focus/destinations/vantage_destination.py:108

class FocusVantageDestination(FocusDestination):
    """Upload FOCUS CSV exports to the Vantage cost-import API."""

    def __init__(
        self,
        *,
        prefix: str,
        config: dict[str, Any] | None = None,
    ) -> None:
        config = config or {}
        api_key: Final = config.get("api_key")
        integration_token: Final = config.get("integration_token")
        if not api_key:
            raise ValueError(
                "api_key must be provided for Vantage destination "
                "(set VANTAGE_API_KEY env var or pass in destination_config)"
            )
        if not integration_token:
            raise ValueError(
                "integration_token must be provided for Vantage destination "
                "(set VANTAGE_INTEGRATION_TOKEN env var or pass in destination_config)"
            )
        self.api_key = api_key
        self.integration_token = integration_token
        self.base_url = config.get("base_url", "https://api.vantage.sh")
        self.prefix = prefix

    async def deliver(
        self,
        *,
        content: bytes,
        time_window: FocusTimeWindow,
        filename: str,
    ) -> None:
        """Upload CSV content to the Vantage API, batching if needed."""
        if not content:
            verbose_logger.debug("Vantage destination: empty content, skipping upload")

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Create the integration token in the Vantage UI (Entities → Integrations) and set export VANTAGE_INTEGRATION_TOKEN=....
  2. Or pass it in config together with the API key.
  3. Re-run the export once both credentials are present.

Example fix

# before
config = {"api_key": "vt_..."}

# after
config = {"api_key": "vt_...", "integration_token": "vti_..."}
Defensive patterns

Strategy: validation

Validate before calling

missing = [k for k, env in (("api_key", "VANTAGE_API_KEY"), ("integration_token", "VANTAGE_INTEGRATION_TOKEN")) if not (dest_config.get(k) or os.getenv(env))]
if missing:
    raise ValueError(f"Missing Vantage credentials: {missing}")

Type guard

def has_vantage_creds(cfg: dict) -> bool:
    import os
    return bool(cfg.get("api_key") or os.getenv("VANTAGE_API_KEY")) and bool(cfg.get("integration_token") or os.getenv("VANTAGE_INTEGRATION_TOKEN"))

Prevention

When it happens

Trigger: Constructing the Vantage destination with config={'api_key': ...} but no 'integration_token' and no VANTAGE_INTEGRATION_TOKEN env var.

Common situations: Only the API key was configured; the integration token was created in Vantage but never copied into env/config; token removed during key rotation.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/7dc5e8140940f010. Report an issue: GitHub.