API
API
AI Background Remover API
이미지AI Background Remover API로 이미지 배경을 제거하고 투명 배경의 누끼 이미지를 만드세요.
본문
application/jsonmodelstring필수background-removerinput.imagesstring[]필수원본 이미지 URL 목록입니다. 공개적으로 접근 가능한 HTTPS 이미지 URL을 정확히 1개 제공하세요.
프롬프트는 필요하지 않습니다. 예시 URL을 자신의 이미지 URL로 바꾸세요.
최대 URL 수: 1개.
예시: ["https://example.com/source.png"]
요청 예제
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
}
}반환된 작업 ID를 사용해 작업이 완료되거나 실패할 때까지 이 엔드포인트를 폴링하세요. 최신 작업 상태를 확인하려면 5초마다 폴링하는 것을 권장합니다.
POST /api/v1/check{
"task_id": "task_example"
}응답
POST /api/v1/check가 반환하는 작업 상태입니다. 아래 ID, URL, 타임스탬프는 예시입니다.
idstring필수data.id는 작업 식별자로, 조회 요청의 task_id와 같습니다.
statusstring필수failed_reasonstring선택status가 failed일 때만 반환되며 실패 이유를 설명합니다. completed와 processing에는 이 필드가 없습니다.
완료 · completed
다운로드 URL은 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
}
}
}다른 상태
processing 또는 failed에서는 data.data가 null입니다. 아래는 failed 예시이며, failed일 때만 failed_reason이 포함됩니다. processing이면 조회를 계속하고, 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."
}
}크레딧 사용량
한 번의 요청으로 이미지 한 장을 생성할 때 소비되는 크레딧입니다.
| 생성 방식 | 요청당 크레딧 |
|---|---|
| 이미지 한 장 | 10 |
해당 요금을 적용하려면 표에 나열된 input 매개변수를 명시적으로 설정하세요. 여러 이미지를 생성하는 요청은 더 많은 크레딧을 소비할 수 있습니다.
POST /api/v1/create 응답의 credits 필드는 해당 작업에 실제로 차감된 크레딧을 나타냅니다.
