# Remove background

`POST /v1/images/remove-background` — Send an image back, get the subject with a transparent background.

- Base URL: https://eroq.ai/v1
- Auth: `Authorization: Bearer eroq_sk_…` (create keys at https://eroq.ai/dashboard/keys)
- Credits: 10 per image

Send `multipart/form-data` with a `file` part (PNG or JPG). No prompt, no parameters — the background-removal workflow does exactly one job: it keeps the subject and returns a PNG with a transparent background.

The cutout is saved to your creation library (`library_id` on the item — manage with /v1/creations). A failed extraction refunds itself; the request holds until the cutout is ready (a few seconds).

## POST /v1/images/remove-background

Send an image back, get the subject with a transparent background.

### Example request

```bash
curl -X POST https://eroq.ai/v1/images/remove-background \
  -H "Authorization: Bearer $EROQ_API_KEY"
```

```javascript
const res = await fetch('https://eroq.ai/v1/images/remove-background', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.EROQ_API_KEY}` },
})
console.log(await res.json())
```

```python
import os, requests

res = requests.post("https://eroq.ai/v1/images/remove-background", headers={"Authorization": f"Bearer {os.environ['EROQ_API_KEY']}"})
print(res.json())
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("POST", "https://eroq.ai/v1/images/remove-background", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EROQ_API_KEY"))

	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```

### Response


```json
{
  "created": 1756118400,
  "model": "eroq-cutout",
  "data": [{ "b64_json": "iVBORw0KGgo…", "content_type": "image/png", "library_id": "…" }],
  "usage": { "credits_spent": 10, "credits_remaining": 977 }
}
```

---
Canonical: https://eroq.ai/docs/images-remove-background · Index for agents: https://eroq.ai/llms.txt · OpenAPI: https://eroq.ai/openapi.json
