Skip to content

add modal price guard for multimodal apis in aigateway#1254

Merged
luojun96 merged 4 commits into
mainfrom
sync_mr_2696_57b6bb3
Jul 9, 2026
Merged

add modal price guard for multimodal apis in aigateway#1254
luojun96 merged 4 commits into
mainfrom
sync_mr_2696_57b6bb3

Conversation

@Rader

@Rader Rader commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary:

  • Introduces a SaaS modal price guard (checkModalRequestAllowed) to validate image, video, and edit generation requests against configured SKU resolution boundaries before forwarding to downstream services.
  • Unifies resolution parsing logic in common/utils/common to ensure consistent semantic matching with the accounting system, preventing misconfigured requests from bypassing price tiers.
  • Enhances error handling for misconfigured pricing scenarios and enriches preflight traces with error.type=modal_price_guard when requests exceed allowed limits.

@Rader

Rader commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Depends on #1253

HaiHui886
HaiHui886 previously approved these changes Jul 9, 2026

@HaiHui886 HaiHui886 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

luojun96 added 2 commits July 9, 2026 14:20
Removed redundant parseResolutionWxHFormat function and simplified logic in parseResolutionWxHPair.
@luojun96
luojun96 merged commit 28c6c6a into main Jul 9, 2026
7 checks passed
@luojun96
luojun96 deleted the sync_mr_2696_57b6bb3 branch July 9, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants