REST API · Live

AI Image Editor API

A production AI Image Editor API that applies a natural-language instruction to a photo and returns the edited frame. JSON in, image out. $0.03 per image (30 credits). 5,000 free credits (24-hour trial), no credit card.

$0.03 / imageJSON + promptOptional reference image5,000 free credits (24-hour trial)No credit card
Get an API key (free) Quick start See pricing API docs

Quick start — AI Image Editor API

This is the instruction-based image editor: you describe the change in a sentence, not with a brush. The route is POST /v1/image/edit with JSON. Image may be a public URL or a base64 data URI.

curl -X POST https://api.pixelapi.dev/v1/image/edit \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image":"https://example.com/portrait.jpg","prompt":"make the background a sunset beach scene"}'

curl https://api.pixelapi.dev/v1/image/GENERATION_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
import requests
r = requests.post(
    "https://api.pixelapi.dev/v1/image/edit",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "image": "https://example.com/portrait.jpg",
        "prompt": "make the background a sunset beach scene",
    },
)
job = r.json()
const res = await fetch("https://api.pixelapi.dev/v1/image/edit", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIXELAPI_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    image: "https://example.com/portrait.jpg",
    prompt: "make the background a sunset beach scene",
  }),
});
const job = await res.json();
require "net/http"
require "json"
uri = URI("https://api.pixelapi.dev/v1/image/edit")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
req["Content-Type"] = "application/json"
req.body = {image: "https://example.com/portrait.jpg",
            prompt: "make the background a sunset beach scene"}.to_json
job = JSON.parse(Net::HTTP.start(uri.host, uri.port, use_ssl: true){|h| h.request(req)}.body)

What the AI Image Editor API is for

Most “edit this photo” products still mean sliders and layers. This endpoint is a developer Image Editor API: a REST call that applies a natural-language instruction while keeping the person or product recognizable. Typical prompts: “change the hair color to blonde”, “add dramatic studio lighting”, “make the person wear a red dress”, “restore the old photo to high quality”, “make the background a sunset beach scene”.

Use dedicated tools when the job is mechanical. Transparent cutouts go to the Background Removal API. Erasing a person or a cable goes to the Remove Object API. Date stamps and watermarks go to the Remove Text API. Print resolution goes to the Upscale API. The editor is for semantic change — lighting, wardrobe, setting, color — not for punching a hole in a layer.

Primary image + prompt

image is required (https URL or data:image/...;base64,...). prompt is required, 1–2000 characters. Write a single concrete change. Stacking five unrelated asks in one sentence usually muddies identity.

Optional reference image

reference_image is a second URL or data URI. Mention it as “the second image” in the prompt when you want a garment, prop, or palette copied onto the subject. Output keeps the primary frame’s size.

Pricing comparison

Live charge is $0.03 per image (30 credits) from /v1/pricing/live. That is the instruction-based editor meter, not the cheaper erase/upscale meters.

VendorInterfaceTypical paid rate
PixelAPI AI Image Editor APIJSON REST, URL or data URI, optional reference$0.03 / image
Hosted edit APIs (Clipdrop, similar)REST, often per-seat plus creditsUsually $0.04–$0.20 / image
Adobe / consumer editorsUI, generative credits, no simple server keySubscription
Notebook-style GPU hostsYou run the graphGPU-hour, not per image

5,000 free credits (24-hour trial), no card. After that, prepaid credits. Do not hard-code a price in your app — read /v1/pricing/live so a rate change cannot silently under-charge or over-charge a customer.

Production notes

Use cases and related pages

Agencies batch seasonal color on product stills. Portrait apps restyle lighting. Marketplaces apply a studio look to phone photos. Fashion tools drape a reference garment when you pass reference_image.

Industry: ecommerce, fashion, photography, social, real estate. How-tos: modify background, modify clothing, change color, retouch portrait, add an element. Alternatives: Adobe Firefly, Clipdrop, Leonardo. Index hubs: use cases, alternatives, howto.

Frequently asked questions

How do I edit an image with a text instruction via API?

POST JSON to https://api.pixelapi.dev/v1/image/edit with a Bearer key. Send image as an https URL or a data URI, plus prompt describing the change. Poll GET /v1/image/{id} until completed and download output_url.

What does the AI Image Editor API cost?

$0.03 per image (30 credits). Live rate is on /v1/pricing/live. New accounts get 5,000 free credits on a 24-hour trial, no card.

What kinds of edits work well?

Scene and appearance changes in natural language: change a background, restyle lighting, recolor a garment, add studio light, restore an old print. It is not the right tool to cut a transparent background or to erase a watermark — use those dedicated endpoints.

Can I pass a second reference image?

Yes. Optional reference_image (URL or data URI) is a visual guide — for example a garment to apply. Refer to it in the prompt as 'the second image'. Output keeps the primary image size and aspect.

Is the request multipart or JSON?

JSON. Unlike remove-object and upscale, /v1/image/edit expects application/json with image and prompt. Do not send a raw file field on this route.

Can I make results repeatable?

Pass an integer seed. The same image, prompt, and seed produce a stable family of results, which is useful for regression tests in CI.

Is there a free trial?

Yes. 5,000 free credits for 24 hours after signup, no credit card. Free evaluation is capped per tool inside that window so one endpoint cannot burn the whole grant.

What about rate limits?

20 requests/minute on the free trial, 60 on Starter, 120 on Pro and 300 on Scale, plus 3/10/20/50 parallel jobs. See /docs/parallel-processing.html.