//native
type Speechify = {
token: string;
};
/**
* Get voices
* Gets the list of voices available for the user
*/
export async function main(auth: Speechify) {
const url = new URL(`https://api.sws.speechify.com/v1/voices`);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 428 days ago