Skip to content

Images

BVE Gateway supports image generation and image editing.

POST https://api.bve.me/v1/images/generations

Requires Authorization: Bearer sk-bve-YOUR_KEY.

Generates images from a text prompt. Proxies directly to Fuelix.

{
"model": "imagen-3",
"prompt": "A photorealistic red apple on a white background",
"n": 1
}
FieldTypeRequiredDescription
modelstringYesImage model (see below)
promptstringYesText description of the image
nintegerNoNumber of images, 1–10. dall-e-3 only supports 1.
sizestringNoImage size (model-dependent)
qualitystringNostandard, hd, low, medium, high, or auto (model-dependent)
response_formatstringNourl or b64_json for DALL-E models. GPT image models always return base64 image data.
output_formatstringNopng, jpeg, or webp (GPT image models)
output_compressionintegerNoCompression level 0–100 for jpeg/webp GPT image outputs
streambooleanNoEnable image streaming mode
partial_imagesintegerNoNumber of partial images to emit in streaming mode, 0–3
moderationstringNolow or auto (GPT image models)
backgroundstringNotransparent, opaque, or auto (GPT image models)
stylestringNonatural or vivid (dall-e-3 only)
userstringNoEnd-user identifier, up to 256 characters
ModelDescription
imagen-3Google Imagen 3 — high-quality photorealistic images
imagen-3-fastGoogle Imagen 3 Fast — faster generation, similar quality
imagen-4Google Imagen 4 — latest generation
imagen-4-ultraGoogle Imagen 4 Ultra — highest quality
dall-e-3OpenAI DALL-E 3 — high-quality images with precise prompt adherence
dall-e-2OpenAI DALL-E 2 — faster, lower-cost image generation
gpt-image-1OpenAI GPT Image 1 — multimodal-native image generation
{
"created": 1716288000,
"data": [
{
"url": "https://..."
}
]
}
Terminal window
curl https://api.bve.me/v1/images/generations \
-H "Authorization: Bearer sk-bve-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "imagen-3",
"prompt": "A photorealistic red apple on a white background",
"n": 1
}'
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
const image = await client.images.generate({
model: 'imagen-3',
prompt: 'A photorealistic red apple on a white background',
n: 1,
});
console.log(image.data[0].url);
import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
const result = await client.images.generate({
model: 'gpt-image-1',
prompt: 'A serene mountain lake at sunrise',
output_format: 'webp',
quality: 'high',
});
const imageData = result.data[0].b64_json!;
const buffer = Buffer.from(imageData, 'base64');
fs.writeFileSync('output.webp', buffer);
console.log('Saved output.webp');

The gateway validates required and optional fields before forwarding to Fuelix. Invalid inputs return 400 with an OpenAI-compatible error body instead of an opaque upstream error.

Required fields:

Missing / invalidCodeparam
model absentmissing_required_parameter"model"
model not a stringinvalid_type"model"
prompt absentmissing_required_parameter"prompt"
prompt not a stringinvalid_type"prompt"

Optional field constraints:

FieldConstraintCodeparam
nNot a numberinvalid_type"n"
nNot an integer between 1 and 10invalid_value"n"
sizeNot a stringinvalid_type"size"
qualityNot a stringinvalid_type"quality"
qualityNot one of "standard", "hd", "low", "medium", "high", "auto"invalid_value"quality"
response_formatNot a stringinvalid_type"response_format"
response_formatNot "url" or "b64_json"invalid_value"response_format"
output_formatNot a stringinvalid_type"output_format"
output_formatNot one of "png", "jpeg", "webp"invalid_value"output_format"
output_compressionNot a numberinvalid_type"output_compression"
output_compressionNot an integerinvalid_value"output_compression"
output_compressionNot between 0 and 100invalid_value"output_compression"
streamNot a booleaninvalid_type"stream"
partial_imagesNot a numberinvalid_type"partial_images"
partial_imagesNot an integer between 0 and 3invalid_value"partial_images"
moderationNot a stringinvalid_type"moderation"
moderationNot "low" or "auto"invalid_value"moderation"
backgroundNot a stringinvalid_type"background"
backgroundNot one of "transparent", "opaque", "auto"invalid_value"background"
styleNot a stringinvalid_type"style"
styleNot "vivid" or "natural"invalid_value"style"
userNot a stringinvalid_type"user"
userMore than 256 charactersinvalid_value"user"

size is model-dependent and not enumerated by the gateway — it only validates that the value is a string when provided.


POST https://api.bve.me/v1/images/edits

Requires Authorization: Bearer sk-bve-YOUR_KEY.

Edits an existing image based on a prompt. Accepts multipart/form-data.

FieldTypeRequiredDescription
imagebinaryYesPNG image to edit (max 4 MB, must be square)
image[]binary[]NoAdditional reference images. Repeating image[] fields is supported for multi-image edit/generation workflows.
promptstringYesDescription of the desired edit
maskbinaryNoPNG mask (transparent areas indicate where to edit)
modelstringNoImage model to use
nintegerNoNumber of images, 1–10
sizestringNoImage size
response_formatstringNourl or b64_json
output_formatstringNopng, jpeg, or webp (GPT image models)
output_compressionintegerNoCompression level 0–100 for jpeg/webp GPT image outputs
backgroundstringNotransparent, opaque, or auto (GPT image models)
input_fidelitystringNohigh or low (GPT image models)
streambooleanNoEnable streaming edit mode
partial_imagesintegerNoNumber of partial images to emit in streaming mode, 0–3
qualitystringNostandard, low, medium, high, or auto
userstringNoEnd-user identifier, up to 256 characters
Terminal window
curl https://api.bve.me/v1/images/edits \
-H "Authorization: Bearer sk-bve-YOUR_KEY" \
-F image="@image.png" \
-F prompt="Add a rainbow in the background" \
-F model="imagen-3"
import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
const result = await client.images.edit({
image: fs.createReadStream('image.png'),
prompt: 'Add a rainbow in the background',
model: 'imagen-3',
});
console.log(result.data[0].url);
import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
// Pass multiple images as an array for multi-image edit workflows
const result = await client.images.edit({
image: [
fs.createReadStream('image1.png'),
fs.createReadStream('image2.png'),
],
prompt: 'Combine these two images into one scene',
model: 'gpt-image-1',
});
console.log(result.data[0].b64_json);

The gateway validates required form fields and optional constraints before forwarding the multipart request to Fuelix. Invalid inputs return 400 with an OpenAI-compatible error body instead of an opaque upstream error.

Required fields:

Missing / invalidCodeparam
image (and image[]) both absentmissing_required_parameter"image"
prompt absentmissing_required_parameter"prompt"
prompt empty stringinvalid_value"prompt"

Optional field constraints:

FieldConstraintCodeparam
modelNot a stringinvalid_type"model"
nNot a parseable integer between 1 and 10invalid_value"n"
sizeNot a stringinvalid_type"size"
response_formatNot a stringinvalid_type"response_format"
response_formatNot "url" or "b64_json"invalid_value"response_format"
output_formatNot a stringinvalid_type"output_format"
output_formatNot one of "png", "jpeg", "webp"invalid_value"output_format"
output_compressionNot a parseable integer between 0 and 100invalid_value"output_compression"
input_fidelityNot a stringinvalid_type"input_fidelity"
input_fidelityNot "high" or "low"invalid_value"input_fidelity"
streamNot "true" or "false" (form strings)invalid_value"stream"
partial_imagesNot a parseable integer between 0 and 3invalid_value"partial_images"
qualityNot a stringinvalid_type"quality"
qualityNot one of "standard", "low", "medium", "high", "auto"invalid_value"quality"
backgroundNot a stringinvalid_type"background"
backgroundNot one of "transparent", "opaque", "auto"invalid_value"background"
userNot a stringinvalid_type"user"
userMore than 256 charactersinvalid_value"user"

BVE Gateway adds the following headers to every authenticated response:

HeaderExampleDescription
X-Request-Id550e8400-…UUID for this request (generated per request)
X-BVE-Client-Idmy-trace-123Echo of the client-supplied X-Request-Id (when present and valid: alphanumeric + -_., ≤ 128 chars). Absent when not supplied or value failed validation.
X-BVE-Latency143Total gateway latency in milliseconds
X-BVE-Modelimagen-3Model ID resolved for this request
X-BVE-Key-Nameprod-keyName of the API key used for this request (redacted if it matches a provider credential pattern)

The full X-RateLimit-* header set (RPM, RPD, monthly) is also included. See Rate Limits & Quotas for details and example output.