BerriAI/litellm · error · ValueError

VANTAGE_INTEGRATION_TOKEN must be provided for Vantage…

Error message

VANTAGE_INTEGRATION_TOKEN must be provided for Vantage exports

What it means

For Vantage Focus destinations, _resolve_config checks the integration token after the API key: it resolves integration_token from config overrides then the VANTAGE_INTEGRATION_TOKEN environment variable and raises ValueError when neither is present. The token identifies the Vantage integration that receives the exported FOCUS data, so it cannot be defaulted.

Solutions

  1. Set VANTAGE_INTEGRATION_TOKEN in the environment (alongside VANTAGE_API_KEY)
  2. Or pass integration_token in the config dict to create()
  3. Store both values together in the same secret so they cannot drift
  4. Add a startup check for both Vantage vars when vantage export is enabled

Example fix

# before
os.environ['VANTAGE_API_KEY'] = 'vk-...'
dest = FocusDestinationFactory.create(provider='vantage', prefix='focus/')

# after
os.environ['VANTAGE_API_KEY'] = 'vk-...'
os.environ['VANTAGE_INTEGRATION_TOKEN'] = 'it-...'
dest = FocusDestinationFactory.create(provider='vantage', prefix='focus/')
Defensive patterns

Strategy: validation

Validate before calling

import os

missing = [v for v in ('VANTAGE_API_KEY', 'VANTAGE_INTEGRATION_TOKEN') if not os.getenv(v)]
if missing:
    raise ValueError(f'Vantage export missing env vars: {missing}')
dest = FocusDestinationFactory.create(provider='vantage', prefix='focus/')

Try / catch

try:
    dest = FocusDestinationFactory.create(provider='vantage', prefix='focus/', config=config)
except ValueError as e:
    if 'VANTAGE_INTEGRATION_TOKEN' in str(e):
        raise RuntimeError('Vantage export not configured; set VANTAGE_INTEGRATION_TOKEN') from e
    raise

Prevention

When it happens

Trigger: FocusDestinationFactory.create(provider='vantage', ...) with VANTAGE_API_KEY set but VANTAGE_INTEGRATION_TOKEN missing; the token created in the Vantage dashboard but never added to the deployment env; config carries api_key only.

Common situations: Following setup docs that highlight the API key and mention the integration token in passing; per-environment tokens not synced; dashboards re-issuing tokens invalidating deployed values (that yields auth failures instead — this error is simply absence).

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at litellm/integrations/focus/destinations/factory.py:65

                "region_name": overrides.get("region_name") or os.getenv("FOCUS_S3_REGION_NAME"),
                "endpoint_url": overrides.get("endpoint_url") or os.getenv("FOCUS_S3_ENDPOINT_URL"),
                "aws_access_key_id": overrides.get("aws_access_key_id") or os.getenv("FOCUS_S3_ACCESS_KEY"),
                "aws_secret_access_key": overrides.get("aws_secret_access_key") or os.getenv("FOCUS_S3_SECRET_KEY"),
                "aws_session_token": overrides.get("aws_session_token") or os.getenv("FOCUS_S3_SESSION_TOKEN"),
            }
            if not resolved.get("bucket_name"):
                raise ValueError("FOCUS_S3_BUCKET_NAME must be provided for S3 exports")
            return {k: v for k, v in resolved.items() if v is not None}
        if provider == "vantage":
            resolved = {
                "api_key": overrides.get("api_key") or os.getenv("VANTAGE_API_KEY"),
                "integration_token": overrides.get("integration_token") or os.getenv("VANTAGE_INTEGRATION_TOKEN"),
                "base_url": overrides.get("base_url") or os.getenv("VANTAGE_BASE_URL", "https://api.vantage.sh"),
            }
            if not resolved.get("api_key"):
                raise ValueError("VANTAGE_API_KEY must be provided for Vantage exports")
            if not resolved.get("integration_token"):
                raise ValueError("VANTAGE_INTEGRATION_TOKEN must be provided for Vantage exports")
            return {k: v for k, v in resolved.items() if v is not None}
        if provider == "gcs":
            resolved = {
                "bucket_name": overrides.get("bucket_name") or os.getenv("FOCUS_GCS_BUCKET_NAME"),
                "service_account_json": overrides.get("service_account_json")
                or os.getenv("FOCUS_GCS_PATH_SERVICE_ACCOUNT"),
            }
            if not resolved.get("bucket_name"):
                raise ValueError("FOCUS_GCS_BUCKET_NAME must be provided for GCS exports")
            return {k: v for k, v in resolved.items() if v is not None}
        if provider == "mavvrik":
            resolved = {
                "api_key": overrides.get("api_key") or os.getenv("MAVVRIK_API_KEY"),
                "api_endpoint": overrides.get("api_endpoint") or os.getenv("MAVVRIK_API_ENDPOINT"),
                "connection_id": overrides.get("connection_id") or os.getenv("MAVVRIK_CONNECTION_ID"),
            }
            return {k: v for k, v in resolved.items() if v is not None}
        raise NotImplementedError(f"Provider '{provider}' not supported for Focus export configuration")

View on GitHub (pinned to 77b7c6c40c)