Skip to content

Image Edit

Get API Key

The Image Edit API applies AI-powered edits to one or multiple reference images that you host. Provide the edit prompt, the target model, and optional aspect-ratio hints to steer the results.

API Overview

  • Request URL: https://www.cutout.pro/api/v1/image/edit
  • Method: POST
  • Content-Type: application/json
  • Headers:
    • APIKEY: Your API key from the user center

Sample Code

bash
curl --location --request POST 'https://www.cutout.pro/api/v1/image/edit' \
  --header 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "prompt": "Describe the edit you want",
    "model": "model-name",
    "aspectRatios": "16:9",
    "imageUrl": [
      "https://example.com/source.jpg"
    ]
  }'
python
import requests

payload = {
    "prompt": "Describe the edit you want",
    "model": "model-name",
    "aspectRatios": "16:9",
    "imageUrl": [
        "https://example.com/source.jpg"
    ]
}

response = requests.post(
    "https://www.cutout.pro/api/v1/image/edit",
    json=payload,
    headers={
        "APIKEY": "INSERT_YOUR_API_KEY_HERE",
        "Content-Type": "application/json"
    }
)
response.raise_for_status()
print(response.json())
php
$client = new GuzzleHttp\Client();

$response = $client->post('https://www.cutout.pro/api/v1/image/edit', [
    'headers' => [
        'APIKEY' => 'INSERT_YOUR_API_KEY_HERE',
        'Content-Type' => 'application/json'
    ],
    'json' => [
        'prompt' => 'Describe the edit you want',
        'model' => 'model-name',
        'aspectRatios' => '16:9',
        'imageUrl' => [
            'https://example.com/source.jpg'
        ]
    ]
]);

echo $response->getBody();
java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

var client = HttpClient.newHttpClient();
var body = """
{
  "prompt": "Describe the edit you want",
  "model": "model-name",
  "aspectRatios": "16:9",
  "imageUrl": [
    "https://example.com/source.jpg"
  ]
}
""";

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://www.cutout.pro/api/v1/image/edit"))
    .header("APIKEY", "INSERT_YOUR_API_KEY_HERE")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
nodejs
const payload = {
  prompt: "Describe the edit you want",
  model: "model-name",
  aspectRatios: "16:9",
  imageUrl: [
    "https://example.com/source.jpg"
  ]
};

async function makeRequest() {
  try {
    const response = await fetch("https://www.cutout.pro/api/v1/image/edit", {
      method: "POST",
      headers: {
        APIKEY: "INSERT_YOUR_API_KEY_HERE",
        "Content-Type": "application/json"
      },
      body: JSON.stringify(payload)
    });

    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error('Error:', error);
  }
}

makeRequest();
.net
using var client = new HttpClient();

var requestBody = new
{
    prompt = "Describe the edit you want",
    model = "model-name",
    aspectRatios = "16:9",
    imageUrl = new[] { "https://example.com/source.jpg" }
};

var request = new HttpRequestMessage(
    HttpMethod.Post,
    "https://www.cutout.pro/api/v1/image/edit")
{
    Content = new StringContent(
        System.Text.Json.JsonSerializer.Serialize(requestBody),
        System.Text.Encoding.UTF8,
        "application/json")
};

request.Headers.Add("APIKEY", "INSERT_YOUR_API_KEY_HERE");

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
Console.WriteLine(json);
objective-c
NSDictionary *payload = @{
    @"prompt": @"Describe the edit you want",
    @"model": @"model-name",
    @"aspectRatios": @"16:9",
    @"imageUrl": @[@"https://example.com/source.jpg"]
};

NSError *error = nil;
NSData *body = [NSJSONSerialization dataWithJSONObject:payload options:0 error:&error];
if (error) { return; }

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.cutout.pro/api/v1/image/edit"]];
request.HTTPMethod = @"POST";
request.HTTPBody = body;
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"INSERT_YOUR_API_KEY_HERE" forHTTPHeaderField:@"APIKEY"];

NSURLSessionDataTask *task = [[NSURLSession sharedSession]
    dataTaskWithRequest:request
    completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
        if (error) { return; }
        NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
        NSLog(@"%@", json);
}];
[task resume];

Request Parameters

Headers

ParameterTypeRequiredDescription
APIKEYstringYesYour Cutout.Pro API key

JSON Body

FieldTypeRequiredDescription
promptstringYesNatural language description of the desired edit
modelstringYesImage-editing model identifier to use
aspectRatiosstringYesPreferred aspect ratio hint such as 1:1, 4:3, 16:9, etc.
imageUrlarray<string>YesList the HTTPS URLs for the source images to be edited. The images must be in JPEG or PNG format and accessible via HTTPS

Model-specific Requirements

ModelpricePerCall (credits)Max imageUrl refsAllowed aspectRatiosAdditional constraints
gpt-image-14≤ 6 imagesoriginal, 1:1, 4:3, 3:4, 9:16, 16:9None
gemini-2.5-flash-image4≤ 6 imagesoriginal, 1:1, 4:3, 3:4, 9:16, 16:9None
gemini-3-pro-image-preview15≤ 6 imagesoriginal, 1:1, 4:3, 3:4, 9:16, 16:9None
seedream-4.04≤ 6 imagesoriginal, 1:1, 4:3, 3:4, 9:16, 16:9size ≤ 10 MB; pixels ≥ 921,600; max 6000×6000 px; width and height > 14 px; aspect ratio between 1/3 and 3.
qwen-image-edit-plus4≤ 3 imagesoriginal, 1:1, 4:3, 3:4, 9:16, 16:9None

Response

json
{
  "code": 0,
  "data": {
    "id": 789012345678901,
    "userId": 657890123456789,
    "imageUrl": "https://cdn.cutout.pro/edits/{result}.jpg",
    "prompt": "Remove the background",
    "model": "qwen-image-edit-plus",
    "aspectRatios": "original",
    "referenceImageUrl": [
      "https://cdn.cutout.pro/upload/{source-1}.jpg"
    ],
    "status": 1,
    "failReason": null,
    "deleted": 0,
    "duration": "11.43",
    "createdAt": 1763547221159
  },
  "msg": "",
  "time": 1763547234171,
  "requestId": "691d9854b3289731e75d37936de5be50"
}
FieldDescription
codeStandard API status code (0 = success).
idUnique identifier of the edit task.
userIdAccount that initiated the job.
imageUrlFinal edited image URL returned by the service.
promptPrompt text used for the edit.
modelModel name that processed the request.
aspectRatiosThe ratio that was applied to the output.
referenceImageUrlArray of reference image URLs provided in the request.
status1 indicates the edit finished successfully, 0 indicates failure.
failReasonError message when status = 0; null when successful.
deletedSoft-delete flag for internal lifecycle management.
durationTime spent generating the result, in seconds.
createdAtTask creation timestamp (milliseconds since epoch).
msgOptional message for the overall API call.
timeTimestamp when the response was generated.
requestIdTrace identifier for debugging and support.

Error Handling

On failure the service returns JSON with an error code and message:

json
{
  "code": 1001,
  "data": null,
  "msg": "Insufficient balance",
  "time": 1716273912000
}

Refer to docs/error-code.md for the full list of error codes.