BerriAI/litellm · error
DATAFORSEO_LOGIN is not set. Set `DATAFORSEO_LOGIN`…
Error message
DATAFORSEO_LOGIN is not set. Set `DATAFORSEO_LOGIN` environment variable or pass credentials in api_key parameter.
What it means
Credential guard in DataForSEO validate_environment: no login was resolved from caller-supplied 'login:password' api_key or the DATAFORSEO_LOGIN secret, so Basic-auth credentials for the API cannot be built.
Solutions
- Set the DATAFORSEO_LOGIN environment variable to your DataForSEO login.
- Or pass credentials through the api_key parameter as accepted by the DataForSEO integration.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/llms/dataforseo/search/transformation.py:75 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/8ccbcfd677b4c48e.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/dataforseo/search/transformation.py:75
# Get login and password
login = get_secret_str("DATAFORSEO_LOGIN")
password = get_secret_str("DATAFORSEO_PASSWORD")
# If api_key is provided in "login:password" format, use it
caller_supplied_credentials: Final = bool(api_key and ":" in api_key)
if api_key and ":" in api_key:
login, password = api_key.split(":", 1)
if not caller_supplied_credentials and login and password:
self._assert_trusted_api_base_for_server_credential(
api_base,
self.DATAFORSEO_API_BASE,
"DATAFORSEO_API_BASE",
"DATAFORSEO_LOGIN",
)
if not login:
raise ValueError(
"DATAFORSEO_LOGIN is not set. Set `DATAFORSEO_LOGIN` environment variable or pass credentials in api_key parameter."
)
if not password:
raise ValueError(
"DATAFORSEO_PASSWORD is not set. Set `DATAFORSEO_PASSWORD` environment variable or pass credentials in api_key parameter."
)
# Create Basic Auth header
credentials: Final = f"{login}:{password}"
encoded_credentials: Final = base64.b64encode(credentials.encode()).decode()
headers["Authorization"] = f"Basic {encoded_credentials}"
headers["Content-Type"] = "application/json"
return headers
def get_complete_url(
self,View on GitHub (pinned to 77b7c6c40c)