DropShot 이미지 생성 API
← 콘솔Google nano-banana-pro 기반 텍스트→이미지 / 이미지→이미지 생성 REST API.
개요
모든 요청의 기준 URL(Base URL):
- 요청/응답은 JSON (UTF-8).
- 생성은 비동기: 생성 요청 시
job_id를 받고,/v1/job/{id}로 폴링합니다. - 결과 이미지는
https://dropshot.rebeauty.cafe/img/<파일명>절대 URL 로 반환됩니다. - 모델:
google/nano-banana-pro· 무제한 모드(크레딧 소모 없음)로 생성.
인증
이미지 생성/조회 엔드포인트는 공개 API 키를 X-Api-Key 헤더로 전달해야 합니다.
X-Api-Key: ds_live_********************
쿠키 갱신·세션 조회 등 관리자 엔드포인트는 X-Admin-Key 헤더가 필요합니다.
두 키 모두 관리 콘솔에서 확인할 수 있습니다.
생성 흐름
1) POST /v1/generate → { job_id, status:"queued", poll:"/v1/job/{id}" } (202)
2) GET /v1/job/{id} → { status:"queued|processing" } (진행 중, 2~3초 간격 폴링)
3) GET /v1/job/{id} → { status:"done", images:["https://dropshot.rebeauty.cafe/img/xxx.jpg"] }
일반적으로 생성에는 40~90초가 소요됩니다(해상도·대기열에 따라 변동).
이미지 생성 POST /v1/generate
텍스트 프롬프트로 이미지를 생성합니다(T2I).
요청 본문
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
prompt | string | ✔ | 생성 프롬프트 |
ratio | string | — | 비율. 기본 자동. (값) |
resolution | string | — | 해상도. 기본 2K. 1K/2K/4K |
예시
curl -X POST https://dropshot.rebeauty.cafe/v1/generate \
-H "X-Api-Key: ds_live_********" \
-H "Content-Type: application/json" \
-d '{"prompt":"흰 대리석 위 빨간 사과, 스튜디오 조명","ratio":"1:1","resolution":"2K"}'
응답 202
{
"ok": true,
"job_id": "9aba727c2d4d4979",
"status": "queued",
"model": "google/nano-banana-pro",
"ratio": "1:1", "resolution": "2K",
"queue_depth": 1,
"poll": "/v1/job/9aba727c2d4d4979"
}
이미지→이미지 POST /v1/edit
참조 이미지 URL(들)을 바탕으로 편집/변형 생성합니다(I2I, 최대 14장). 참조는 http(s) URL 만 허용됩니다.
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
prompt | string | ✔ | 편집 지시 프롬프트 |
image_urls | string[] | ✔ | 참조 이미지 URL 배열(1~14) |
ratio, resolution | string | — | generate 와 동일 |
curl -X POST https://dropshot.rebeauty.cafe/v1/edit \
-H "X-Api-Key: ds_live_********" -H "Content-Type: application/json" \
-d '{"prompt":"배경을 밤바다로 바꿔줘","image_urls":["https://example.com/a.jpg"]}'
작업 조회 GET /v1/job/{id}
생성 작업의 상태와 결과를 조회합니다.
응답 (완료)
{
"id": "9aba727c2d4d4979",
"status": "done",
"ok": true,
"images": ["https://dropshot.rebeauty.cafe/img/ds_1783498706_0.jpg"],
"count": 1, "mode": "t2i",
"ratio": "1:1", "resolution": "2K",
"gen_seconds": 75.1,
"finished_at": "2026-07-08T08:18:26+00:00"
}
status: queued → processing → done | error
세션 상태 GET /v1/session 관리자
현재 로그인/크레딧 상태를 반환합니다. /v1/session/refresh(POST)는 브라우저를 열어 실제 재확인합니다.
curl https://dropshot.rebeauty.cafe/v1/session -H "X-Admin-Key: ds_admin_********"
→ {"ok":true,"account":"fgs_dna1","credit":24000,"logged_in":true,"model":"google/nano-banana-pro"}
쿠키 갱신 POST /v1/cookies/refresh 관리자
브라우저에서 export 한 DropShot 쿠키로 세션을 갱신합니다. 개발자도구 → Application → Cookies 의
.dropshot.io 표를 복사해 cookies 필드에 넣습니다(Netscape cookies.txt 도 지원).
AWS Cognito refreshToken·LastAuthUser 쿠키가 반드시 포함되어야 합니다.
{
"cookies": "CognitoIdentity...refreshToken\teyJ...\t.dropshot.io\t/\t2027-07-08T...\n..."
}
→ {"ok":true,"validated":true,"credit":24000,"imported":{"count":11,"cognito":["LastAuthUser","refreshToken",...]}}
보통은 관리 콘솔의 “쿠키 갱신” UI에 붙여넣는 것이 편리합니다.
헬스체크 GET /health
curl https://dropshot.rebeauty.cafe/health → {"ok":true,"service":"dropshot-api"}
파라미터 값
| 파라미터 | 허용 값 | 기본 |
|---|---|---|
ratio | 자동 1:1 4:3 3:4 16:9 9:16 | 자동 |
resolution | 1K 2K 4K | 2K |
에러 코드
| HTTP | error | 의미 |
|---|---|---|
| 401 | unauthorized | API 키/관리자 키 누락 또는 불일치 |
| 422 | prompt_required | prompt 누락 |
| 422 | image_urls_required | edit 요청에 유효한 http(s) 참조 URL 없음 |
| 404 | job_not_found | 존재하지 않는 job_id |
| 502 | backend_unreachable | 생성 백엔드 다운(관리자에게 문의) |
예제 코드
Python
import requests, time
BASE="https://dropshot.rebeauty.cafe"; KEY="ds_live_********"
h={"X-Api-Key":KEY,"Content-Type":"application/json"}
j=requests.post(f"{BASE}/v1/generate",json={"prompt":"a red apple","ratio":"1:1"},headers=h).json()
jid=j["job_id"]
while True:
d=requests.get(f"{BASE}/v1/job/{jid}",headers=h).json()
if d["status"] in("done","error"): break
time.sleep(3)
print(d["images"][0] if d["status"]=="done" else d["error"])
JavaScript (fetch)
const BASE="https://dropshot.rebeauty.cafe", KEY="ds_live_********";
const h={"X-Api-Key":KEY,"Content-Type":"application/json"};
const {job_id}=await (await fetch(`${BASE}/v1/generate`,{method:"POST",headers:h,
body:JSON.stringify({prompt:"a red apple",ratio:"1:1"})})).json();
let d; do{ await new Promise(r=>setTimeout(r,3000));
d=await (await fetch(`${BASE}/v1/job/${job_id}`,{headers:h})).json();
}while(!["done","error"].includes(d.status));
console.log(d.images?.[0] || d.error);
DropShot 이미지 생성 API · google/nano-banana-pro · 콘솔