//native
type Groq = {
api_key: string;
};
/**
* Delete model
* Delete a model
*/
export async function main(auth: Groq, model: string) {
const url = new URL(`https://api.groq.com/openai/v1/models/${model}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.api_key,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago