#26406 [Bug]: health check sends `max_tokens` to non-chat endpoints (OpenAI `dall-e-*` / `gpt-image-1` โ 400 "Unknown parameter: 'max_tokens'")
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Health check for OpenAI image generation models (dall-e-2, dall-e-3, gpt-image-1) always fails with 400 BadRequestError: Unknown parameter: 'max_tokens' even when model_info.mode: image_generation is explicitly set.
Root cause is in litellm_core_utils/health_check_utils.py:6-8 โ _filter_model_params() removes only the messages key, while _update_litellm_params_for_health_check() in litellm/proxy/health_check.py:370-372 unconditionally injects max_tokens for every deployment. As a result max_tokens: 50 (or whatever BACKGROUND_HEALTH_CHECK_MAX_TOKENS resolves to) gets forwarded into litellm.aimage_generation() โ OpenAI Images API rejects it.
Same pattern affects every non-chat handler in HealthCheckHelpers.get_mode_handlers (image/video generation, embedding, rerank, transcription, etc.). It hasn't surfaced on some providers because their provider-side transformers silently drop unknown fields (Vertex Imagen, Bedrock, etc.) โ but OpenAI/Azure image endpoints are strict and fail with 400.
Running litellm.aimage_generation(model="openai/dall-e-3โฆ