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 { SpeechInput, SpeechInput$Outbound } from "./speechinput.js"; import { SpeechInputReference, SpeechInputReference$Outbound } from "./speechinputreference.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 SpeechRequestDataCollection: { 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 SpeechRequestDataCollection = OpenEnum; export type SpeechRequestIgnore = ProviderName | string; export type SpeechRequestOnly = ProviderName | string; export type SpeechRequestOrder = 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 SpeechRequestProvider = { /** * 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?: SpeechRequestDataCollection | 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; }; /** * Audio output format */ export declare const SpeechRequestResponseFormat: { readonly Mp3: "mp3"; readonly Pcm: "pcm"; }; /** * Audio output format */ export type SpeechRequestResponseFormat = OpenEnum; /** * Text-to-speech request input */ export type SpeechRequest = { /** * Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models, by Fish Audio models other than S1, and by Speechify dialogue models. */ input: SpeechInput; /** * Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. An empty array is treated as no reference. */ inputReferences?: Array | undefined; /** * Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers. */ instructions?: string | undefined; /** * TTS model identifier */ model: string; /** * Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options */ provider?: SpeechRequestProvider | undefined; /** * Audio output format */ responseFormat?: SpeechRequestResponseFormat | 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; /** * Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control. */ speed?: number | 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; /** * Voice identifier (provider-specific). Required by most providers; only Seed Audio, HeyGen, Fish Audio, AssemblyAI, Speechify accept requests without it. */ voice?: string | undefined; }; /** @internal */ export declare const SpeechRequestDataCollection$outboundSchema: z.ZodType; /** @internal */ export type SpeechRequestIgnore$Outbound = string | string; /** @internal */ export declare const SpeechRequestIgnore$outboundSchema: z.ZodType; export declare function speechRequestIgnoreToJSON(speechRequestIgnore: SpeechRequestIgnore): string; /** @internal */ export type SpeechRequestOnly$Outbound = string | string; /** @internal */ export declare const SpeechRequestOnly$outboundSchema: z.ZodType; export declare function speechRequestOnlyToJSON(speechRequestOnly: SpeechRequestOnly): string; /** @internal */ export type SpeechRequestOrder$Outbound = string | string; /** @internal */ export declare const SpeechRequestOrder$outboundSchema: z.ZodType; export declare function speechRequestOrderToJSON(speechRequestOrder: SpeechRequestOrder): string; /** @internal */ export type SpeechRequestProvider$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 SpeechRequestProvider$outboundSchema: z.ZodType; export declare function speechRequestProviderToJSON(speechRequestProvider: SpeechRequestProvider): string; /** @internal */ export declare const SpeechRequestResponseFormat$outboundSchema: z.ZodType; /** @internal */ export type SpeechRequest$Outbound = { input: SpeechInput$Outbound; input_references?: Array | undefined; instructions?: string | undefined; model: string; provider?: SpeechRequestProvider$Outbound | undefined; response_format: string; session_id?: string | undefined; speed?: number | undefined; trace?: TraceConfig$Outbound | undefined; user?: string | undefined; voice?: string | undefined; }; /** @internal */ export declare const SpeechRequest$outboundSchema: z.ZodType; export declare function speechRequestToJSON(speechRequest: SpeechRequest): string; //# sourceMappingURL=speechrequest.d.ts.map