API
API
Nano Banana API
이미지본문
application/jsonmodelstring필수nano-bananainput.promptstring필수input.imagesstring[]선택input.aspect_ratiostring선택기본값: auto
auto1:12:33:23:44:34:55:49:1616:921:91:44:11:88:1
요청 예제
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": "nano-banana",
"input": {
"prompt": "미래형 바나나 모양 카메라를 담은 시네마틱 제품 사진"
}
}'POST /api/v1/create · HTTP 201{
"data": {
"task_id": "task_example",
"model": "nano-banana",
"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필수completed는 생성 성공을 나타내며 data.data에 결과가 포함됩니다. 다른 상태에서는 data.data가 null입니다.
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": "nano-banana",
"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": "nano-banana",
"status": "failed",
"data": null,
"failed_reason": "Generation failed."
}
}크레딧 사용량
한 번의 요청으로 이미지 한 장을 생성할 때 소비되는 크레딧입니다.
| 생성 방식 | 요청당 크레딧 |
|---|---|
| 이미지 한 장 | 10 |
해당 요금을 적용하려면 표에 나열된 input 매개변수를 명시적으로 설정하세요. 여러 이미지를 생성하는 요청은 더 많은 크레딧을 소비할 수 있습니다.
POST /api/v1/create 응답의 credits 필드는 해당 작업에 실제로 차감된 크레딧을 나타냅니다.
