API Documentation
Table of Contents
API Overview
WeContextify generates stunning context-aware images. This documentation provides details on how to use the API to generate images.
Generate an API Key here: API Keys
Generate Image
# Make an image generation request
curl 'https://api.wecontextify.com/v1/image' \
-X 'POST' \
-H 'X-API-KEY: [YOUR-API-KEY]' \
-H 'Content-Type: application/json' \
-d '{
"number_images": 3,
"style": "random",
"text": "Happy Birthday!",
"size":"720x1280"
}'
# Check the status of the image generation request
curl 'https://api.wecontextify.com/v1/status/d742a1c4-8615-496c-8741-bc2aa6f5d5d0' \
-H 'X-API-KEY: [YOUR-API-KEY]' \
-H 'Content-Type: application/json'
To generate an image, make a POST request to the following endpoint:
POST https://api.wecontextify.com/v1/image
{
"number_images": 3,
"style": "random",
"text": "Happy Birthday!",
"size":"720x1280"
}
Request Body
Parameter | Type | Description |
---|---|---|
number_images | integer | Number of images to generate (1-50) |
text | string | Input text for generating context-aware images (up to 9.5M characters) |
style | string | Style of the images. Options include: 3d_model analog_film anime cinematic comic_book craft_clay digital_art enhance fantasy_art isometric line_art lowpoly neonpunk origami photographic pixelart texture random (uses random style per image) |
size | string | Size of the images. Options include: 512x512 768x768 1024x1024 2048x2048 1280x720 1920x1080 2560x1440 720x1280 1080x1920 1440x2560 |
Headers
Header | Description |
---|---|
X-API-KEY | Your API key. Example: [YOUR-API-KEY] |
Content-Type | application/json |
Response
{
"id": "517add91-fd4f-4962-b134-3473d35b8eac",
"status": "scheduled"
}
Parameter | Type | Description |
---|---|---|
id | string | Unique identifier for the request |
status | string | Current status of the request. The possible status codes are: queued The job is waiting in the queue to be processed started The job has started processing finished The job has completed successfully failed The job has failed during processing |
Check Status
To check the status of an image generation request, make a GET request to the following endpoint:
GET https://api.wecontextify.com/v1/status/[request_id]
Headers
Header | Description |
---|---|
X-API-KEY | Your API key. Example: [YOUR-API-KEY] |
Content-Type | application/json |
Response
GET https://api.wecontextify.com/v1/status/24acf5ba-c349-4dd8-ad5a-928d24fc2257
{
"credits_used": 3,
"ended_at": "2024-06-27T20:17:14.116663",
"id": "24acf5ba-c349-4dd8-ad5a-928d24fc2257",
"images": [
{
"style": "Line Art",
"url": "https://cdn.wecontextify.com/24acf5ba-c349-4dd8-ad5a-928d24fc2257/1.png"
},
{
"style": "Digital Art",
"url": "https://cdn.wecontextify.com/24acf5ba-c349-4dd8-ad5a-928d24fc2257/2.png"
},
{
"style": "Craft Clay",
"url": "https://cdn.wecontextify.com/24acf5ba-c349-4dd8-ad5a-928d24fc2257/3.png"
}
],
"input_text": "Happy Birthday!",
"prompt": "A bright and colorful illustration of a smiling cake with candles lit, surrounded by balloons and confetti, with a big Happy Birthday banner written in bold letters and a few gifts proudly placed around it",
"size": "720x1280",
"status": "finished",
"style": "random"
}
Response Parameters
Parameter | Type | Description |
---|---|---|
credits_used | integer | Number of credits used for the request |
ended_at | string | Timestamp when the request was completed |
id | string | Unique identifier for the request |
images | array | Array of generated images. Each item contains: style style the image was genearte with url location of the png file to download |
input_text | string | Input text provided for image generation |
prompt | string | Detailed prompt used for image generation |
size | string | Size of the generated images |
status | string | Status of the request (finished/failed) |
style | string | Style of the generated images |