Upload Image
Upload an image and get an image URL. You can then use this image URL in your prompts.
POST
https://api.apiframe.pro/upload
Headers
Name
Value
Content-Type
multipart/form-data
Authorization*
Your APIFRAME API Key
Body
Name
Type
Description
image
*
binary
The image file you want to upload. Maximum 2MB!
Response
// Success, the task has been submitted
{
"imageURL": "https://cdn.apiframe.pro/images/xxxxxxxxxxxxxxxxxxx.png"
}
Code samples
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('image', fs.createReadStream('..../image.png'));
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.apiframe.pro/upload',
headers: {
'Authorization': 'YOUR_API_KEY',
...data.getHeaders()
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Last updated
Was this helpful?