export type CreateApiAllmodelsElV1SpeechToTextArgs = {body: {file: string, model_id?: string | undefined, language_code?: string | undefined}}; export type CreateApiAllmodelsElV1SpeechToTextOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Transcribe audio files using the ElevenLabs SDK-compatible endpoint. Returns transcript with word-level timestamps. Accepts WAV, MP3, FLAC, MP4/M4A, OGG, and WebM. * * POST /allmodels/el/v1/speech-to-text */ export const createApiAllmodelsElV1SpeechToText = async (args: CreateApiAllmodelsElV1SpeechToTextArgs, options?: CreateApiAllmodelsElV1SpeechToTextOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/allmodels/el/v1/speech-to-text${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };