//native
type Ultravox = {
apiKey: string;
};
/**
* Api keys retrieve
* Gets an API key.
*/
export async function main(auth: Ultravox, api_key_prefix: string) {
const url = new URL(`https://api.ultravox.ai/api/api_keys/${api_key_prefix}`);
const response = await fetch(url, {
method: "GET",
headers: {
"X-API-Key": auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago