Public REST API for automotive background replacement — upload car photos, get back studio-quality images.
The AutoBackgrounding API v1 lets you replace car photo backgrounds programmatically. All endpoints are served from a single base URL and run on our purpose-built automotive pipeline.
https://app.autobackgrounding.comAllowed quality
1K2K4K
Allowed aspect ratios
1:116:99:164:33:22:3
All input image and background URLs must live on our storage (from /api/v1/presigned-urls or /api/v1/generate-background) — external URLs are rejected.
Every request needs an API key, sent either way. Create keys from the API dashboard.
Authorization: Bearer <API_KEY>
# or
x-api-key: <API_KEY>Missing, invalid, or revoked key → 401
{ "error": "Invalid or missing API key" }1K / 2K output = 1 credit per image, 4K = 2 credits402GET /api/v1/credit-usage{ "error": "Not enough credits", "required": 2, "remaining": 1 }/api/v1/presigned-urlsGet signed upload URLs for your input images. Free — no credits.
| Field | Required | Default | Notes |
|---|---|---|---|
count | optional | 1 | number of URLs, 1–20 (query parameter) |
{
"bucket": "api-images",
"uploads": [
{
"path": "uploads/<keyId>/<uuid>",
"token": "...",
"presignedUrl": "https://....supabase.co/storage/...",
"publicUrl": "https://....supabase.co/storage/..."
}
]
}Then upload each file with PUT <presignedUrl> and the raw image bytes as the body (Content-Type: image/jpeg or image/png). Use the matching publicUrl in the endpoints below.
/api/v1/generate-backgroundCreate one background scene (no car). Synchronous — the image is generated during the request (~10–60s). Costs credits by quality.
| Field | Required | Default | Notes |
|---|---|---|---|
prompt | optional | clean white studio | text description of the scene |
referenceImageUrl | optional | — | scene to reproduce; our storage only |
quality | optional | 2K | |
aspectRatio | optional | 16:9 | |
save | optional | false | also save as a reusable background |
name | optional | "Generated background" | only with save: true |
isDefault | optional | false | only with save: true; make it the key's default background |
{
"id": "uuid",
"status": "completed",
"backgroundUrl": "https://....jpeg",
"creditsCharged": 1,
"savedBackgroundId": "uuid-or-null"
}savedBackgroundId only appears when save: true. Generation failure → 502 (credits refunded automatically).
/api/v1/bulkSubmit up to 20 car photos for background replacement. Asynchronous — returns a batchId immediately; poll for results below.
| Field | Required | Default | Notes |
|---|---|---|---|
images[] | required | — | a list of 1–20 items, each needs url (our storage) |
images[].quality / aspectRatio | optional | job-level values | per-image override |
images[].backgroundId / backgroundUrl | optional | job-level background | per-image override; explicit null = no background for this image |
prompt | optional | see below | |
shotType | optional | exterior | exterior | interior | specific-part — how the photos are treated (see below) |
quality | optional | 1K | |
aspectRatio | optional | 1:1 | |
backgroundUrl | optional | — | exact backdrop for the batch; not together with backgroundId |
backgroundId | optional | — | a saved background's id; explicit null opts out of the key's default |
{
"prompt": "luxury garage interior with ambient lighting",
"shotType": "exterior",
"quality": "1K",
"aspectRatio": "16:9",
"images": [
{ "url": "https://..." },
{ "url": "https://...", "quality": "2K", "aspectRatio": "1:1" },
{ "url": "https://...", "backgroundId": "uuid" },
{ "url": "https://...", "backgroundUrl": null }
]
}{ "batchId": "uuid", "totalImages": 4, "creditsCharged": 5, "status": "processing" }shotType controls how each photo is treated: exterior (default) places the car into the new scene, interior keeps the cabin unchanged and replaces only the view through the windows, specific-part is for close-up shots of a specific part of the car (grille, headlight, wheel) — the crop is kept as framed and only the background behind the part is replaced. Applies to the whole batch.
Background resolution order (job level): backgroundUrl → backgroundId → the key's default saved background → none (prompt-only). Default prompts: with a background, "According to the background image"; without, "clean white studio background, soft even lighting".
/api/v1/bulk/:batchId{
"batch": {
"id": "uuid",
"status": "pending | processing | completed",
"total_count": 4,
"completed_count": 3,
"error_count": 1,
"progress": 100,
"credits_charged": 5,
"created_at": "...",
"finished_at": "..."
},
"images": [
{
"id": "uuid",
"original_url": "https://...",
"processed_url": "https://...-or-null",
"status": "pending | processing | completed | error",
"credit_cost": 1,
"error_message": null,
"processed_at": "..."
}
]
}images[].processed_url is the final result per image. Poll every few seconds until batch.status is completed.
/api/v1/bulk?limit=20&offset=0List this key's batches, newest first. Returns { batches: [...], total, limit, offset }.
Save a background once, reuse it across bulk jobs by backgroundId — no re-upload per job. Max 50 saved backgrounds per key. At most one can be the default: it is used automatically by bulk jobs that specify no background.
/api/v1/backgrounds/api/v1/backgrounds/api/v1/backgrounds/:id/api/v1/backgrounds/:id{ "url": "https://... (our storage)", "name": "My showroom", "isDefault": false }PATCH accepts { "name": "..." } and/or { "isDefault": true } — setting a new default automatically clears the previous one. DELETE removes the saved reference only — past results and in-flight jobs keep working.
/api/v1/credit-usage{
"planCredits": 5000,
"planCreditsUsed": 137,
"addonCredits": 500,
"addonCreditsUsed": 0,
"availableCredits": 5363
}KEY="your-api-key"
BASE="https://app.autobackgrounding.com"
# 1. get an upload URL
curl -s "$BASE/api/v1/presigned-urls?count=1" -H "Authorization: Bearer $KEY"
# 2. upload the car photo
curl -s -X PUT "<presignedUrl>" -H "Content-Type: image/jpeg" --data-binary @car.jpg
# 3. submit a bulk job
curl -s -X POST "$BASE/api/v1/bulk" \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{
"prompt": "modern dealership showroom, warm lighting",
"quality": "2K",
"aspectRatio": "16:9",
"images": [{ "url": "<publicUrl>" }]
}'
# 4. poll until completed
curl -s "$BASE/api/v1/bulk/<batchId>" -H "Authorization: Bearer $KEY"| Status | Meaning |
|---|---|
| 400 | Validation failed — message lists the allowed values |
| 401 | Invalid or missing API key |
| 402 | Not enough credits (required / remaining included) |
| 404 | Resource not found (batch / background not owned by this key) |
| 500 | Internal server error |
| 502 | Generation failed (generate-background) — credits refunded |