#2919

fix(gateway): Mistral streaming transcription's billed meter is input audio minutes

OpenDanielButler1wants to merge intofrom

https://entire.com/gh/phaseoteam/-/trails/151/changes/Phaseo/151

What changed

realtimeBilledMeters("mistral") now returns ["input_audio_minutes"], the meter Mistral streaming transcription is priced on.

Why

A live test through the gateway on 2026-10-29, after #3272 deployed and the routes were switched on, failed at session creation with realtime_price_card_missing (request G-01M640PHZ6RSYX4BWGVX8Z2TAZ, then again on G-01M640QYTE6NQPFE9V8CRTCGRX). The SKUs, meters and routes were all correct in the database.

The cause: #3354, which merged after #3272, made requireRealtimePriceCard refuse a card that is missing any of the provider's billed meters. Mistral wasn't listed, so it fell through to the four token meters. Its card only has input_audio_minutes, so every Mistral session was refused.

How

  • One line in core/realtime-sessions.ts, next to the duration-billed case.
  • The same list also drives the "unpriced billed meter" guard in priceRealtimeUsage, so Mistral audio with no price row now fails into review rather than being billed $0.

Before and after

Method: the same POST /v1/audio/realtime/sessions with mistral/voxtral-mini-transcribe-realtime-3, against the prod card (one input_audio_minutes rule at $0.008).

BeforeAfter
Billed meters for mistral4 token metersinput_audio_minutes
Session create400 realtime_price_card_missingPasses the price check (unit test; live after deploy)

Verification

  • pnpm exec vitest run src/core/realtime src/core/mistral src/routes/v1/data/realtime: 12 files, 205 tests passed. realtime-mistral.test.ts now checks that the billed meters are covered by Mistral's card, and prices with the provider passed.
  • pnpm run typecheck (apps/api): clean.
  • Not verified yet: the live session. The two Mistral routes are switched off again until this deploys, then I'll rerun the gateway test (~$0.001).

Model: Claude Opus 5.5 (effort unknown) · Harness: Claude Code in T3 Code

🤖 Generated with Claude Code

Activity

6
vercel[bot]1d ago

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated
phaseo ReadyPreviewOct 29, 2026 2:32pm UTC

coderabbitai[bot]1d ago

WARNING

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 10d10487-a335-472f-a70e-9c9b2a209520
Commits

Reviewing files that changed from the base of the PR and between 13bcd224b2534d1ec64077b7b62ec587d9bbe294 and bdaf327ae505150aa961458fe3136aae4dc83e57.

Files selected for processing: 3
  • .changeset/realtime-mistral-billed-meters.md
  • apps/api/src/core/realtime-mistral.test.ts
  • apps/api/src/core/realtime-sessions.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

chatgpt-codex-connector[bot]1d ago

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-10-29T14:30:23.284515Zbdaf327PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

github-actions[bot]1d ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None