diff --git a/CLAUDE.md b/CLAUDE.md index 28116f2..967c22f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -134,7 +134,7 @@ prefixes determine routing: - **Anthropic**: claude-sonnet-4-5/4-6, claude-sonnet-5, claude-sonnet-5-5, claude-haiku-5-5, claude-haiku-4-5, claude-opus-4-5/4-6/4-7/4-8, claude-opus-5, claude-opus-5-5, claude-fable-5, claude-fable-5-1, claude-fable-5-2 - **Google**: gemini-4-argon, gemini-3.8-flash, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-pro, gemini-3-flash-preview, gemini-3.1-pro-preview; image generation: gemini-2.5-flash-image, gemini-3.1-flash-image, gemini-nano-banana-2.1 - **xAI**: grok-4.7, grok-4.6, grok-4.5, grok-4.3, grok-4.20-reasoning, grok-4.20-non-reasoning; image generation: grok-2-image, grok-imagine-image-2.0 -- **ByteDance** (BytePlus ModelArk, OpenAI-compatible, ap-southeast): seed-1.6, seed-1.8, seed-2.0-lite, deepseek-v4-flash, glm-5.2 (Z.ai's model served via a ModelArk deployment endpoint); image generation: seedream-4.0, seedream-5.0-lite, seedance-4.5, seedance-5.0 +- **ByteDance** (BytePlus ModelArk, OpenAI-compatible, ap-southeast): seed-1.6, seed-1.8, seed-2.0-lite, deepseek-v4-flash, glm-5.2 (Z.ai's model served via a ModelArk deployment endpoint); image generation: seedream-5.5, seedream-4.0, seedream-5.0-lite, seedance-4.5, seedance-5.0 - **OpenRouter** (OpenAI-compatible): aion-3.5, deepseek-v4-pro (pinned to Together), hy4-preview, hermes-4-405b, hy3 - **abliteration.ai** (OpenAI-compatible): abliterated-model-large-v2 - **Moonshot AI** (Kimi API, OpenAI-compatible, api.moonshot.ai): kimi-k3.1-pro @@ -164,7 +164,7 @@ is authoritative for availability as well as price; a pricing page keeps quoting a rate after the endpoints are gone. Image generation via OpenAI (gpt-image-2.6-flare, gpt-image-2.6-sunburst, gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2), xAI (grok-2-image, grok-imagine-image-2.0), ByteDance -(seedream-4.0, seedream-5.0-lite, seedance-4.5, seedance-5.0), and Z.ai (glm-image) is served +(seedream-5.5, seedream-4.0, seedream-5.0-lite, seedance-4.5, seedance-5.0), and Z.ai (glm-image) is served through a provider `/images/generations` endpoint rather than the chat path (see `image_generation.py`), but is surfaced on `/v1/chat/completions` exactly like Gemini's inline-image models (images returned out-of-band under the message @@ -190,7 +190,7 @@ prices by output pixel count can declare **resolution tiers** `size` keyword, the ratio→pixels table, and the per-image price — omitted means the default tier, and the field is rejected on single-resolution models. Seedream 5.0 (`1.5K` at $0.045 is the default; `2K` at $0.09 is what -every request used to be pinned to), Krea 3 (`1K` $0.03 default, `2K` $0.12, +every request used to be pinned to), Seedream 5.5 (`1.5K` $0.02 default, `2K` $0.035, plus $0.008 per reference image), Krea 3 (`1K` $0.03 default, `2K` $0.12, each reference billed at the same price as the output, per WaveSpeed's `$0.03 x MP x (1 + references)` formula), Qwen Image 3.0 Pro (`1K` $0.04 default, `2K` $0.075) and MiniMax H3 Image (`1K` $0.03, `2K` $0.03 default, `4K` $0.09) diff --git a/README.md b/README.md index 1d3a363..c5b9de3 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The gateway solves this by running inside a hardware-isolated Nitro Enclave wher Image generation: minimax-h3-image, krea-3 and qwen-image-3.0-pro (via WaveSpeed), gpt-image-2, gpt-image-2.6-flare, gpt-image-2.6-sunburst, gpt-image-2.5-flare, gpt-image-2.5-sunburst, gemini-2.5-flash-image, -gemini-nano-banana-2.1, gemini-3.1-flash-image, grok-2-image, grok-imagine-image-2.0, seedream-4.0, +gemini-nano-banana-2.1, gemini-3.1-flash-image, grok-2-image, grok-imagine-image-2.0, seedream-5.5, seedream-4.0, seedream-5.0-lite, seedance-4.5, seedance-5.0, glm-image. Some retired models stay registered so older SDK versions keep working; see diff --git a/tee_gateway/model_registry.py b/tee_gateway/model_registry.py index e39d131..6429c2d 100644 --- a/tee_gateway/model_registry.py +++ b/tee_gateway/model_registry.py @@ -1146,6 +1146,50 @@ class SupportedModel(Enum): }, image_default_resolution="1.5K", ) + # Seedream 5.5 image generation (released 2026-11-09), called by its + # ModelArk model id rather than an ep- deployment endpoint. Returns hosted + # URLs (fetched and inlined by the gateway). + # + # BytePlus bills it by output pixel count (ModelArk pricing page, model + # dola-seedream-5-5-261028): $0.020/image for 921,600 <= P <= 2,601,123 + # pixels, $0.035 up to 4,624,220, plus $0.008 per input (reference) image. + # The price line is the same one Seedream 5.0 pro has, so it takes the same + # two tiers and size tables: "1.5K" (every size under 2.6 MP, the default) + # and "2K" (every size under 4.62 MP). + # + # ModelArk's docs do not yet list this model's accepted parameters. It + # takes Seedream 5.0 pro's param set, which leaves out + # sequential_image_generation: 5.0 pro 400s on that field, and omitting a + # field the model would accept costs nothing (the gateway always asks for + # one image), while sending one it rejects fails every request. + SEEDREAM_5_5 = ModelConfig( + provider="bytedance", + api_name="dola-seedream-5-5-261028", + input_price_usd=Decimal("0"), + output_price_usd=Decimal("0"), + image_generation=True, + per_image_price_usd=Decimal("0.02"), + per_reference_image_price_usd=Decimal("0.008"), + image_response_format="url", + image_send_n=False, + image_supports_reference=True, + image_extra_params=_SEEDANCE_5_IMAGE_PARAMS, + image_aspect_ratios=_BYTEDANCE_1_5K_ASPECT_SIZES, + image_aspect_ratio_param="size", + image_resolutions={ + "1.5K": ImageResolutionTier( + per_image_price_usd=Decimal("0.02"), + aspect_ratios=_BYTEDANCE_1_5K_ASPECT_SIZES, + extra_params={"size": "1.5K"}, + ), + "2K": ImageResolutionTier( + per_image_price_usd=Decimal("0.035"), + aspect_ratios=_BYTEDANCE_2K_ASPECT_SIZES, + extra_params={"size": "2K"}, + ), + }, + image_default_resolution="1.5K", + ) # ── OpenRouter (OpenAI-compatible) ────────────────────────────────── # AionLabs Aion 3.5 — multi-model roleplay/storytelling system built on @@ -1543,6 +1587,9 @@ class SupportedModel(Enum): "ep-20260803211347-hq9k8": SupportedModel.SEEDANCE_5_0, "seedance-5.0": SupportedModel.SEEDANCE_5_0, "seedance-5-0": SupportedModel.SEEDANCE_5_0, + "dola-seedream-5-5-261028": SupportedModel.SEEDREAM_5_5, + "seedream-5.5": SupportedModel.SEEDREAM_5_5, + "seedream-5-5": SupportedModel.SEEDREAM_5_5, # Routed through OpenRouter "aion-3.5": SupportedModel.AION_3_5, "aion-3-5": SupportedModel.AION_3_5, diff --git a/tee_gateway/test/test_image_generation.py b/tee_gateway/test/test_image_generation.py index 42ec7c2..7159c8a 100644 --- a/tee_gateway/test/test_image_generation.py +++ b/tee_gateway/test/test_image_generation.py @@ -1461,6 +1461,23 @@ def test_krea_3_references_are_billed_at_the_tier_output_price(self): cost = compute_session_cost(KREA_3, usage, image_count=1, **kwargs) self.assertEqual(cost.cost_usd, expected) + def test_seedream_5_5_tiers_and_reference_images_are_billed(self): + # ModelArk: $0.020 / $0.035 per 1.5K / 2K output image, plus $0.008 + # per input image. + usage = self._zero_usage() + cases = [ + ({}, Decimal("0.02")), + ({"resolution": "2K"}, Decimal("0.035")), + ({"reference_count": 1}, Decimal("0.028")), + ({"resolution": "2K", "reference_count": 2}, Decimal("0.051")), + ] + for kwargs, expected in cases: + with self.subTest(**kwargs): + cost = compute_session_cost( + "seedream-5.5", usage, image_count=1, **kwargs + ) + self.assertEqual(cost.cost_usd, expected) + def test_minimax_h3_reference_images_are_billed(self): # WaveSpeed: $0.03 at 1k/2k, $0.09 at 4k, plus $0.008 per input image. usage = self._zero_usage() diff --git a/tests/test_pricing.py b/tests/test_pricing.py index b6078d4..e175831 100644 --- a/tests/test_pricing.py +++ b/tests/test_pricing.py @@ -677,6 +677,31 @@ def test_seedance_5_0_aliases_resolve(self): get_model_config("seedance-5.0"), ) + def test_seedream_5_5_resolves(self): + cfg = get_model_config("seedream-5.5") + self.assertEqual(cfg.provider, "bytedance") + self.assertEqual(cfg.api_name, "dola-seedream-5-5-261028") + self.assertTrue(cfg.image_generation) + # ModelArk prices Seedream 5.5 by pixel count: $0.020 up to 2.6 MP + # (the "1.5K" tier, the default), $0.035 up to 4.62 MP (the "2K" + # tier), plus $0.008 per input image. + self.assertEqual(cfg.per_image_price_usd, Decimal("0.02")) + self.assertEqual(cfg.per_reference_image_price_usd, Decimal("0.008")) + self.assertEqual(cfg.image_default_resolution, "1.5K") + self.assertEqual( + {k: t.per_image_price_usd for k, t in cfg.image_resolutions.items()}, + {"1.5K": Decimal("0.02"), "2K": Decimal("0.035")}, + ) + # Same param set as Seedream 5.0 pro: no sequential_image_generation. + self.assertNotIn("sequential_image_generation", cfg.image_extra_params) + + def test_seedream_5_5_aliases_resolve(self): + for alias in ("seedream-5-5", "dola-seedream-5-5-261028", "Seedream-5.5"): + with self.subTest(alias=alias): + self.assertEqual( + get_model_config(alias), get_model_config("seedream-5.5") + ) + # ── Nous Research models (OpenRouter) ─────────────────────────────────── def test_hermes_4_405b_resolves(self):