//native
type Leonardoai = {
apiKey: string;
};
/**
* Delete Texture Generation by ID
* This endpoint deletes the specific texture generation.
*/
export async function main(
auth: Leonardoai,
id: string,
body: { id?: string },
) {
const url = new URL(
`https://cloud.leonardo.ai/api/rest/v1/generations-texture/${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