Skip to content

Images

There are two endpoints: text-to-image generation and image editing (e.g. background removal).

Image generation

POST/v1/images/generations

Generates an image from a text description (prompt).

Request parameters

FieldTypeRequiredDescription
modelstringImage model (e.g. spook-generate)
promptstringDescription of the image to generate
nintegerNumber of images to generate
sizestringLike 1024x1024
qualitystringstandard / hd
response_formatstringurl or b64_json
output_formatstringpng, jpeg, webp

Example

bash
curl https://app.qevron.ai/v1/images/generations \
  -H "Authorization: Bearer $QEVRON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "spook-generate",
    "prompt": "Sunset behind mountains, watercolor style",
    "n": 1,
    "size": "1024x1024",
    "response_format": "b64_json"
  }'
python
resp = client.images.generate(
    model="spook-generate",
    prompt="Sunset behind mountains, watercolor style",
    n=1,
    size="1024x1024",
    response_format="b64_json",
)
b64 = resp.data[0].b64_json
javascript
const resp = await client.images.generate({
  model: "spook-generate",
  prompt: "Sunset behind mountains, watercolor style",
  n: 1,
  size: "1024x1024",
  response_format: "b64_json",
});
const b64 = resp.data[0].b64_json;

Response

json
{
  "created": 1716200000,
  "data": [
    { "b64_json": "iVBORw0KGgoAAAANS..." }
  ]
}

If response_format is url, data[].url is returned; if b64_json, data[].b64_json.

Image editing

POST/v1/images/edits

Uploads and edits an image. For example, the spook-background model removes the background of the image. This endpoint uses multipart/form-data.

Form fields

FieldTypeRequiredDescription
modelstringEdit model (e.g. spook-background)
imagefileImage to edit
promptstringEdit instruction (ignored for background removal)
nintegerNumber of outputs
response_formatstringb64_json

Example

bash
curl https://app.qevron.ai/v1/images/edits \
  -H "Authorization: Bearer $QEVRON_API_KEY" \
  -F "model=spook-background" \
  -F "image=@photo.jpg" \
  -F "n=1" \
  -F "response_format=b64_json"

TIP

spook-background removes the background and requires no prompt; even if you send one it is ignored. It returns a transparent PNG.

Qevron — AI gateway. Arpanet / OpenAI / Anthropic / Gemini compatible.