Background Removal API Documentation
Get API Key
This API allows developers to remove backgrounds from images programmatically.
Base URL
https://byebg.com/api/v1
Authentication
This API uses Bearer token authentication. Include your API key in the Authorization header of your requests:
Authorization: Bearer YOUR_API_KEY
Required Headers
In addition to the Authorization header, you must include the following header in all API requests:
Accept: application/json
This header ensures that the API returns responses in JSON format.
Endpoints
Remove Background
Remove the background from an uploaded image.
- URL:
/remove-background
- Method: POST
- Content-Type: multipart/form-data
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
image | File | Yes | The image file to process. Must be less than 5MB. |
Response
Success Response (200 OK)
{
"message": "Background removed successfully",
"preview_url": "https://byebg.com/storage/images/preview/abcdef123456.png",
"hd_url": "https://byebg.com/storage/images/hd/abcdef123456.png",
"image_id": 12345
}
Example Usage
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/your/image.jpg" \
https://byebg.com/api/v1/remove-background