export type DeleteApiV1CustomVoicesVoiceIdArgs = {voice_id: string}; export type DeleteApiV1CustomVoicesVoiceIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete cloned voice * * DELETE /v1/custom-voices/{voice_id} */ export const deleteApiV1CustomVoicesVoiceId = async (args: DeleteApiV1CustomVoicesVoiceIdArgs, options?: DeleteApiV1CustomVoicesVoiceIdOptions) => { const {baseUrl = "https://supertoneapi.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("x-sup-api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/custom-voices/${encodeURIComponent(String(args.voice_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };