Imagine
Create an image using a text prompt.
Just Imagine API Model
Just Imagine API model contains all the information about your contacts, such as their username, avatar, and phone number. It also contains a reference to the conversation between you and the contact and information about when they were last active on Protocol.
Properties
- Name
msg
- Type
- string
- Description
The prompt that you'd like to use to create the image.
POST/v1/imagine
Create an Image using Imagine
Create a new image using a text prompt.
Image to Image Requests
If you would like to create an image to image
request, all you need to do is include a URL of an image in your message!
Optional attributes
- Name
ref (optional)
- Type
- string
- Description
A unique identifier for the job.
- Name
webhookOverride (optional)
- Type
- string
- Description
A webhook URL to override the default webhook for this job.
Request
POST
/v1/imaginevar myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer {token}");
var raw = JSON.stringify({
"msg": "Your Prompt",
"ref": "your-ref",
"webhookOverride": "https://your-webhook.com"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.justimagineapi.org/v1/imagine", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Response
{
"messageId": "message-id",
}
GET/v1/message/:messageId
Get The Completion Response
The completion response will automatically be sent to your webhook when the image is ready. You can see more about getting messages here.