Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/MonoRelay/llms.txt

Use this file to discover all available pages before exploring further.

MonoRelay exposes three image endpoints that mirror the OpenAI Images API: generating new images from text prompts, creating variations of an existing image, and editing an image using a masked region with an inpainting prompt. All three endpoints route through the same provider resolution logic as the rest of the API, so you can point them at any configured provider that supports image capabilities.

POST /v1/images/generations

Generate one or more images from a text prompt.
POST /v1/images/generations

Authentication

Authorization: Bearer <your-access-token>

Request body

model
string
required
The image generation model to use (e.g. dall-e-3, dall-e-2). Accepts aliases and model@provider syntax.
prompt
string
required
A text description of the desired image. For DALL-E 3, prompts up to 4000 characters are supported.
n
integer
default:"1"
Number of images to generate. For DALL-E 3 this must be 1. For DALL-E 2, up to 10 images can be requested.
size
string
Image dimensions. Accepted values depend on the model — for DALL-E 3: "1024x1024", "1792x1024", or "1024x1792". For DALL-E 2: "256x256", "512x512", or "1024x1024".
response_format
string
default:"url"
Output format for the generated image: "url" (a temporary CDN link) or "b64_json" (base64-encoded PNG data). Not all providers support both formats.

Example

curl https://<host>/v1/images/generations \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A photorealistic relay server rack glowing with neon lights",
    "n": 1,
    "size": "1024x1024"
  }'

POST /v1/images/variations

Create variations of an existing image. The request is sent as multipart/form-data.
POST /v1/images/variations

Request parameters

file
file
required
The source image to vary, uploaded as a multipart file field. Must be a PNG, less than 4 MB, and square.
model
string
required
The model to use for generation.
n
integer
default:"1"
Number of variations to generate.
size
string
Output image size. Same accepted values as /generations.
response_format
string
default:"url"
Output format: "url" or "b64_json".

Example

curl https://<host>/v1/images/variations \
  -H "Authorization: Bearer <token>" \
  -F "file=@original.png" \
  -F "model=dall-e-2" \
  -F "n=2" \
  -F "size=512x512"

POST /v1/images/edits

Edit an image by providing a mask that defines the region to regenerate, along with a text prompt describing the replacement content. The request is sent as multipart/form-data.
POST /v1/images/edits

Request parameters

image
file
required
The original image to edit. Must be a square PNG, less than 4 MB, with an alpha channel (transparency) used as the edit mask when no separate mask file is provided.
mask
file
An optional separate mask image. Transparent pixels indicate where the image should be edited. Must be the same size as image.
model
string
required
The model to use for inpainting.
prompt
string
required
A text description of what should appear in the masked area.
n
integer
default:"1"
Number of edited images to generate.
size
string
Output image size.
response_format
string
default:"url"
Output format: "url" or "b64_json".

Example

curl https://<host>/v1/images/edits \
  -H "Authorization: Bearer <token>" \
  -F "image=@photo.png" \
  -F "mask=@mask.png" \
  -F "model=dall-e-2" \
  -F "prompt=A sunny park bench with flowers" \
  -F "n=1" \
  -F "size=1024x1024"

Response format

All three endpoints return the same response structure:
{
  "created": 1710000000,
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "A photorealistic relay server rack..."
    }
  ]
}
When response_format is "b64_json", the url field is replaced with b64_json containing the raw PNG data encoded as a base64 string. The revised_prompt field is only present for DALL-E 3 responses.

Build docs developers (and LLMs) love