litellm/tests
shin-bot-litellm 606436c37c fix: redact API keys from error responses
API keys from LLM providers (OpenAI, Anthropic, Azure, etc.) can leak
into error messages when provider APIs return errors that include the
request's authentication details. This is a security concern for
enterprise customers.

Changes:
- Added litellm/litellm_core_utils/redact_api_keys.py with regex-based
  redaction for common API key formats (sk-*, Bearer tokens, URL key
  params, Azure api-key headers, Authorization headers)
- Applied redaction in exception_mapping_utils.py where provider error
  messages are extracted and mapped to litellm exceptions
- Applied redaction in ProxyException.__init__ as a safety net for all
  error responses sent to clients
- Applied redaction in MaskedHTTPStatusError for HTTP-level errors
- Added comprehensive test suite with 16 test cases
2026-02-02 19:19:41 +00:00
..
agent_tests
audio_tests
basic_proxy_startup_tests
batches_tests Add cost tacking and usage info in call_type=aretrieve_batch 2026-01-29 15:27:41 +05:30
code_coverage_tests fix(test): add router.acancel_batch coverage (#20183) 2026-01-31 12:39:19 -08:00
documentation_tests
enterprise test_increment_top_level_request_and_spend_metrics 2026-01-31 11:10:28 -08:00
guardrails_tests
image_gen_tests
litellm fix: redact API keys from error responses 2026-02-02 19:19:41 +00:00
litellm-proxy-extras
litellm_core_utils fix(bedrock): deduplicate toolResult and toolUse blocks in Converse message transformation (#20049) 2026-02-02 18:23:43 +05:30
litellm_utils_tests
llm_responses_api_testing
llm_translation Fix: test_bedrock_optional_params_embeddings_dimension 2026-02-02 17:47:20 +05:30
load_tests
local_testing fix(test): accept both AuthenticationError and InternalServerError in batch_completion test (#20186) 2026-01-31 13:36:27 -08:00
logging_callback_tests
mcp_tests
multi_instance_e2e_tests
ocr_tests
old_proxy_tests/tests
openai_endpoints_tests
otel_tests test fix 2026-01-31 19:08:07 -08:00
pass_through_tests
pass_through_unit_tests
proxy_admin_ui_tests
proxy_e2e_anthropic_messages_tests fix: bedrock-converse-claude-sonnet-4.5 2026-01-31 14:41:02 -08:00
proxy_security_tests
proxy_unit_tests Add support for 0 cost models 2026-02-02 13:29:37 +05:30
router_unit_tests fix(test): add router.acancel_batch coverage (#20183) 2026-01-31 12:39:19 -08:00
scim_tests
search_tests
spend_tracking_tests
store_model_in_db_tests
test_litellm perf: cache _get_relevant_args_to_use_for_logging() at module level (#20077) 2026-02-02 10:54:49 -08:00
unified_google_tests
vector_store_tests
windows_tests
__init__.py
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
README.MD
test_budget_management.py
test_callbacks_on_proxy.py
test_config.py
test_debug_warning.py
test_default_encoding_non_root.py
test_end_users.py
test_entrypoint.py
test_fallbacks.py fix: prevent error when max_fallbacks exceeds available models (#20071) 2026-02-02 18:23:53 +05:30
test_gpt5_azure_temperature_support.py
test_health.py
test_keys.py
test_litellm_proxy_responses_config.py
test_logging.conf
test_models.py
test_openai_endpoints.py
test_organizations.py
test_otel_thread_leak.py
test_passthrough_endpoints.py
test_presidio_latency.py
test_proxy_server_non_root.py
test_ratelimit.py
test_resource_cleanup.py
test_service_logger_otel.py
test_spend_logs.py
test_team.py
test_team_logging.py
test_team_members.py
test_users.py

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.