fix(fal_ai): price gpt-image-2 unprefixed alias and edit endpoint

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Devin AI 2026-08-20 23:04:37 +00:00
parent f3896c0527
commit 618d907d5a
3 changed files with 62 additions and 2 deletions

View file

@ -17410,6 +17410,32 @@
],
"supports_vision": true
},
"fal_ai/gpt-image-2": {
"litellm_provider": "fal_ai",
"metadata": {
"notes": "Alias of fal_ai/openai/gpt-image-2, which litellm also accepts without the openai/ prefix. Same rate, see that entry for the size and quality caveat"
},
"mode": "image_generation",
"output_cost_per_image": 0.145,
"source": "https://fal.ai/models/openai/gpt-image-2",
"supported_endpoints": [
"/v1/images/generations"
],
"supports_vision": true
},
"fal_ai/openai/gpt-image-2/edit": {
"litellm_provider": "fal_ai",
"metadata": {
"notes": "Editing endpoint of gpt-image-2 on fal.ai. Same rate as fal_ai/openai/gpt-image-2, see that entry for the size and quality caveat"
},
"mode": "image_generation",
"output_cost_per_image": 0.145,
"source": "https://fal.ai/models/openai/gpt-image-2/edit",
"supported_endpoints": [
"/v1/images/edits"
],
"supports_vision": true
},
"featherless_ai/featherless-ai/Qwerky-72B": {
"litellm_provider": "featherless_ai",
"max_input_tokens": 32768,

View file

@ -17410,6 +17410,32 @@
],
"supports_vision": true
},
"fal_ai/gpt-image-2": {
"litellm_provider": "fal_ai",
"metadata": {
"notes": "Alias of fal_ai/openai/gpt-image-2, which litellm also accepts without the openai/ prefix. Same rate, see that entry for the size and quality caveat"
},
"mode": "image_generation",
"output_cost_per_image": 0.145,
"source": "https://fal.ai/models/openai/gpt-image-2",
"supported_endpoints": [
"/v1/images/generations"
],
"supports_vision": true
},
"fal_ai/openai/gpt-image-2/edit": {
"litellm_provider": "fal_ai",
"metadata": {
"notes": "Editing endpoint of gpt-image-2 on fal.ai. Same rate as fal_ai/openai/gpt-image-2, see that entry for the size and quality caveat"
},
"mode": "image_generation",
"output_cost_per_image": 0.145,
"source": "https://fal.ai/models/openai/gpt-image-2/edit",
"supported_endpoints": [
"/v1/images/edits"
],
"supports_vision": true
},
"featherless_ai/featherless-ai/Qwerky-72B": {
"litellm_provider": "featherless_ai",
"max_input_tokens": 32768,

View file

@ -127,7 +127,15 @@ def test_transform_image_generation_request():
) == {"prompt": "a red bicycle", "quality": "high", "num_images": 2}
def test_cost_calculator_uses_registry_price(monkeypatch: pytest.MonkeyPatch):
@pytest.mark.parametrize(
"model",
[
"openai/gpt-image-2",
"gpt-image-2",
"openai/gpt-image-2/edit",
],
)
def test_cost_calculator_uses_registry_price(model, monkeypatch: pytest.MonkeyPatch):
monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))
response = ImageResponse(
data=[
@ -135,4 +143,4 @@ def test_cost_calculator_uses_registry_price(monkeypatch: pytest.MonkeyPatch):
ImageObject(url="https://v3b.fal.media/files/b/two.png"),
]
)
assert cost_calculator(model="openai/gpt-image-2", image_response=response) == pytest.approx(0.29)
assert cost_calculator(model=model, image_response=response) == pytest.approx(0.29)