Nano Banana Pro API 개발자 레퍼런스
고급 머신러닝 기술로 구동하는 Nano Banana Pro API Visual Production Platform의 완벽한 개발자 레퍼런스 가이드입니다.
Nano Banana Pro API 개요
Nano Banana Pro API 시각적 생성 서비스는 개발자가 최신 머신러닝 엔진에 연결하여 텍스트 프롬프트와 참조 사진으로 고품질 이미지를 만들 수 있게 해줍니다. 저희 Nano Banana Pro API 솔루션은 포괄적인 작업 관리와 실시간 알림 기능을 갖춘 간단한 REST 인터페이스를 제공합니다.
Nano Banana Pro API 주요 기능
- • 최신 머신러닝 엔진을 사용하는 Nano Banana Pro API 텍스트-이미지 변환
- • Nano Banana Pro API 참조 이미지 지원 (최대 4개)
- • 실시간 진행률 추적 기능을 갖춘 Nano Banana Pro API 비동기 작업 처리
- • 즉각적인 상태 변경을 위한 Nano Banana Pro API 웹훅 알림
- • 구조화된 JSON 데이터를 반환하는 Nano Banana Pro API RESTful 인터페이스
- • Nano Banana Pro API Bearer 토큰 인증 메커니즘
overview.base_url
https://api.defapi.orgoverview.api_version
v1.0.0Nano Banana Pro API 빠른 시작
- 1. 공식 웹사이트에서 Nano Banana Pro API 계정을 만들고 접속 자격 증명을 얻으세요.
- 2. Authorization 헤더에 Nano Banana Pro API 인증 토큰을 포함시키세요.
- 3. Nano Banana Pro API 이미지 생성 엔드포인트로 POST 요청을 보내세요.
- 4. 반환된 Nano Banana Pro API 작업 ID를 사용하여 처리 상태를 확인하세요.
- 5. 처리가 완료되면 생성된 Nano Banana Pro API 이미지를 가져오세요.
액세스 인증
모든 API 요청은 Bearer 토큰 자격 증명을 사용하는 유효한 인증이 필요합니다. 매 요청마다 Authorization 헤더에 API 키를 포함해주세요.
인증 방식
Authorization 헤더에 API 자격 증명을 포함하여 HTTP Bearer 토큰 인증을 사용하세요:
Authorization: Bearer <your-api-key>API 키 형식 예시
Authorization: Bearer dk-1234567890abcdef요청 예시
curl -X POST "https://api.defapi.org/api/image/gen" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key-here" \
-d '{
"model": "google/gempix2",
"prompt": "A beautiful landscape"
}'유효한 인증
- ✅ API 자격 증명이 만료되지 않음
- ✅ 계정 등록 상태가 양호함
- ✅ 충분한 계정 잔액이 있음
일반적인 문제
- ❌ 요청에 API 자격 증명이 누락됨
- ❌ 잘못되거나 형식이 올바르지 않은 API 키
- ❌ 계정이 비활성화되었거나 접근 권한이 취소됨
Nano Banana Pro API 이미지 생성
고급 머신러닝 기술, 유연한 텍스트 프롬프트 및 참조 이미지를 사용하여 Nano Banana Pro API로 이미지를 만드세요.
API 엔드포인트
POST /api/image/gen요청 매개변수
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model identifier (e.g., "google/gempix2") |
| prompt | string | Yes | Text prompt describing the image |
| images | array | No | Reference image URLs (max 4) |
| callback_url | string | No | Webhook URL for completion notifications |
사용 예시
기본 Nano Banana Pro API 이미지 생성
{
"model": "google/gempix2",
"prompt": "A beautiful girl dancing in a garden"
}샘플 이미지를 사용한 Nano Banana Pro API 참조 기반 생성
{
"model": "google/gempix2",
"prompt": "Put them in a basket",
"images": [
"https://cdn.openai.com/API/docs/images/body-lotion.png",
"https://cdn.openai.com/API/docs/images/soap.png"
],
"callback_url": "https://example.com/webhook/image-callback"
}응답 형식
{
"code": 0,
"message": "ok",
"data": {
"task_id": "ta12345678-1234-1234-1234-123456789abc"
}
}오류 처리
400 - Bad Request
{"code": 1, "message": "failed", "detail": "prompt is required"}401 - Unauthorized
{"code": 1, "message": "Invalid API key"}Nano Banana Pro API 작업 상태
Nano Banana Pro API 이미지 생성 끝점이 반환한 작업 ID를 사용하여 Nano Banana Pro API 이미지 생성 작업의 상태와 결과를 조회합니다.
API 끝점
GET /api/task/query?task_id=<task_id>쿼리 매개변수
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | string | Yes | Unique task identifier returned from generation endpoint |
요청 예시
curl -X GET "https://api.defapi.org/api/task/query?task_id=ta823dfb-eaac-44fd-aec2-3e2c7ba8e071" \ -H "Authorization: Bearer your-api-key-here"
Nano Banana Pro API 작업 상태 유형
pending - Nano Banana Pro API 작업이 생성되었으며 처리 시작을 대기 중입니다.submitted - Nano Banana Pro API 작업이 생성을 위해 대기열에 추가되었습니다.in_progress - Nano Banana Pro API 작업이 현재 처리 중입니다.success - Nano Banana Pro API 작업이 성공적으로 완료되었으며 생성된 이미지가 준비되었습니다.failed - Nano Banana Pro API 작업에서 오류가 발생하여 완료할 수 없었습니다.오류 응답
404 - Task Not Found
{"code": 1, "message": "task not found"}401 - Unauthorized
{"code": 401, "message": "Invalid API key"}Nano Banana Pro API 데이터 구조
API 요청 및 응답에 사용되는 모든 Nano Banana Pro API 데이터 형식 및 스키마에 대한 전체 참조 자료입니다.
ImageGenResult
Represents a generated image result.
{
"image": "https://google.datas.systems/fileSystem/response_images/287/2025/08/29/1756432513771985292_2989.png"
}| Field | Type | Description |
|---|---|---|
| image | string | Image URL or base64 data URI |
CallbackPayload
Payload sent to the callback_url when task status changes to final states.
{
"result": [
{
"image": "https://google.datas.systems/fileSystem/response_images/287/2025/08/29/1756432513771985292_2989.png"
}
],
"status": "success",
"task_id": "ta5c9705-b8ae-4cb9-aa6f-97c4fee88c8d",
"consumed": "0.500000",
"status_reason": {
"message": null
}
}| Field | Type | Description |
|---|---|---|
| result | array | Array of ImageGenResult objects (null if failed) |
| status | string | Final task status (success/failed) |
| task_id | string | Unique task identifier |
| consumed | string | Credits consumed by the task |
| status_reason | object | Status details including error message if failed |
Nano Banana Pro API 지원 모델
google/gempix2Nano Banana image generation modelgoogle/gemini-2.5-flash-imageGemini 2.5 Flash image model오류 관리
오류 처리 및 API 응답 코드 해석을 위한 완전 가이드입니다. 모든 오류 메시지는 효과적인 문제 해결 절차를 위해 일관된 형식을 따릅니다.
HTTP 상태 코드
OK
Request was successful
Bad Request
Invalid request parameters or malformed JSON
Unauthorized
Invalid, missing, or expired API key
Not Found
Task not found or endpoint doesn't exist
Internal Server Error
Server-side error occurred
오류 처리 모범 사례
- 응답 데이터를 처리하기 전에 항상 HTTP 상태 코드를 확인하세요
- 500 오류 발생 시 재시도 메커니즘을 위해 지수 백오프 전략을 구현하세요
- 디버깅을 위해 전체 컨텍스트와 함께 오류 메시지를 기록하세요
- 400 오류를 피하기 위해 요청을 보내기 전에 입력 매개변수를 검증하세요
- 클라이언트가 API 자격 증명을 새로고쳐 인증 문제를 해결하세요
- 상태를 과도하게 폴링하는 대신 적절한 간격으로 작업 진행 상황을 모니터링하세요
- 완료 상태를 계속 폴링하는 것을 피하기 위해 가능한 경우 웹훅 알림을 사용하세요
오류 처리 예제 (JavaScript)
async function generateImage(prompt, apiKey) {
try {
const response = await fetch('https://api.defapi.org/api/image/gen', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
},
body: JSON.stringify({
model: 'google/gempix2',
prompt: prompt
})
});
if (!response.ok) {
const errorData = await response.json();
throw new Error(`API Error ${response.status}: ${errorData.message}`);
}
const data = await response.json();
return data.data.task_id;
} catch (error) {
console.error('Image generation failed:', error.message);
throw error;
}
}