Quotaflow
llms.txtOpenAPIDashboard
OpenAI-compatible

Images

Generate images, edit existing images, replace backgrounds, and compose product visuals through Quotaflow's OpenAI-compatible image endpoints.

Quotaflow Image Editing
Quotaflow Image Editing

When to use this page

Use this page when your application already expects OpenAI-style image generation or image editing request shapes. For model-specific guidance, use the dedicated references for GPT Image 2, Gemini 3.1 Flash Image, and Gemini 3 Pro Image.

Endpoints

POST https://api.quotaflow.ai/openai/v1/images/generations
POST https://api.quotaflow.ai/openai/v1/images/edits
GET  https://api.quotaflow.ai/openai/v1/images/jobs/{id}

Supported models

Call /models to confirm which image models are enabled for your key.

gemini-3-pro-image-preview is not generally enabled while its independent supply validation is incomplete. Do not assume availability unless the authenticated /models response for your key includes it.

Key features

Do not send text-model reasoning controls such as top-level thinking to /images/generations or /images/edits. Image endpoints return a clear 400 invalid_request_error for unsupported parameter families and do not retry those requests on another image execution path.

Common use cases

Use caseRecommended endpointNotes
Create a new product hero image from text/images/generationsStart with gpt-image-2 when you need an OpenAI-style image response.
Replace or clean up a product background/images/editsSend the source image plus a prompt. Add a mask when only one region should change.
Combine a product photo and a scene reference/images/editsSend multiple input images in one request. Explain which image is the product and which is the scene or style reference.
Produce marketplace variants/images/editsReuse the same source image with different prompts for backgrounds, props, lighting, or aspect ratios.
Localized object or text-area edits/images/edits with maskMasks guide the region to change, but review output before production use.
Preserve a person, object, layout, or product identity/images/edits with a focused prompt and optional maskgpt-image-2 treats image inputs as high fidelity automatically.

Generate an image

For generation requests, n controls the number of output images. Large n values can take longer because Quotaflow may process the request in batches and aggregate successful image results before returning one OpenAI-compatible response. Configure client timeouts for the full generation job.

curl https://api.quotaflow.ai/openai/v1/images/generations \
  -H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A clean product screenshot style illustration of a teal API dashboard.",
    "size": "1024x1024",
    "response_format": "b64_json"
  }'

Edit an image

Use multipart when your application has local files:

curl https://api.quotaflow.ai/openai/v1/images/edits \
  -H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
  -F "model=gpt-image-2" \
  -F "image=@./input.png" \
  -F "mask=@./mask.png" \
  -F "prompt=Change only the masked area to a clean teal gradient" \
  -F "size=1024x1024" \
  -F "quality=high" \
  -F "response_format=b64_json"

For server-side image URLs, send JSON:

curl https://api.quotaflow.ai/openai/v1/images/edits \
  -H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Change only the masked area to a clean teal gradient",
    "images": [{ "image_url": "https://example.com/input.png" }],
    "mask": { "image_url": "https://example.com/mask.png" },
    "size": "1024x1024",
    "quality": "high",
    "response_format": "b64_json"
  }'

Async image jobs

High-resolution or high-fidelity gpt-image-2 renders can take several minutes. If your application does not want to keep a single HTTP connection open, opt in to Quotaflow async image jobs on JSON requests:

curl https://api.quotaflow.ai/openai/v1/images/generations \
  -H "Authorization: Bearer $QUOTAFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A detailed high-resolution ecommerce hero image of a teal API dashboard.",
    "size": "2880x2880",
    "response_format": "url",
    "async": true
  }'

The create call returns 202 Accepted:

{
  "id": "imgjob_...",
  "object": "image.generation.job",
  "status": "queued",
  "model": "gpt-image-2",
  "created": 1781600000,
  "expires_at": 1781601800,
  "status_url": "/openai/v1/images/jobs/imgjob_..."
}

Poll the status URL with the same API key:

curl https://api.quotaflow.ai/openai/v1/images/jobs/imgjob_... \
  -H "Authorization: Bearer $QUOTAFLOW_API_KEY"

While the job is running, status is queued or running. When it succeeds, the response contains status: "succeeded" and a response object with an OpenAI-compatible image payload. Async jobs return hosted URL output in response.data[].url, plus expires_at, and include usage when exact accounting is available. If a policy or validation error occurs, the job response contains a sanitized error object. Job IDs are scoped to the API key that created them.

Async image jobs currently require JSON request bodies. For edits, use images[].image_url and optional mask.image_url; multipart file uploads remain synchronous.

Reference images from Responses

If your client uses the Responses API, you can pass reference images as input_image content items and attach the image_generation tool. Quotaflow accepts input_image.image_url values, including HTTPS URLs and data URLs, and bridges those requests to the same edit-capable image pool. Use /images/edits directly when you need multipart file uploads, masks, or explicit multi-image edit request control.

Edit request rules

Prompting tips

Response shape

Quotaflow returns an OpenAI-compatible image response. Use response_format: "b64_json" when you want image bytes directly in the response. For non-streaming image generation and edits, response_format: "url" is a Quotaflow extension that can return data[].url plus data[].expires_at as a temporary hosted URL; download or copy the image to your own storage before it expires. Successful image responses usually include an OpenAI-style usage object. gpt-image-2 usage is normalized to official-compatible image truth rather than copying unverified provider usage. When exact accounting is unavailable, usage may be omitted, so clients should not require the field to be present.