Skip to content

TTS billing in API DB - #1667

Merged
recursive-hub merged 3 commits into
mainfrom
feat/TD-1689_tts_billing_in_api_db
Nov 11, 2026
Merged

recursive-hub merged 3 commits into
mainfrom
feat/TD-1689_tts_billing_in_api_db

Conversation

@recursive-hub

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings November 9, 2026 22:30
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/shared/src/speech/speech-service.ts 0.00% 4 Missing ⚠️
packages/ai-core/src/api-keys/billing.ts 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

TTS billing skips initial-message audio and can charge the wrong API key or omit charges when API-key IDs are stale or missing.

2 open issues
What changed in this PR

This PR adds text-to-speech (TTS) costs to API-database usage accounting, linking chat speech generation to federal-state API keys.

Changes:

  • Adds and exports a speech-usage billing helper.
  • Calls API-key billing from regular and shared-chat speech services.
  • Preserves supplied speech costs when creating completion-usage records.
File Description
packages/​shared/​src/​speech/​speech-service.ts Adds API-key billing to regular chat speech usage.
packages/​shared/​src/​speech/​shared-chat-speech-service.ts Adds API-key billing to shared-chat speech usage.
packages/​api-database/​src/​functions/​completion-usage.ts Stores supplied costs for speech models.
packages/​ai-core/​src/​speech/​index.ts Exports the speech billing helper.
packages/​ai-core/​src/​api-keys/​billing.ts Adds a helper to record speech costs against API keys.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Playwright Smart Reporter

Passed: 39 of 39 tests passed.

Pass rate Passed Failed Flaky Skipped Duration
100% 39 0 0 0 1.9m

Baseline run: main @ 99b28a5f

Slowest tests

Test Duration
character is submitted, rejected, resubmitted and approved across chat-bot and admin [chromium] 41.7s
teacher can login, create and join shared dialogpartner chat [chromium] 29.4s
can be set in the overview and the detail page and removed again [chromium] 23.4s
teacher can login, create an assistant and start a chat [chromium] 19.1s
can be set in the overview and the detail page and removed again [chromium] 16.9s

Open the full report

@recursive-hub
recursive-hub merged commit f5778ad into main Nov 11, 2026
8 of 9 checks passed
@recursive-hub
recursive-hub deleted the feat/TD-1689_tts_billing_in_api_db branch November 11, 2026 22:40
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.

4 participants