Skip to content

feat(model-prices): support non-token billing metadata for image and video models - #520

Open
mazongYY wants to merge 1 commit into
seakee:devfrom
mazongYY:feat/model-price-media-billing
Open

feat(model-prices): support non-token billing metadata for image and video models#520
mazongYY wants to merge 1 commit into
seakee:devfrom
mazongYY:feat/model-price-media-billing

Conversation

@mazongYY

Copy link
Copy Markdown

Summary

Adds optional billing metadata (billingUnit / billingRate) to stored model prices so media models can record official non-token pricing while token cost stays at 0.

Targeted xAI media models:

  • grok-imagine-image: $0.02/image
  • grok-imagine-video: $0.05/s (480p), $0.07/s (720p)

Changes

  • model.ModelPrice and repository SQL persist billing_unit / billing_rate, including sync upsert and manual replace paths.
  • SQLite table creation and column-preservation migration include the two nullable columns; existing installs migrate in place.
  • The web editor exposes Billing unit and Billing rate inputs; price rows display the billing rate when present.
  • i18n keys added for en, zh-CN, zh-TW, and ru.
  • Tests cover repository round-trip, legacy migration preserving zero-base prices with no billing metadata, and draft round-trip / blank-metadata omission.

Validation

  • go test ./internal/repository/sqlite/...
  • go test ./internal/repository/modelprice/...
  • go test ./internal/service/modelprice/...
  • go test ./internal/model/...
  • go build ./...
  • npm run type-check
  • npm run lint
  • npx vitest run src/features/monitoring/model/modelPricesPageModel.test.ts
  • git diff --check

Fixes #519

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.

1 participant