litellm/tests/unit/llms/openrouter
kenneth-berri b6f3368773
fix(openrouter): send image-only models to the Images API (#55627)
* fix(openrouter): send image-only models to the Images API

OpenRouter rejects models such as openai/gpt-image-2.6-sunburst on /chat/completions and
asks for /api/v1/images. Those models now use the Images API request and response format for
image generation and image edit. Every other model stays on chat completions.

Fixes #55498

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(openrouter): keep the Images API configs within the lint gates

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(openrouter): leave auto size and quality to the model and accept a chat completions api_base on the Images API

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(openrouter): read supported_endpoints from the cost map before the image-only name list

* test(openrouter): annotate the Images API tests

* test(openrouter): drop formatting-only changes to unrelated test files

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-12-01 18:56:03 -08:00
..
chat fix(openai): relay provider error codes, types, and Responses params from OpenAI-compatible backends (#51809) 2026-11-24 02:23:00 +00:00
image_edit fix(openrouter): send image-only models to the Images API (#55627) 2026-12-01 18:56:03 -08:00
image_generation fix(openrouter): send image-only models to the Images API (#55627) 2026-12-01 18:56:03 -08:00
responses fix(spend): keep a NaN or infinite cost from wedging daily spend writes (#48829) 2026-10-30 08:27:35 -07:00
__init__.py test: add __init__.py to intermediate phase 12 unit test directories 2026-09-20 12:37:21 +00:00
test_openrouter_common_utils.py fix(openrouter): report the context window and output cap from OpenRouter's catalog (#54046) 2026-11-24 04:37:30 -08:00
test_openrouter_embedding_transformation.py test: migrate tests/llm_translation into unit, integration and e2e tiers (#45759) 2026-10-11 07:58:53 +00:00
test_openrouter_provider_routing.py test: migrate openai, openai_like and openrouter legacy tests to tests/unit 2026-09-20 10:40:27 +00:00