export type GetApiAllmodelsV1VoicesArgs = {provider?: string | undefined, language?: string | undefined, gender?: string | undefined, search?: string | undefined}; export type GetApiAllmodelsV1VoicesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search and filter available voices across all providers. Supports filtering by provider, language, gender, and use case. Public endpoint, no authentication required. * * GET /allmodels/v1/voices */ export const getApiAllmodelsV1Voices = async (args: GetApiAllmodelsV1VoicesArgs, options?: GetApiAllmodelsV1VoicesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.provider != null) query.append("provider", String(args.provider)) if (args.language != null) query.append("language", String(args.language)) if (args.gender != null) query.append("gender", String(args.gender)) if (args.search != null) query.append("search", String(args.search)) const url = `${baseUrl.replace(/\/+$/, '')}/allmodels/v1/voices${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };