Skip to main content
OpenOpen8 exposes two image endpoints that are compatible with the OpenAI Images API. You can generate new images from a prompt, or supply a source image and a prompt to edit it. Both endpoints route your request to whichever upstream image channel you have configured — for example, DALL·E 3, Stable Diffusion, or other providers. Authenticate with a Bearer token in the Authorization header.

POST /v1/images/generations

Generate one or more images from a text prompt.

Request body

model
string
required
The model to use for image generation. For example, dall-e-3 or dall-e-2. The available values depend on which channels you have configured.
prompt
string
required
A text description of the image you want to generate. For DALL·E 3, the maximum length is 4,000 characters; for DALL·E 2 it is 1,000 characters.
n
integer
Number of images to generate. Defaults to 1. DALL·E 3 only supports n=1.
size
string
The dimensions of the generated image. Accepted values vary by model:
  • DALL·E 2: 256x256, 512x512, 1024x1024
  • DALL·E 3: 1024x1024, 1024x1792, 1792x1024
Defaults to 1024x1024.
quality
string
Image quality. Set to hd for higher detail at higher cost (DALL·E 3 only). Defaults to standard.
response_format
string
Format for the returned image data. Either url (a temporary hosted URL) or b64_json (base64-encoded image bytes). Defaults to url.
style
string
Style of the generated image. vivid (hyper-real) or natural (more realistic). DALL·E 3 only.
background
string
Background style for the generated image, if supported by the upstream provider.
output_format
string
Output file format, if supported by the upstream provider (e.g., png, webp).
output_compression
integer
Compression level for the output image, if supported by the upstream provider. Range is 0100.
watermark
boolean
Whether to include a watermark, if supported by the upstream provider.

Response

created
integer
Unix timestamp for when the request was processed.
data
object[]
Array of generated image objects.

Example

curl https://openopen8.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A photorealistic image of a red panda sitting on a mossy log in a misty forest",
    "n": 1,
    "size": "1024x1024",
    "response_format": "url"
  }'

POST /v1/images/edits

Edit an existing image using a text prompt. You upload the source image as a multipart form, optionally include a mask, and provide a prompt describing the desired change.

Request body

This endpoint uses multipart/form-data encoding.
model
string
required
The model to use for image editing. For example, dall-e-2. Not all image models support editing.
image
file
required
The source image to edit. Must be a valid PNG file, less than 4 MB, and square.
prompt
string
required
A description of the edits you want to apply.
mask
file
An optional mask image. Transparent areas of the mask indicate where the edit should be applied. Must be the same size as image.
n
integer
Number of edited images to generate. Defaults to 1.
size
string
Size of the output image. Accepted values: 256x256, 512x512, 1024x1024. Defaults to 1024x1024.
response_format
string
Either url or b64_json. Defaults to url.

Response

Same structure as /v1/images/generations.

Example

curl
curl https://openopen8.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F model="dall-e-2" \
  -F image="@source.png" \
  -F mask="@mask.png" \
  -F prompt="Replace the background with a snowy mountain scene" \
  -F n=1 \
  -F size="1024x1024"