const inp = document.getElementById(‘inp’);
const images = document.querySelector(‘.images’);
const getImage = async () =>{
const methods={
method:“POST”,
headers:{
“Content-Type”: “application/json”,
“Authorization”:Bearer ${api}
},
body:JSON.stringify(
{
“model”: “dall-e-3”,
“prompt”:inp.value,
“n”:3,
“size”:“1024x1024”
}
)}
const res = await fetch(“here i put url”,methods);
const data = await res.json();
console.log(data);
}
DocumentAI images generator
</div>
<div class="prompt">
<input id="inp" type="text">
<button onclick="getImage()">generate</button>
</div>
<script src="scripts.js"></script>