Repository navigation
TTS billing in API DB - #1667
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
🟡 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
Playwright Smart ReporterPassed: 39 of 39 tests passed.
Baseline run: Slowest tests
|
recursive-hub
marked this pull request as ready for review
November 10, 2026 10:13
recursive-hub
requested review from
AsamMax,
TobiasWallura-xitaso,
brueckb,
rlaerm and
stschaller-xitaso
as code owners
November 10, 2026 10:13
TobiasWallura-xitaso
approved these changes
Nov 10, 2026
rlaerm
reviewed
Nov 11, 2026
rlaerm
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.