POST https://api.i-as.dev/api/ai/diffusion
Ensure that you include the appropriate headers, such as:
Content-Type: application/json
Provide a JSON object with the following structure:
{
"keyword": "string or url_image"
}
Field | Type | Description |
---|---|---|
keyword |
string |
A keyword describing the image to generate or a valid image URL. |
The response will return a JSON object containing a list of generated images and their details.
{
"images": [
{
"id": "string",
"srcSmall": "url",
"srcMedium": "url",
"prompt": "string",
"width": "value",
"height": "value"
}
// More data
]
}
Field | Type | Description |
---|---|---|
id |
string |
A unique identifier for the generated image. |
srcSmall |
url |
URL for the small version of the generated image. |
srcMedium |
url |
URL for the medium version of the generated image. |
prompt |
string |
The keyword or prompt used for generating the image. |
width |
value |
The width of the generated image in pixels. |
height |
value |
The height of the generated image in pixels. |
POST https://api.i-as.dev/api/ai/diffusion
Content-Type: application/json
{
"keyword": "sunset over the mountains"
}
{
"images": [
{
"id": "123456",
"srcSmall": "https://example.com/images/small/123456.jpg",
"srcMedium": "https://example.com/images/medium/123456.jpg",
"prompt": "sunset over the mountains",
"width": 800,
"height": 600
}
]
}
Error Code | Message | Description |
---|---|---|
400 | Invalid Request |
The request body is missing or incorrectly formatted. |
500 | Internal Server Error |
An error occurred on the server while processing. |
{
"error": {
"code": "400",
"message": "Invalid Request"
}
}
keyword
value is meaningful to generate accurate and relevant images.srcSmall
and srcMedium
can be used to fetch and display the images in your application.