Skip to main content

Automatically Buy Lora Model

Overview

This endpoint allows you to buy a Lora model automatically.

Request

--request POST 'https://modelslab.com/api/v3/dreambooth/buy_model' \
caution

Before calling this endpoint, make sure that you have enabled Lora Auto Payment on your dashboard.

Send a POST request to https://modelslab.com/api/v3/dreambooth/buy_model endpoint and pass the quantity of the models you want to buy in the request body.

Attributes

ParameterTypeDescription
keyStringYour API Key used for request authorization
quantityStringThe number of models you want to buy

Example

Body

Body Raw
{
"key": "",
"quantity": "4"
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key": "",
"quantity": "4"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v3/dreambooth/buy_model", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
"status": "success",
"messege": "Payment was charged successfuly",
"purchased_models": 4,
"used_models": 0,
"available_models": 42
}