curl --request POST \
--url https://api.bitstudio.ai/images/{id}/inpaint \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mask_image_id": "33333333-3333-4333-8333-333333333333",
"prompt": "Continue the plain studio wall.",
"model": "v1",
"resolution": "standard",
"num_images": 1,
"denoise": 0.75
}
'import requests
url = "https://api.bitstudio.ai/images/{id}/inpaint"
payload = {
"mask_image_id": "33333333-3333-4333-8333-333333333333",
"prompt": "Continue the plain studio wall.",
"model": "v1",
"resolution": "standard",
"num_images": 1,
"denoise": 0.75
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mask_image_id: '33333333-3333-4333-8333-333333333333',
prompt: 'Continue the plain studio wall.',
model: 'v1',
resolution: 'standard',
num_images: 1,
denoise: 0.75
})
};
fetch('https://api.bitstudio.ai/images/{id}/inpaint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bitstudio.ai/images/{id}/inpaint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mask_image_id' => '33333333-3333-4333-8333-333333333333',
'prompt' => 'Continue the plain studio wall.',
'model' => 'v1',
'resolution' => 'standard',
'num_images' => 1,
'denoise' => 0.75
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bitstudio.ai/images/{id}/inpaint"
payload := strings.NewReader("{\n \"mask_image_id\": \"33333333-3333-4333-8333-333333333333\",\n \"prompt\": \"Continue the plain studio wall.\",\n \"model\": \"v1\",\n \"resolution\": \"standard\",\n \"num_images\": 1,\n \"denoise\": 0.75\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bitstudio.ai/images/{id}/inpaint")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mask_image_id\": \"33333333-3333-4333-8333-333333333333\",\n \"prompt\": \"Continue the plain studio wall.\",\n \"model\": \"v1\",\n \"resolution\": \"standard\",\n \"num_images\": 1,\n \"denoise\": 0.75\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bitstudio.ai/images/{id}/inpaint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mask_image_id\": \"33333333-3333-4333-8333-333333333333\",\n \"prompt\": \"Continue the plain studio wall.\",\n \"model\": \"v1\",\n \"resolution\": \"standard\",\n \"num_images\": 1,\n \"denoise\": 0.75\n}"
response = http.request(request)
puts response.read_body{
"id": "11111111-1111-4111-8111-111111111111",
"status": "completed",
"path": "https://media.bitstudio.ai/public/homepage/2026-09/bitstudio-shirt-reference-front-v1-77caf2ea41d661e4.webp",
"width_px": 900,
"height_px": 1125,
"is_generated": false,
"created_timestamp": "2026-09-06T12:00:00Z",
"versions": [
{
"id": "22222222-2222-4222-8222-222222222222",
"image_id": "11111111-1111-4111-8111-111111111111",
"source_image_id": "33333333-3333-4333-8333-333333333333",
"version_type": "edited",
"status": "pending",
"path": ""
}
]
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"cta": true,
"next_action": "<string>",
"current_plan": "<string>",
"user_message": "<string>",
"extra_context": "<string>"
}Edit a masked region (existing API)
Existing endpoint. Returns the parent image with a new version. The original may already be completed. Track the new version id and poll its source_image_id for the operation’s result.
curl --request POST \
--url https://api.bitstudio.ai/images/{id}/inpaint \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mask_image_id": "33333333-3333-4333-8333-333333333333",
"prompt": "Continue the plain studio wall.",
"model": "v1",
"resolution": "standard",
"num_images": 1,
"denoise": 0.75
}
'import requests
url = "https://api.bitstudio.ai/images/{id}/inpaint"
payload = {
"mask_image_id": "33333333-3333-4333-8333-333333333333",
"prompt": "Continue the plain studio wall.",
"model": "v1",
"resolution": "standard",
"num_images": 1,
"denoise": 0.75
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mask_image_id: '33333333-3333-4333-8333-333333333333',
prompt: 'Continue the plain studio wall.',
model: 'v1',
resolution: 'standard',
num_images: 1,
denoise: 0.75
})
};
fetch('https://api.bitstudio.ai/images/{id}/inpaint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bitstudio.ai/images/{id}/inpaint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mask_image_id' => '33333333-3333-4333-8333-333333333333',
'prompt' => 'Continue the plain studio wall.',
'model' => 'v1',
'resolution' => 'standard',
'num_images' => 1,
'denoise' => 0.75
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bitstudio.ai/images/{id}/inpaint"
payload := strings.NewReader("{\n \"mask_image_id\": \"33333333-3333-4333-8333-333333333333\",\n \"prompt\": \"Continue the plain studio wall.\",\n \"model\": \"v1\",\n \"resolution\": \"standard\",\n \"num_images\": 1,\n \"denoise\": 0.75\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bitstudio.ai/images/{id}/inpaint")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mask_image_id\": \"33333333-3333-4333-8333-333333333333\",\n \"prompt\": \"Continue the plain studio wall.\",\n \"model\": \"v1\",\n \"resolution\": \"standard\",\n \"num_images\": 1,\n \"denoise\": 0.75\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bitstudio.ai/images/{id}/inpaint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mask_image_id\": \"33333333-3333-4333-8333-333333333333\",\n \"prompt\": \"Continue the plain studio wall.\",\n \"model\": \"v1\",\n \"resolution\": \"standard\",\n \"num_images\": 1,\n \"denoise\": 0.75\n}"
response = http.request(request)
puts response.read_body{
"id": "11111111-1111-4111-8111-111111111111",
"status": "completed",
"path": "https://media.bitstudio.ai/public/homepage/2026-09/bitstudio-shirt-reference-front-v1-77caf2ea41d661e4.webp",
"width_px": 900,
"height_px": 1125,
"is_generated": false,
"created_timestamp": "2026-09-06T12:00:00Z",
"versions": [
{
"id": "22222222-2222-4222-8222-222222222222",
"image_id": "11111111-1111-4111-8111-111111111111",
"source_image_id": "33333333-3333-4333-8333-333333333333",
"version_type": "edited",
"status": "pending",
"path": ""
}
]
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"cta": true,
"next_action": "<string>",
"current_plan": "<string>",
"user_message": "<string>",
"extra_context": "<string>"
}Authorizations
Create an API key in Studio → account menu → API Keys. Keep it on your server.
Path Parameters
Image or asset ID from a previous response. Resource ID.
Body
Uploaded black-and-white PNG mask: white marks the region to change; black preserves the surrounding area. Must match the selected source dimensions.
Output quality. Send explicitly. Pixel dimensions depend on the image model.
standard, high "standard"
Strength of the change. Send explicitly.
0.05 <= x <= 10.75
Optional selection from an existing Studio image history. When chaining completed API results, use result.id from the v1 job response as the source image and omit this field.
What should appear in the masked area.
Number of outputs. Defaults to 1. Account limits still apply.
1 <= x <= 11
Inpaint currently supports v1.
v1 Optional reference, mutually exclusive with reference_asset_id.
Optional reusable reference, mutually exclusive with reference_image_id.
Additional reusable reference asset IDs. Supported types depend on the operation.
Optional style directions.
Optional seed; it does not guarantee identical results.
Optional processing speed; accepted values depend on the operation and model.
Processing task override. Omit for a standard inpaint operation.
Response
Returns the parent image with a new version. The original may already be completed. Track the new version id and poll its source_image_id for the operation’s result.
Resource ID.
Job state. Only completed has a finished result.
pending, generating, completed, failed, policy_blocked, nsfw_filtered Result URL. Can be null while the job is pending.
Whether the upload is a reusable asset reference.
Operation that created this job.
Human-readable failure detail.
Machine-readable failure category, when available.
input_rejected, provider_unavailable, queue_timeout, policy_blocked Linked reusable assets.
Resource ID.
Related versions. May be omitted or empty. Never infer a new version is completed from the parent status.
Show child attributes
Show child attributes