DropShot 이미지 생성 API

← 콘솔

Google nano-banana-pro 기반 텍스트→이미지 / 이미지→이미지 생성 REST API.

개요

모든 요청의 기준 URL(Base URL):

https://dropshot.rebeauty.cafe

인증

이미지 생성/조회 엔드포인트는 공개 API 키X-Api-Key 헤더로 전달해야 합니다.

X-Api-Key: ds_live_********************

쿠키 갱신·세션 조회 등 관리자 엔드포인트는 X-Admin-Key 헤더가 필요합니다. 두 키 모두 관리 콘솔에서 확인할 수 있습니다.

⚠️ API 키는 이 계정의 DropShot 크레딧/세션에 접근합니다. 외부에 노출하지 마세요.

생성 흐름

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).

요청 본문

필드타입필수설명
promptstring생성 프롬프트
ratiostring비율. 기본 자동. ()
resolutionstring해상도. 기본 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 만 허용됩니다.

필드타입필수설명
promptstring편집 지시 프롬프트
image_urlsstring[]참조 이미지 URL 배열(1~14)
ratio, resolutionstringgenerate 와 동일
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: queuedprocessingdone | 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자동
resolution1K 2K 4K2K

에러 코드

HTTPerror의미
401unauthorizedAPI 키/관리자 키 누락 또는 불일치
422prompt_requiredprompt 누락
422image_urls_requirededit 요청에 유효한 http(s) 참조 URL 없음
404job_not_found존재하지 않는 job_id
502backend_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 · 콘솔