.NET API
IVoicePricingReader
Tracon.Abstractions.dllReads the configured voice model’s pricing.
public interface IVoicePricingReaderRemarks
Section titled “Remarks”The HTTP layer uses this abstraction to show voice pricing; pricing
resolution is inside Tracon.Voice, and the HTTP layer cannot
reference that package (the package direction rule). Tracon does not
fabricate a price: if there is no match, null is
returned — not zero.
DI lifetime — singleton. Registered as a singleton by
Tracon.Voice. Call this interface; Tracon supplies the implementation, so
do not implement or replace it.
Tenant behavior — TENANT-INDEPENDENT. Pricing is configured process-wide, not per tenant; no member here takes a tenant parameter.
Properties
Section titled “Properties”Currency
Section titled “ Currency”The currency label shown in reports.
string? Currency { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”ForCharacters(decimal)
Section titled “ ForCharacters(decimal)”Computes a character-based generation’s cost for the default synthesizer.
decimal? ForCharacters(decimal characters)Parameters
Section titled “Parameters”characters decimal
The billed character count.
Returns
Section titled “Returns”The amount; null if pricing is undefined.
Remarks
Section titled “Remarks”Uses the default synthesizer’s provider name and configured model. A call that knows which provider and model produced the audio uses IVoicePricingReader.ForSynthesis instead.
ForSynthesis(string, string?, decimal)
Section titled “ ForSynthesis(string, string?, decimal)”Computes the cost of a synthesis by the provider and model that produced it.
decimal? ForSynthesis(string providerName, string? modelId, decimal characters)Parameters
Section titled “Parameters”providerName string
The ISpeechSynthesizer.ProviderName of the synthesizer.
modelId string?
The model the synthesizer reported (SpeechAudio.ModelId), or the one the request named; null when neither is known.
characters decimal
The billed character count.
Returns
Section titled “Returns”The amount; null if pricing is undefined.
Remarks
Section titled “Remarks”The default implementation returns null.
ForTranscription(string, string?, TimeSpan)
Section titled “ ForTranscription(string, string?, TimeSpan)”Computes the cost of a transcription by the provider and model that produced it.
decimal? ForTranscription(string providerName, string? modelId, TimeSpan duration)Parameters
Section titled “Parameters”providerName string
The ISpeechTranscriber.ProviderName of the transcriber.
modelId string?
The model the transcriber reported (SpeechTranscript.ModelId), or the one the request named; null when neither is known.
duration TimeSpan
The duration of the transcribed audio.
Returns
Section titled “Returns”The amount; null if pricing is undefined.
Remarks
Section titled “Remarks”The default implementation returns null.