BerriAI/litellm · error · ValueError

must be a non-empty string

Error message

must be a non-empty string

What it means

Shared field validator on VantageInitRequest's api_key and integration_token: after stripping, the string is empty. Both credentials are required (non-optional fields), so an empty value is treated as missing and rejected.

Source

Thrown at litellm/types/proxy/vantage_endpoints.py:25

from pydantic import BaseModel, Field, field_validator


class VantageInitRequest(BaseModel):
    """Request model for initializing Vantage settings"""

    api_key: str = Field(..., description="Vantage API key for authentication")
    integration_token: str = Field(..., description="Vantage integration token for the cost-import endpoint")
    base_url: str = Field(
        default="https://api.vantage.sh",
        description="Vantage API base URL (default: https://api.vantage.sh)",
    )

    @field_validator("api_key", "integration_token")
    @classmethod
    def must_be_non_empty(cls, v: str) -> str:
        if not v.strip():
            raise ValueError("must be a non-empty string")
        return v


class VantageInitResponse(BaseModel):
    """Response model for Vantage initialization"""

    message: str
    status: str


class VantageExportRequest(BaseModel):
    """Request model for Vantage export operations (actual export, no default limit)"""

    limit: int | None = Field(
        None,
        description="Optional limit on number of records to export (default: no limit)",
    )
    start_time_utc: datetime | None = Field(None, description="Start time for data export in UTC")

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Pass a non-empty, non-whitespace string value for this field.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/types/proxy/vantage_endpoints.py:25 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/dbf6ba08927a4eeb. Report an issue: GitHub.