{"record":{"id":"cb1b314ca4ab959b","repo":"BerriAI/litellm","slug":"vantage-api-key-must-be-provided-for-vantage-expor","errorCode":null,"errorMessage":"VANTAGE_API_KEY must be provided for Vantage exports","messagePattern":"VANTAGE_API_KEY must be provided for Vantage exports","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/focus/destinations/factory.py","lineNumber":63,"sourceCode":"            resolved = {\n                \"bucket_name\": overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_S3_BUCKET_NAME\"),\n                \"region_name\": overrides.get(\"region_name\") or os.getenv(\"FOCUS_S3_REGION_NAME\"),\n                \"endpoint_url\": overrides.get(\"endpoint_url\") or os.getenv(\"FOCUS_S3_ENDPOINT_URL\"),\n                \"aws_access_key_id\": overrides.get(\"aws_access_key_id\") or os.getenv(\"FOCUS_S3_ACCESS_KEY\"),\n                \"aws_secret_access_key\": overrides.get(\"aws_secret_access_key\") or os.getenv(\"FOCUS_S3_SECRET_KEY\"),\n                \"aws_session_token\": overrides.get(\"aws_session_token\") or os.getenv(\"FOCUS_S3_SESSION_TOKEN\"),\n            }\n            if not resolved.get(\"bucket_name\"):\n                raise ValueError(\"FOCUS_S3_BUCKET_NAME must be provided for S3 exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"vantage\":\n            resolved = {\n                \"api_key\": overrides.get(\"api_key\") or os.getenv(\"VANTAGE_API_KEY\"),\n                \"integration_token\": overrides.get(\"integration_token\") or os.getenv(\"VANTAGE_INTEGRATION_TOKEN\"),\n                \"base_url\": overrides.get(\"base_url\") or os.getenv(\"VANTAGE_BASE_URL\", \"https://api.vantage.sh\"),\n            }\n            if not resolved.get(\"api_key\"):\n                raise ValueError(\"VANTAGE_API_KEY must be provided for Vantage exports\")\n            if not resolved.get(\"integration_token\"):\n                raise ValueError(\"VANTAGE_INTEGRATION_TOKEN must be provided for Vantage exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"gcs\":\n            resolved = {\n                \"bucket_name\": overrides.get(\"bucket_name\") or os.getenv(\"FOCUS_GCS_BUCKET_NAME\"),\n                \"service_account_json\": overrides.get(\"service_account_json\")\n                or os.getenv(\"FOCUS_GCS_PATH_SERVICE_ACCOUNT\"),\n            }\n            if not resolved.get(\"bucket_name\"):\n                raise ValueError(\"FOCUS_GCS_BUCKET_NAME must be provided for GCS exports\")\n            return {k: v for k, v in resolved.items() if v is not None}\n        if provider == \"mavvrik\":\n            resolved = {\n                \"api_key\": overrides.get(\"api_key\") or os.getenv(\"MAVVRIK_API_KEY\"),\n                \"api_endpoint\": overrides.get(\"api_endpoint\") or os.getenv(\"MAVVRIK_API_ENDPOINT\"),\n                \"connection_id\": overrides.get(\"connection_id\") or os.getenv(\"MAVVRIK_CONNECTION_ID\"),\n            }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/focus/destinations/factory.py#L45-L81","documentation":"When building a Vantage Focus destination, _resolve_config resolves api_key from config overrides then the VANTAGE_API_KEY environment variable; if absent it raises ValueError immediately at factory time. Vantage requires both an API key and a separate integration token, and the API key is checked first, so fix this error before the token check can even run.","triggerScenarios":"FocusDestinationFactory.create(provider='vantage', ...) with no api_key in config and VANTAGE_API_KEY unset; the key stored only in the interactive shell environment; a CI job exporting to Vantage without the secret configured.","commonSituations":"Rotating Vantage credentials and the new key not deployed to all workers; env vars present locally but missing in Docker/k8s; team sharing a config where each member must export their own key.","solutions":["Set VANTAGE_API_KEY in the export process's environment","Or pass it in config: create(provider='vantage', config={'api_key': ...})","Add it to the secret store (k8s Secret / CI secret) for the export job","Remember VANTAGE_INTEGRATION_TOKEN is also required and checked right after"],"exampleFix":"# before\ndest = FocusDestinationFactory.create(provider='vantage', prefix='focus/')\n\n# after\ndest = FocusDestinationFactory.create(\n    provider='vantage',\n    prefix='focus/',\n    config={'api_key': os.environ['VANTAGE_API_KEY']},\n)","handlingStrategy":"validation","validationCode":"import os\n\napi_key = config.get('api_key') or os.getenv('VANTAGE_API_KEY')\nif not api_key:\n    raise ValueError('VANTAGE_API_KEY (or config api_key) required for Vantage Focus export')\ndest = FocusDestinationFactory.create(provider='vantage', prefix='focus/', config={'api_key': api_key})","typeGuard":null,"tryCatchPattern":"try:\n    dest = FocusDestinationFactory.create(provider='vantage', prefix='focus/', config=config)\nexcept ValueError as e:\n    if 'VANTAGE_API_KEY' in str(e):\n        raise RuntimeError('Vantage export not configured; set VANTAGE_API_KEY') from e\n    raise","preventionTips":["Store VANTAGE_API_KEY and VANTAGE_INTEGRATION_TOKEN together in one secret","Check both vars at startup when vantage export is enabled — the key error just hides the token error","Verify the vars exist in the export job's environment (k8s Secret / CI secret), not only locally"],"tags":["litellm","focus","vantage","export","missing-env-var","api-key"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}