New video model APIs are live — view system announcements
AI Image Editing API

AI Image Editing API for product workflows

Use one API to transform reference images, create product variants, run style changes, and build editing features with supported Gemini and GPT image models.

Reference imagesPrompt editsUp to multi-output workflows

Image editing request

Send an input image plus prompt instructions to an editing-capable model.

REST
curl https://api.pixapi.ai/v1/images/edits \
  -H "Authorization: Bearer $PIXAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-3-pro-image-preview",
    "image": "https://cdn.example.com/product.png",
    "prompt": "Place the product in a clean studio scene",
    "n": 1,
    "size": "1:1"
  }'

Direct answer: how Pixapi image editing works

Pixapi image editing uses POST /v1/images/edits for synchronous edits and POST /v1/async/images/edits when the edit should run as a task.

Editing requests keep the API key on the server and send JSON fields such as model, image URL, prompt, n, and size to an editing-capable image model.

Use the endpoint for background replacement, product image variants, reference-guided edits, and upload flows where the app must track request ids and credit usage.

Build image editing without provider glue code

Editing workloads need stricter request validation, asset handling, retries, and billing clarity than one-off image demos.

Input image support

Use hosted image URLs in the JSON image field. Local files, multipart uploads, and base64 image data are not supported.

Prompt-controlled edits

Build workflows for product photography, background changes, style transfer, and creative variants.

Shared credit ledger

Use the same billing model for generation and editing so product teams can forecast visual AI costs.

Production observability

Track request ids and model ids so support can investigate failed or rejected edits.

Model fallback strategy

Compare Gemini and GPT image routes while keeping the surrounding API contract familiar.

Security-first integration

Keep user-upload handling and Pixapi keys on the server side instead of exposing provider credentials.

Image editing use cases

WorkflowPixapi model routeImplementation note
Background replacementGemini image editingSend source image plus a concise scene prompt.
Product variantsGemini or GPT image routeStore the request id and selected model for auditability.
Creative resizingImage generation or edit routeChoose aspect ratio and output count based on channel.
User-upload editingBackend-only Pixapi callValidate files and keep API keys out of browser code.

Image Editing API FAQ

Can Pixapi edit existing images?

Yes. Supported image models can receive an input image and prompt instructions through the image editing endpoint.

Is image editing priced like generation?

Editing consumes credits according to the selected model and output settings. Check the live model and pricing pages for current costs.

Can I request multiple edited outputs?

Supported routes can return multiple outputs. Use the output count parameter documented for the selected model.

Where should uploads be handled?

Handle uploads on your own backend or trusted storage layer, then pass validated hosted image URLs to Pixapi.

Add AI editing to your product flow

Use one Pixapi key for reference-based editing, text-to-image generation, and future visual model routes.

Create API key