//native
type Leonardoai = {
apiKey: string;
};
/**
* Delete 3D Model by ID
* This endpoint deletes the specific 3D Model
*/
export async function main(
auth: Leonardoai,
id: string,
body: { id?: string },
) {
const url = new URL(`https://cloud.leonardo.ai/api/rest/v1/models-3d/${id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.apiKey,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago