Kolbo.AIKolbo.AI Docs
Developer API

Image Editing

Edit and transform images using AI models via the Kolbo API.

Edit images using AI — remove backgrounds, change colors, apply style transfers, and more. Provide source images as URLs along with a text prompt describing the desired edit.

Recommended: Omit the model field to use Smart Select, which automatically picks the best editing model for your prompt. To use a specific model instead, fetch available identifiers from GET /api/v1/models?type=image_edit first — model identifiers are Kolbo-specific and may change over time, so always fetch them dynamically rather than hardcoding.

Endpoint

POST /api/v1/generate/image-edit

Request Body

FieldTypeRequiredDescription
promptstringYesDescription of the edit to apply
modelstringNoModel identifier from GET /api/v1/models?type=image_edit. Omit to let Smart Select choose the best model automatically (recommended).
source_imagesarrayNoURLs of images to edit. Omit for text-only generation with editing models.
aspect_ratiostringNo"1:1", "16:9", "9:16", etc. (default: "1:1")
num_imagesnumberNoNumber of output images (default: 1)
enhance_promptbooleanNoEnhance prompt for better results (default: true)
visual_dna_idsarrayNoVisual DNA IDs for style consistency (max 3)
moodboard_idstringNoMoodboard ID to apply a style template to the edit.

Examples

Basic Edit (Smart Select)

curl -X POST https://api.kolbo.ai/api/v1/generate/image-edit \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Remove the background and place on a clean white surface",
    "source_images": ["https://example.com/product-photo.jpg"]
  }'

With a Specific Model

To choose a specific model, first fetch identifiers from GET /api/v1/models?type=image_edit, then pass the identifier value (e.g., nano-banana-2-image-editing, nano-banana-pro/edit):

curl -X POST https://api.kolbo.ai/api/v1/generate/image-edit \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Transform into a watercolor painting style",
    "source_images": ["https://example.com/photo.jpg"],
    "model": "nano-banana-2-image-editing",
    "enhance_prompt": false
  }'

JavaScript

const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://api.kolbo.ai";

async function editImage() {
  const response = await fetch(`${BASE_URL}/api/v1/generate/image-edit`, {
    method: "POST",
    headers: {
      "X-API-Key": API_KEY,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      prompt: "Change the car color to red",
      source_images: ["https://example.com/car.jpg"],
      aspect_ratio: "16:9"
    })
  });

  const data = await response.json();
  const pollUrl = data.poll_url;

  let result;
  do {
    await new Promise((r) => setTimeout(r, 3000));
    const statusRes = await fetch(`${BASE_URL}${pollUrl}`, {
      headers: { "X-API-Key": API_KEY }
    });
    result = await statusRes.json();
  } while (result.state === "processing");

  console.log("Edited image URLs:", result.result.urls);
}

editImage();

Python

import requests
import time

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.kolbo.ai"

# Start edit (Smart Select picks the best model automatically)
response = requests.post(
    f"{BASE_URL}/api/v1/generate/image-edit",
    headers={"X-API-Key": API_KEY},
    json={
        "prompt": "Remove background and add soft shadow",
        "source_images": ["https://example.com/product.jpg"]
    }
)
data = response.json()
poll_url = data["poll_url"]

# Poll for result
while True:
    time.sleep(3)
    status = requests.get(
        f"{BASE_URL}{poll_url}",
        headers={"X-API-Key": API_KEY}
    ).json()
    if status["state"] != "processing":
        break

print("URLs:", status["result"]["urls"])

Response

Generation Started

{
  "success": true,
  "generation_id": "edit123",
  "type": "image_edit",
  "model": "auto",
  "credits_charged": 3,
  "poll_url": "/api/v1/generate/edit123/status",
  "poll_interval_hint": 3
}

Completed Status

{
  "success": true,
  "generation_id": "edit123",
  "type": "image_edit",
  "state": "completed",
  "progress": 100,
  "result": {
    "urls": ["https://cdn.kolbo.ai/images/edited-result.png"],
    "model": "auto",
    "prompt_used": "Enhanced version of your prompt",
    "created_at": "2026-03-05T10:30:00Z"
  }
}

Finding Models

Model identifiers are Kolbo-specific -- always fetch them dynamically rather than hardcoding. Use the Models endpoint to discover available image editing models:

curl "https://api.kolbo.ai/api/v1/models?type=image_edit" \
  -H "X-API-Key: YOUR_API_KEY"

Tips

  • Smart Select is recommended — omit model and the API picks the best editing model for your prompt.
  • source_images accepts URLs — no file uploads needed. The API downloads and processes them.
  • You can omit source_images to use editing models for text-only generation with editing-specific styles.
  • Combine with Visual DNA for consistent style across multiple edits.
  • Use moodboard_id to layer a style preset on top of any edit. See Moodboards.
  • Image editing typically takes 5-15 seconds depending on the model.