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
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✓ | Image model (e.g. spook-generate) |
prompt | string | ✓ | Description of the image to generate |
n | integer | Number of images to generate | |
size | string | Like 1024x1024 | |
quality | string | standard / hd | |
response_format | string | url or b64_json | |
output_format | string | png, 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_jsonjavascript
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
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✓ | Edit model (e.g. spook-background) |
image | file | ✓ | Image to edit |
prompt | string | Edit instruction (ignored for background removal) | |
n | integer | Number of outputs | |
response_format | string | b64_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.