//native
type Leonardoai = {
apiKey: string;
};
/**
* Delete init image
* This endpoint deletes an init image
*/
export async function main(auth: Leonardoai, id: string) {
const url = new URL(`https://cloud.leonardo.ai/api/rest/v1/init-image/${id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + 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