Nano Banana Images API 연동 안내
이 문서는 Nano Banana Images API의 연동 및 사용 방법을 소개합니다. 이 API는 **이미지 생성(generate)**과 **이미지 편집(edit)**이라는 두 가지 기능을 지원합니다.
¶ 신청 절차
Nano Banana Images API를 사용하려면 먼저 Ace Data Cloud 콘솔에서 API Token을 발급받아 준비해 두세요.

아직 로그인하거나 가입하지 않았다면 자동으로 로그인 페이지로 이동하여 가입 및 로그인을 안내하며, 완료 후 자동으로 현재 페이지로 돌아옵니다.
일반 애플리케이션의 API Key는 계정에 활성화된 서비스에 사용할 수 있으며, 전용 애플리케이션의 Key는 해당 애플리케이션의 서비스 범위에 따라 사용합니다. Key의 권한, 유효 기간 및 한도를 확인하고, 애플리케이션 잔액이 이번 요청의 비용을 지불하기에 충분한지 확인하세요. 사용 가능한 체험 크레딧은 계정에 표시된 내용을 기준으로 하며, 잔액이 부족할 때는 「충전」 버튼을 클릭하면 됩니다.
📘 전체 문서: Nano Banana Images API →
¶ API 개요
- 기본 URL:
https://api.acedata.cloud - 엔드포인트:
POST /nano-banana/images - 인증 방식: HTTP 헤더에
authorization: Bearer {token}포함 - 요청 헤더:
accept: application/jsoncontent-type: application/json
- 동작(action):
generate: 텍스트 프롬프트에 따라 이미지 생성edit: 제공된 이미지를 기반으로 편집
- 모델(model)(선택 사항):
nano-banana(기본값): Gemini 2.5 Flash Image 기반, 빠른 속도와 낮은 비용nano-banana-2-lite: Gemini 3.1 Flash Lite Image 기반, 1K만 지원하며 생성 속도가 빠름nano-banana-2: Gemini 3.1 Flash Image Preview 기반, Pro급 품질 + Flash 속도nano-banana-2.1: 차세대 고효율 이미지 모델로, 1K, 2K, 4K 이미지 생성 및 편집 지원nano-banana-pro: Gemini 3 Pro Image Preview 기반, 최고 품질nano-banana:official,nano-banana-2-lite:official,nano-banana-2:official,nano-banana-pro:official: 각 모델의 공식 채널 버전으로, 이미지 품질과 안정성이 더 우수하며 요금이 다름
- 비동기 콜백: 선택 사항,
callback_url을 통해 작업 완료 알림 및 결과 수신 - 이미지 수: 선택 사항,
count로 1–4장 지정 가능, 기본값은 1장. 각 이미지는 독립적인 생성 호출로 완성되며, 일반적인 기술적 실패 또는 제공자의 안전 정책에 따른 거부는 해당 호출에만 영향을 미칩니다. 나머지 성공한 이미지는 정상적으로 반환되며 실제 성공한 이미지 수에 따라 요금이 부과됩니다. - Nano Banana 2 이미지당 요금:
nano-banana-2의4K는 0.33 Credits/장,1K와2K는 0.28 Credits/장입니다. 성공적으로 반환된 이미지 수를 기준으로 합니다.
¶ 빠른 시작: 이미지 생성(action=generate)
최소 필수 매개변수: action, prompt
프롬프트에 따라 이미지를 바로 생성하려면 action을 generate로 설정하고 명확한 prompt를 제공하면 됩니다.
¶ 요청 예시(cURL)
curl -X POST 'https://api.acedata.cloud/nano-banana/images' \
-H 'authorization: Bearer {token}' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
"action": "generate",
"model": "nano-banana-pro",
"prompt": "A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful. Vertical portrait orientation.",
"count": 1
}'
¶ 요청 예시(Python)
import requests
url = "https://api.acedata.cloud/nano-banana/images"
headers = {
"authorization": "Bearer {token}",
"accept": "application/json",
"content-type": "application/json",
}
payload = {
"action": "generate",
"model": "nano-banana-pro",
"prompt": (
"A photorealistic close-up portrait of an elderly Japanese ceramicist "
"with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully "
"inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched "
"workshop. The scene is illuminated by soft, golden hour light streaming through "
"a window, highlighting the fine texture of the clay. Captured with an 85mm "
"portrait lens, resulting in a soft, blurred background (bokeh). The overall mood "
"is serene and masterful. Vertical portrait orientation."
),
"count": 1
}
resp = requests.post(url, json=payload, headers=headers)
print(resp.json())
¶ 성공 응답 예시
{
"success": true,
"task_id": "70e6931b-6e34-43db-9e36-8765e2809d04",
"trace_id": "60df8d38-f265-4986-aec7-75c9220bced2",
"data": [
{
"prompt": "A photorealistic close-up portrait of an elderly Japanese ceramicist with deep, sun-etched wrinkles and a warm, knowing smile. He is carefully inspecting a freshly glazed tea bowl. The setting is his rustic, sun-drenched workshop. The scene is illuminated by soft, golden hour light streaming through a window, highlighting the fine texture of the clay. Captured with an 85mm portrait lens, resulting in a soft, blurred background (bokeh). The overall mood is serene and masterful. Vertical portrait orientation.",
"image_url": "https://cdn.acedata.cloud/assets/examples/nanobanana/1d0160b4-93f9-4229-8926-ea9ef0bed336-34b3dc2195e8.png"
}
]
}
¶ 필드 설명
success: 이번 요청의 성공 여부.task_id: 작업 ID.trace_id: 문제 해결을 위한 추적 ID.count: 생성 또는 편집을 요청하는 이미지 수로, 1–4를 지원하며 기본값은 1입니다.data에는 생성에 성공한 이미지만 포함되며, 실제 반환된 이미지 수에 따라 요금이 부과됩니다. 각 생성 호출에는 제공자의 기본 안전 정책이 강제로 적용됩니다. 특정 호출이 거부되어도 성공한 다른 호출에는 영향을 미치지 않으며, 모든 호출이 거부되면 403이 반환됩니다.data[]: 결과 목록.prompt: 생성에 사용된 프롬프트(입력값 그대로 반환).image_url: 생성된 이미지의 직접 링크 URL.
참고:
/nano-banana/images는action과prompt만으로 이미지를 생성할 수 있습니다.
¶ 이미지 편집(action=edit)
기존 이미지를 기반으로 편집하려면 action을 edit로 설정하고, image_urls를 통해 편집할 이미지 링크 목록(1장 이상)을 전달하는 동시에 편집 목표를 설명하는 prompt를 제공하세요.
예를 들어 여기서 인물 사진 한 장과 옷 사진 한 장을 제공하고 인물에게 이 옷을 입히려면, 이미지 링크를 함께 전달하고 action을 edit로 지정할 수 있습니다. URL은 https 또는 http 프로토콜을 사용하는 공개적으로 접근 가능한 HTTP URL일 수도 있고, data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAVGCAMAAAA6u2FyAAADAFBMVEXq6uwdHCEeHyMdHS....와 같은 Base64로 인코딩된 이미지일 수도 있습니다.
¶ 요청 예시(cURL)
curl -X POST 'https://api.acedata.cloud/nano-banana/images' \
-H 'authorization: Bearer {token}' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
"action": "edit",
"prompt": "let this man wear on this T-shirt",
"image_urls": [
"https://cdn.acedata.cloud/v8073y.png",
"https://cdn.acedata.cloud/44xlah.png"
],
"count": 1
}'
¶ 요청 예시(Python)
import requests
url = "https://api.acedata.cloud/nano-banana/images"
headers = {
"authorization": "Bearer {token}",
"accept": "application/json",
"content-type": "application/json",
}
payload = {
"action": "edit",
"prompt": "let this man wear on this T-shirt",
"image_urls": [
"https://cdn.acedata.cloud/v8073y.png",
"https://cdn.acedata.cloud/44xlah.png"
],
"count": 1
}
resp = requests.post(url, json=payload, headers=headers)
print(resp.json())
¶ 성공 응답 예시
{
"success": true,
"task_id": "93f11baf-347b-4bb4-9520-8653cb46d6a3",
"trace_id": "a9063166-26ed-4451-85b5-54e896817c69",
"data": [
{
"prompt": "let this man wear on this T-shirt",
"image_url": "https://platform.cdn.acedata.cloud/nanobanana/8e9e0253-26f4-45b9-b3f8-ac1aed1c284b.png"
}
]
}
¶ 필드 설명
image_urls[]: 편집할 이미지 URL 목록(반드시 공개 인터넷에서 접근할 수 있어야 함). 여러 장을 전달할 수 있으며, 서비스는 이러한 자료와prompt를 결합하여 편집을 완료합니다.- 나머지 필드는 「이미지 생성」 응답과 동일합니다.
¶ 비동기 콜백(선택 사항, 권장)
생성 또는 편집에는 일정 시간이 걸릴 수 있습니다. 장시간 연결로 인한 리소스 점유를 방지하기 위해 callback_url을 통한 Webhook 콜백 사용을 권장합니다.
- 요청 본문에
callback_url을 추가합니다. 예를 들어 서버의 Webhook 주소를 사용할 수 있습니다(공개 인터넷에서 접근 가능하고 POST JSON을 지원해야 함). - API는
task_id가 포함된 응답(또는 기본 결과가 포함된 응답)을 즉시 반환합니다. - 작업이 완료되면 플랫폼이
POST방식으로 전체 JSON을callback_url에 전송합니다.task_id를 통해 요청과 결과를 연결할 수 있습니다.
콜백 페이로드 예시(필드 구조는 동기 성공 응답과 동일):
{
"success": true,
"task_id": "6a97bf49-df50-4129-9e46-119aa9fca73c",
"trace_id": "9b4b1ff3-90f2-470f-b082-1061ec2948cc",
"data": [
{
"prompt": "a white siamese cat",
"image_url": "https://platform.cdn.acedata.cloud/nanobanana/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png"
}
]
}
¶ 오류 처리
호출이 실패하면 표준 오류 형식과 추적 ID가 반환됩니다. 일반적인 오류는 다음과 같습니다.
- 400
token_mismatched: 요청이 유효하지 않거나 매개변수가 잘못되었습니다. - 400
api_not_implemented: 인터페이스가 구현되지 않았습니다(지원팀에 문의하세요). - 401
invalid_token: 인증에 실패했거나 Token이 누락되었습니다. - 403
forbidden: 제공업체의 자체 보안 정책이 요청 또는 생성 결과를 거부했습니다. 해당 호출은 이미지를 반환하지 않으며 요금도 청구되지 않습니다. 여러 이미지 요청의 경우 다른 성공한 호출은 여전히 반환되고 요금이 청구될 수 있습니다. - 429
too_many_requests: 요청 빈도가 제한을 초과했습니다. - 500
api_error: 서버 오류입니다.
¶ 오류 응답 예시
{
"success": false,
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ 매개변수 대조 및 유의 사항
- 필수:
action,prompt - 편집 전용:
image_urls(배열, 최소 1개 항목) - 선택 사항:
model(기본값nano-banana, 선택 가능한 값은nano-banana-2-lite,nano-banana-2,nano-banana-2.1,nano-banana-pro;nano-banana-2.1을 제외하고 각각에 대응하는:official공식 채널 버전도 있음),aspect_ratio(auto또는 구체적인 가로세로 비율, 예:1:1,16:9),resolution(해상도, 예:1K,2K,4K;nano-banana-2-lite는1K만 지원),callback_url(비동기 콜백에 사용) - Headers:
authorization: Bearer {token}을 반드시 제공해야 함;accept는application/json으로 설정하는 것을 권장 - 이미지 접근성:
image_urls는 공개 인터넷에서 접근 가능한 직접 링크(HTTP/HTTPS)여야 하며, HTTPS 사용을 권장 - 멱등성 및 추적: 문제 해결과 결과 연결을 위해
task_id와trace_id를 보관
"aspect_ratio": "auto"를 명시적으로 전달하면 프롬프트의 비율, 방향 또는 레이아웃에 따라 가장 가까운 사전 설정을 선택하며, 생성과 편집에 모두 적용됩니다. 예를 들어 프롬프트에 「YouTube 썸네일」이라고 쓰면 16:9가 선택될 수 있습니다. 프롬프트에 크기 요구 사항이 없거나 자동 판단을 사용할 수 없는 경우, 텍스트로 이미지를 생성할 때는 기본 화면 비율을 사용하고 이미지 편집 시에는 첫 번째 참조 이미지를 따라 지원되는 비율 중 가장 가까운 비율을 사용합니다. 이 필드를 생략하면 기본 화면 비율 또는 참조 이미지의 비율을 사용합니다. 명확한 화면 비율 요구 사항이 이미 있는 경우에는 구체적인 비율을 직접 전달합니다.
