API
API
Nano Banana 2 Lite API
이미지Nano Banana 2 Lite API는 빠르고 효율적인 이미지 생성과 안정적인 캐릭터 일관성, 자연스러운 다중 이미지 블렌딩, 자연어 편집을 제공해 일상적인 크리에이티브 워크플로에 적합합니다. Nano Banana 2 Lite API로 가볍고 고품질의 비주얼 생성을 구현하세요.
본문
application/jsonmodelstring필수nano-banana-2-liteinput.promptstring필수생성할 이미지 또는 참조 이미지에 적용할 변경 사항을 설명하세요. 앞뒤 공백은 제거됩니다.
최대 길이: 5,000자
input.imagesstring[]선택선택적 참조 이미지 URL 목록입니다. 공개적으로 접근 가능한 HTTPS URL만 사용하세요. 텍스트로 이미지를 생성할 때는 생략하세요.
최대 항목 수: 14
input.aspect_ratiostring선택출력의 가로-세로 비율입니다. Auto를 사용하면 모델이 선택합니다.
기본값: auto
요청 예제
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-2-lite",
"input": {
"prompt": "미래형 바나나 모양 카메라를 담은 시네마틱 제품 사진"
}
}'POST /api/v1/create · HTTP 201{
"data": {
"task_id": "task_example",
"model": "nano-banana-2-lite",
"status": "processing",
"credits": 18
}
}반환된 작업 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": "nano-banana-2-lite",
"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-2-lite",
"status": "failed",
"data": null,
"failed_reason": "Generation failed."
}
}크레딧 사용량
한 번의 요청으로 이미지 한 장을 생성할 때 소비되는 크레딧입니다.
| 생성 방식 | 요청당 크레딧 |
|---|---|
| 이미지 한 장 | 18 |
해당 요금을 적용하려면 표에 나열된 input 매개변수를 명시적으로 설정하세요. 여러 이미지를 생성하는 요청은 더 많은 크레딧을 소비할 수 있습니다.
POST /api/v1/create 응답의 credits 필드는 해당 작업에 실제로 차감된 크레딧을 나타냅니다.
