API
API
AI Background Remover API
ImageRemove the background from an image and create a transparent cutout with the AI Background Remover API.
Body
application/jsonmodelstringrequiredbackground-removerinput.imagesstring[]requiredSource image URLs. Provide exactly one publicly accessible HTTPS image URL.
No prompt is required. Replace the example URL with the URL of your own image.
Maximum URLs: 1.
Example: ["https://example.com/source.png"]
Request examples
POST /api/v1/createcurl -X POST https://nanobanana.io/api/v1/create \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "background-remover",
"input": {
"images": [
"https://example.com/source.png"
]
}
}'POST /api/v1/create · HTTP 201{
"data": {
"task_id": "task_example",
"model": "background-remover",
"status": "processing",
"credits": 10
}
}Poll this endpoint using the returned task ID until the task is completed or failed. We recommend polling every 5 seconds to check the latest task status.
POST /api/v1/check{
"task_id": "task_example"
}Response
Task status returned by POST /api/v1/check. The IDs, URLs, and timestamps below are illustrative.
idstringrequiredTask identifier in data.id, matching the task_id used in the check request.
statusstringrequiredfailed_reasonstringoptionalOnly returned when status is failed, to explain the failure. This field is omitted for completed and processing.
Completed · completed
The download URLs are in data.data.results.
POST /api/v1/check · HTTP 200{
"data": {
"id": "task_example",
"created_at": 1791244800,
"model": "background-remover",
"status": "completed",
"data": {
"results": [
"https://example.com/generated.png"
],
"processing_time": 18
}
}
}Other statuses
For processing or failed, data.data is null. This example shows failed: only failed includes failed_reason. Continue polling for processing; stop polling for failed.
POST /api/v1/check · HTTP 200{
"data": {
"id": "task_example",
"created_at": 1791244800,
"model": "background-remover",
"status": "failed",
"data": null,
"failed_reason": "Generation failed."
}
}Credit usage
Credits consumed for a request generating one image.
| Generation | Credits per request |
|---|---|
| Single image | 10 |
Set the listed input parameters explicitly to use the corresponding rate. Requests generating multiple images may consume more credits.
The credits field returned by POST /api/v1/create shows the amount charged for the task.
