import * as z from "zod/v4"; import { OpenEnum } from "../types/enums.js"; import { ProviderName } from "./providername.js"; import { ProviderOptions, ProviderOptions$Outbound } from "./provideroptions.js"; import { STTInputAudio, STTInputAudio$Outbound } from "./sttinputaudio.js"; import { STTTimestampGranularity } from "./stttimestampgranularity.js"; import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js"; /** * Data collection setting. If no available model provider meets the requirement, your request will return an error. * * @remarks * - allow: (default) allow providers which store user data non-transiently and may train on it * * - deny: use only providers which do not collect user data. */ export declare const STTRequestDataCollection: { readonly Deny: "deny"; readonly Allow: "allow"; }; /** * Data collection setting. If no available model provider meets the requirement, your request will return an error. * * @remarks * - allow: (default) allow providers which store user data non-transiently and may train on it * * - deny: use only providers which do not collect user data. */ export type STTRequestDataCollection = OpenEnum; export type STTRequestIgnore = ProviderName | string; export type STTRequestOnly = ProviderName | string; export type STTRequestOrder = ProviderName | string; /** * Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options */ export type STTRequestProvider = { /** * Whether to allow backup providers to serve requests * * @remarks * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. * - false: use only the primary/custom provider, and return the upstream error if it's unavailable. */ allowFallbacks?: boolean | null | undefined; /** * Data collection setting. If no available model provider meets the requirement, your request will return an error. * * @remarks * - allow: (default) allow providers which store user data non-transiently and may train on it * * - deny: use only providers which do not collect user data. */ dataCollection?: STTRequestDataCollection | null | undefined; /** * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. */ ignore?: Array | null | undefined; /** * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. */ only?: Array | null | undefined; /** * Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. */ options?: ProviderOptions | undefined; /** * An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. */ order?: Array | null | undefined; /** * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. */ zdr?: boolean | null | undefined; }; /** * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. */ export declare const STTRequestResponseFormat: { readonly Json: "json"; readonly VerboseJson: "verbose_json"; }; /** * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. */ export type STTRequestResponseFormat = OpenEnum; /** * Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio or a URL the provider downloads. */ export type STTRequest = { /** * Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker_label), so response_format must be "verbose_json" (a "json" request is rejected with a 400) and word timestamps are included even when timestamp_granularities omits "word". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra. */ diarize?: boolean | undefined; /** * Audio to transcribe: inline base64 bytes, or a URL the provider downloads directly. */ inputAudio: STTInputAudio; /** * Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra. */ keyterms?: Array | undefined; /** * ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. */ language?: string | undefined; /** * STT model identifier */ model: string; /** * Context to guide transcription, such as domain vocabulary or a previous segment. Honored by OpenAI (except gpt-4o-transcribe-diarize), Azure OpenAI, Groq, Together, Alibaba, and AssemblyAI endpoints with prompted pricing configured. Other providers ignore it; use keyterms for supported keyword boosting. Takes precedence over provider-specific prompt options, including when empty. */ prompt?: string | undefined; /** * Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options */ provider?: STTRequestProvider | undefined; /** * Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. */ responseFormat?: STTRequestResponseFormat | undefined; /** * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. */ sessionId?: string | undefined; /** * Sampling temperature for transcription */ temperature?: number | undefined; /** * Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". */ timestampGranularities?: Array | undefined; /** * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. */ trace?: TraceConfig | undefined; /** * A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. */ user?: string | undefined; }; /** @internal */ export declare const STTRequestDataCollection$outboundSchema: z.ZodType; /** @internal */ export type STTRequestIgnore$Outbound = string | string; /** @internal */ export declare const STTRequestIgnore$outboundSchema: z.ZodType; export declare function sttRequestIgnoreToJSON(sttRequestIgnore: STTRequestIgnore): string; /** @internal */ export type STTRequestOnly$Outbound = string | string; /** @internal */ export declare const STTRequestOnly$outboundSchema: z.ZodType; export declare function sttRequestOnlyToJSON(sttRequestOnly: STTRequestOnly): string; /** @internal */ export type STTRequestOrder$Outbound = string | string; /** @internal */ export declare const STTRequestOrder$outboundSchema: z.ZodType; export declare function sttRequestOrderToJSON(sttRequestOrder: STTRequestOrder): string; /** @internal */ export type STTRequestProvider$Outbound = { allow_fallbacks?: boolean | null | undefined; data_collection?: string | null | undefined; ignore?: Array | null | undefined; only?: Array | null | undefined; options?: ProviderOptions$Outbound | undefined; order?: Array | null | undefined; zdr?: boolean | null | undefined; }; /** @internal */ export declare const STTRequestProvider$outboundSchema: z.ZodType; export declare function sttRequestProviderToJSON(sttRequestProvider: STTRequestProvider): string; /** @internal */ export declare const STTRequestResponseFormat$outboundSchema: z.ZodType; /** @internal */ export type STTRequest$Outbound = { diarize?: boolean | undefined; input_audio: STTInputAudio$Outbound; keyterms?: Array | undefined; language?: string | undefined; model: string; prompt?: string | undefined; provider?: STTRequestProvider$Outbound | undefined; response_format?: string | undefined; session_id?: string | undefined; temperature?: number | undefined; timestamp_granularities?: Array | undefined; trace?: TraceConfig$Outbound | undefined; user?: string | undefined; }; /** @internal */ export declare const STTRequest$outboundSchema: z.ZodType; export declare function sttRequestToJSON(sttRequest: STTRequest): string; //# sourceMappingURL=sttrequest.d.ts.map