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

ParameterTypeDescription
number_imagesintegerNumber of images to generate (1-50)
textstringInput text for generating context-aware images (up to 9.5M characters)
stylestring

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)

sizestring

Size of the images.

Options include:

512x512

768x768

1024x1024

2048x2048

1280x720

1920x1080

2560x1440

720x1280

1080x1920

1440x2560

Headers

HeaderDescription
X-API-KEYYour API key. Example: [YOUR-API-KEY]
Content-Typeapplication/json

Response

{
  "id": "517add91-fd4f-4962-b134-3473d35b8eac",
  "status": "scheduled"
}
ParameterTypeDescription
idstringUnique identifier for the request
statusstring

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

HeaderDescription
X-API-KEYYour API key. Example: [YOUR-API-KEY]
Content-Typeapplication/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

ParameterTypeDescription
credits_usedintegerNumber of credits used for the request
ended_atstringTimestamp when the request was completed
idstringUnique identifier for the request
imagesarray

Array of generated images.

Each item contains:

style style the image was genearte with

url location of the png file to download

input_textstringInput text provided for image generation
promptstringDetailed prompt used for image generation
sizestringSize of the generated images
statusstringStatus of the request (finished/failed)
stylestringStyle of the generated images