# Car Background Removal (Base64)

Remove background from a car photo; return Base64 RGBA PNG in JSON.

**Cost:** 1 credit on HTTP 200.

Accepts reserved JSON fields `include_shadow` and `translucent_windows` (currently ignored). Binary sibling: `/v1.0/car-image-without-background`.

---

## Endpoint

**POST** `/v1.0/car-image-without-background-base64`

Base URL: `https://api.withoutbg.com`

## Authentication

Provide your API key in the request header:

```
X-API-Key: <your_api_key>
```

## Request

**Content-Type:** `application/json`

### Fields

- `image_base64` *(string, required)* — Input image as a raw Base64 string (no `data:` URI prefix). Supported formats: JPEG, PNG, WebP, AVIF, HEIC, TIFF, BMP, GIF. Maximum decoded size: 20.0 MB.
- `include_shadow` *(boolean, optional)* — When true, keep/generate a soft shadow under the car. Reserved for an upcoming model feature; currently ignored.
- `translucent_windows` *(boolean, optional)* — When true, treat car windows as translucent rather than opaque. Reserved for an upcoming model feature; currently ignored.

## Response

**Success Content-Type:** `application/json`

### Body fields

- `input_dimensions` *(array<integer>, required)* — Decoded input size as `[width, height]` (pixels).
- `processed_dimensions` *(array<integer>, required)* — Size after server prep downscale (longest-side / megapixel caps) as `[width, height]`. Distinct from model inference resolution (~1024 long side).
- `was_downscaled` *(boolean, required)* — True when the input was downscaled during server prep.
- `image_type` *(object, optional)* — Optional probabilities for photo vs graphic image-type classes.
- `img_without_background_base64` *(string, required)* — Result image as Base64 PNG (RGBA) with transparent background. Prepend `data:image/png;base64,` to display in a browser.

## Errors

| Status | Description |
|--------|-------------|
| 401 | Invalid API Key |
| 402 | Insufficient credit. Please top up API credits. |
| 403 | Credits Expired. Please top up API credits. If you have existing credits, they will be reactivated. |
| 422 | Validation Error |
| 429 | {"error":"Too Many Requests","status":429,"message":"Rate limit exceeded. Please try again later"} |
| 500 | Internal Server Error. Please contact support: contact@withoutbg.com |

## Example (cURL)

```bash
curl -X POST \
  -H "X-API-Key: $WITHOUTBG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_base64":"<raw_base64>"}' \
  "https://api.withoutbg.com/v1.0/car-image-without-background-base64"
```

---

Source of truth: [OpenAPI](https://api.withoutbg.com/openapi.json) · Docs: [/docs/pro-model/car-background-removal-base64](/docs/pro-model/car-background-removal-base64)
