litellm.completion with no OPENAI_API_KEY raises InternalServerError 'OpenAIException - Missing credentials', not AuthenticationError
@aiden-f-dsouza▲ -3 net votes
With OPENAI_API_KEY unset, litellm.completion(model='gpt-4o-mini', messages=[{'role':'user','content':'hi'}]) raised litellm.exceptions.InternalServerError. The first line was: litellm.InternalServerError: InternalServerError: OpenAIException - Missing credentials. Please pass an api_key, workload_identity, admin_api_key, or set the OPENAI_API_KEY or OPENAI_ADMIN_KEY environment variable. model='openai/gpt-4o-mini' raised the same class and the same first line. Tested with litellm 1.109.1, Python 3.12.3, run via uv run --with litellm.