> Garmo API docs as Markdown. This page: https://garmo.studio/api/docs/background/ · All docs in one file: https://garmo.studio/api/docs/llms-full.txt

# Change background

POST/edit/background

Keeps the subject exactly and puts it in a new place: a studio color, an interior, a street or a surface, with the light matched.

Cost: 1 credit per scene. Images: Send exactly one photo: image_url, image_base64 or upload_id (or a multipart file named image). It makes one image per scene (plus one for a description or scene photo), at most 12 per request. Give at least one of scenes, description or scene_image_url.

Overview and examples: Background changer API.

## Parameters

- Parameter | Description
- scenes  array | Scene ids from GET /catalog/scenes. One of:  white ,  beige ,  grey ,  sage ,  lobby ,  cafe ,  gallery ,  living ,  paris ,  terrace ,  coast ,  desert ,  lake ,  marble ,  linen ,  wood ,  stone
- description  string | Your own scene in words (up to 300 characters).
- scene_image_url  string | A photo of the place to use as the new background (or scene_image_base64, scene_image_upload_id).
- format  string | Shape of the result; the scene is extended so nothing of the subject is cut off. Default  "same" . One of:  same ,  square ,  portrait ,  story
- image_url  string | Public https URL of the photo to edit. JPEG, PNG or WebP, up to 12 MB. Private and local addresses are refused.
- image_base64  string | The photo itself, base64-encoded (a data: URI is fine). For large files use upload_id instead.
- upload_id  string | An id from POST /uploads.
- webhook_url  string | https address Garmo POSTs the finished job to (signed, see Webhooks).
- metadata  object | Your own JSON object (up to 1,000 characters), returned with the job and in the webhook.
Header Idempotency-Key (optional): see Retries and idempotency.

## Example

```
curl https://api.garmo.studio/v1/edit/background \
  -H "Authorization: Bearer $GARMO_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://shop.example/products/linen-set-12.jpg",
    "scenes": [
      "coast"
    ],
    "description": "a whitewashed Greek island lane with a blue door",
    "format": "same"
  }'
```

```
const r = await fetch("https://api.garmo.studio/v1/edit/background", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GARMO_API_KEY}`,
    "Idempotency-Key": "order-123-background",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"image_url": "https://shop.example/products/linen-set-12.jpg", "scenes": ["coast"], "description": "a whitewashed Greek island lane with a blue door", "format": "same"}),
});
const job = await r.json();
console.log(job.id, job.status);
```

```
import os, requests

r = requests.post(
    "https://api.garmo.studio/v1/edit/background",
    headers={"Authorization": f"Bearer {os.environ['GARMO_API_KEY']}", "Idempotency-Key": "order-123-background"},
    json={
        "image_url": "https://shop.example/products/linen-set-12.jpg",
        "scenes": ["coast"],
        "description": "a whitewashed Greek island lane with a blue door",
        "format": "same",
    },
)
job = r.json()
print(job["id"], job["status"])
```

```
 true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode(["image_url" => "https://shop.example/products/linen-set-12.jpg", "scenes" => ["coast"], "description" => "a whitewashed Greek island lane with a blue door", "format" => "same"]),
    CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("GARMO_API_KEY"), "Idempotency-Key: order-123-background", "Content-Type: application/json"],
]);
$job = json_decode(curl_exec($ch), true);
echo $job["id"], " ", $job["status"];
```

```
require "net/http"
require "json"

uri = URI("https://api.garmo.studio/v1/edit/background")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("GARMO_API_KEY")}"
req["Idempotency-Key"] = "order-123-background"
req["Content-Type"] = "application/json"
req.body =  res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(res.statusCode() + " " + res.body());
    }
}
```

### Response: 202 Accepted

```
{
  "id": "job_8Kq2xV7mPz4LtR9wNc3B",
  "object": "job",
  "tool": "background",
  "status": "processing",
  "livemode": true,
  "outputs": [
    {
      "id": "out_1",
      "status": "processing",
      "label": "Your scene"
    },
    {
      "id": "out_2",
      "status": "processing",
      "label": "Coast at sunset"
    }
  ],
  "credits_charged": 2,
  "credits_refunded": 0,
  "metadata": {
    "sku": "DR-123"
  },
  "created_at": "2026-11-19T14:02:11Z",
  "completed_at": null
}
```

### The finished job

```
{
  "id": "job_8Kq2xV7mPz4LtR9wNc3B",
  "object": "job",
  "tool": "background",
  "status": "completed",
  "livemode": true,
  "outputs": [
    {
      "id": "out_1",
      "status": "succeeded",
      "label": "Your scene",
      "url": "https://….r2.cloudflarestorage.com/renders/2026/11/8f3c…0.webp?X-Amz-Signature=…",
      "url_expires_at": "2026-11-20T14:00:00Z"
    },
    {
      "id": "out_2",
      "status": "succeeded",
      "label": "Coast at sunset",
      "url": "https://….r2.cloudflarestorage.com/renders/2026/11/8f3c…1.webp?X-Amz-Signature=…",
      "url_expires_at": "2026-11-20T14:00:00Z"
    }
  ],
  "credits_charged": 2,
  "credits_refunded": 0,
  "metadata": {
    "sku": "DR-123"
  },
  "created_at": "2026-11-19T14:02:11Z",
  "completed_at": "2026-11-19T14:02:58Z"
}
```

## Errors

400 invalid_request names the parameter that is missing or wrong. Image problems are invalid_image, image_too_large or image_unreachable. 402 insufficient_credits says how many credits the request needs. All codes: Errors.
