CheaperGen

FLUX.2 [pro] API 문서

코드에서 FLUX.2 [pro] API를 호출하는 데 필요한 모든 내용입니다. 기본 URL은 https://cheapergen.com/api/v1입니다. 먼저 플레이그라운드에서 테스트해 보세요.

코딩 에이전트를 사용하시나요?

이 내용을 Claude Code, Cursor, Codex 또는 원하는 코딩 에이전트에 붙여넣으세요. 프로젝트에 API를 추가하고 API 키는 CHEAPERGEN_API_KEY에 보관하며, 비용을 사용하기 전에 무료 견적을 요청해 테스트합니다.

Add FLUX.2 [pro] (CheaperGen endpoint bfl/flux-2-pro/text-to-image) to this project by following https://cheapergen.com/agents/integrate.md
에이전트가 읽는 내용

인증

대시보드 → API 키에서 키를 만들고 bearer token으로 전송하세요. 키는 서버에 안전하게 보관하세요.

export CHEAPERGEN_API_KEY="cg_live_…"

# every request
Authorization: Bearer $CHEAPERGEN_API_KEY

FLUX.2 [pro] 텍스트 → 이미지 API

POST/api/v1/run/bfl/flux-2-pro/text-to-image

비동기 작업을 제출하고 생성 ID가 포함된 HTTP 202 응답을 반환합니다. GET /api/v1/generations/{id}의 상태를 조회하거나 webhook_url를 전달하세요. 자세한 내용은 작업 수명 주기 문서를 참조하세요.

입력 매개변수

이름유형설명가격에 영향
prompt필수string피사체, 동작, 카메라 움직임, 조명, 스타일을 설명하세요.없음
aspect_ratiostring (enum)출력 이미지 비율입니다.
허용값: 1:1 · 4:3 · 3:4 · 16:9 · 9:16 · 3:2 · 2:3 · 21:9 · 9:21
기본값: 1:1
예
resolutionstring (enum)출력 크기(메가픽셀 단위, 1 MP ≈ 1024×1024). FLUX.2는 메가픽셀당 요금이 부과됩니다.
허용값: 1MP · 2MP · 3MP · 4MP
기본값: 1MP
예
prompt_upsamplingboolean생성 전에 모델이 프롬프트를 확장하고 다시 작성하도록 합니다.
기본값: false
없음
seedinteger같은 시드와 설정을 사용하면 결과를 재현할 수 있습니다. 비워 두면 무작위로 설정됩니다.없음
webhook_url문자열(URL)선택 사항. 완료된 생성을 웹훅 비밀키로 서명해 이곳으로 POST합니다. 웹훅없음

요청

const API = "https://cheapergen.com/api/v1";
const headers = {
  Authorization: `Bearer ${process.env.CHEAPERGEN_API_KEY}`,
  "Content-Type": "application/json",
};

// 1. Submit the job
let job = await fetch(`${API}/run/bfl/flux-2-pro/text-to-image`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    "prompt": "린넨을 깐 테이블 위에 말린 꽃이 꽂힌 도자기 꽃병을 담은 에디토리얼 사진, 부드러운 북향 자연광, 필름 그레인",
    "aspect_ratio": "1:1",
    "resolution": "1MP"
  }),
}).then((r) => r.json());

// 2. Poll until it finishes (or pass webhook_url and skip polling)
while (job.status === "queued" || job.status === "running") {
  await new Promise((r) => setTimeout(r, 3000));
  job = await fetch(`${API}/generations/${job.id}`, { headers }).then((r) => r.json());
}

console.log(job.status === "succeeded" ? job.output.images[0].url : job.error);

응답

{
  "id": "gen_8c2QmX1nq0k4",
  "object": "generation",
  "model": "bfl/flux-2-pro",
  "endpoint": "bfl/flux-2-pro/text-to-image",
  "mode": "text-to-image",
  "status": "queued",
  "input": {
    "prompt": "린넨을 깐 테이블 위에 말린 꽃이 꽂힌 도자기 꽃병을 담은 에디토리얼 사진, 부드러운 북향 자연광, 필름 그레인",
    "aspect_ratio": "1:1",
    "resolution": "1MP"
  },
  "output": null,
  "error": null,
  "cost": {
    "amount_usd": 0.2255,
    "currency": "usd",
    "estimated": true,
    "official_usd": null,
    "list_price_source": "official",
    "list_price_label": "Official",
    "saved_usd": null
  },
  "source": "api",
  "started_at": null,
  "completed_at": null,
  "urls": {
    "get": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4",
    "cancel": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4/cancel"
  },
  "created_at": "2026-10-15T09:21:04Z"
}

FLUX.2 [pro] 이미지 편집 API

POST/api/v1/run/bfl/flux-2-pro/edit

비동기 작업을 제출하고 생성 ID가 포함된 HTTP 202 응답을 반환합니다. GET /api/v1/generations/{id}의 상태를 조회하거나 webhook_url를 전달하세요. 자세한 내용은 작업 수명 주기 문서를 참조하세요.

입력 매개변수

이름유형설명가격에 영향
prompt필수string피사체, 동작, 카메라 움직임, 조명, 스타일을 설명하세요.없음
image_urls필수string[] (URLs)수정하거나 조합할 참조 이미지를 최대 8개까지 사용할 수 있습니다. 프롬프트에서 “이미지 1”, “이미지 2”…와 같이 참조하세요.
최대 항목 수: 8
없음
aspect_ratiostring (enum)출력 이미지 비율입니다.
허용값: auto · 1:1 · 4:3 · 3:4 · 16:9 · 9:16 · 3:2 · 2:3
기본값: auto
예
resolutionstring (enum)출력 크기(메가픽셀 단위, 1 MP ≈ 1024×1024). FLUX.2는 메가픽셀당 요금이 부과됩니다.
허용값: 1MP · 3MP
기본값: 1MP
예
webhook_url문자열(URL)선택 사항. 완료된 생성을 웹훅 비밀키로 서명해 이곳으로 POST합니다. 웹훅없음

요청

const API = "https://cheapergen.com/api/v1";
const headers = {
  Authorization: `Bearer ${process.env.CHEAPERGEN_API_KEY}`,
  "Content-Type": "application/json",
};

// 1. Submit the job
let job = await fetch(`${API}/run/bfl/flux-2-pro/edit`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    "prompt": "이미지 1의 운동화를 이미지 2의 콘크리트 받침대 위에 놓고, 오후의 강한 그림자와 자연스럽게 어우러지게 하세요",
    "image_urls": [
      "https://cdn.cheapergen.com/samples/portrait.jpg"
    ],
    "aspect_ratio": "auto",
    "resolution": "1MP"
  }),
}).then((r) => r.json());

// 2. Poll until it finishes (or pass webhook_url and skip polling)
while (job.status === "queued" || job.status === "running") {
  await new Promise((r) => setTimeout(r, 3000));
  job = await fetch(`${API}/generations/${job.id}`, { headers }).then((r) => r.json());
}

console.log(job.status === "succeeded" ? job.output.images[0].url : job.error);

응답

{
  "id": "gen_8c2QmX1nq0k4",
  "object": "generation",
  "model": "bfl/flux-2-pro",
  "endpoint": "bfl/flux-2-pro/edit",
  "mode": "edit",
  "status": "queued",
  "input": {
    "prompt": "이미지 1의 운동화를 이미지 2의 콘크리트 받침대 위에 놓고, 오후의 강한 그림자와 자연스럽게 어우러지게 하세요",
    "image_urls": [
      "https://cdn.cheapergen.com/samples/portrait.jpg"
    ],
    "aspect_ratio": "auto",
    "resolution": "1MP"
  },
  "output": null,
  "error": null,
  "cost": {
    "amount_usd": 0.2255,
    "currency": "usd",
    "estimated": true,
    "official_usd": null,
    "list_price_source": "official",
    "list_price_label": "Official",
    "saved_usd": null
  },
  "source": "api",
  "started_at": null,
  "completed_at": null,
  "urls": {
    "get": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4",
    "cancel": "https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4/cancel"
  },
  "created_at": "2026-10-15T09:21:04Z"
}

결과 가져오기

생성은 비동기로 처리됩니다. status 값을 확인해 succeeded, failed, canceled 중 하나가 될 때까지 폴링하거나 제출 시 webhook_url를 전달하세요. 실패한 생성은 자동 환불됩니다.

curl https://cheapergen.com/api/v1/generations/gen_8c2QmX1nq0k4 \
  -H "Authorization: Bearer $CHEAPERGEN_API_KEY"

추가: 작업 수명 주기 · 웹훅 · 오류

FLUX.2 [pro] 요금

결제 이미지당 사용한 만큼 결제하며 구독은 필요하지 않습니다. 생성 실패 시 자동으로 환불됩니다.

등급공식 가격CheaperGen
1 MP
≈1024×1024
$0.03/img$0.0276/img
2 MP
$0.045/img$0.0396/img
월간 요금제를 이용하면: Pro $0.039Max $0.0383
3 MP
$0.06/img$0.0493/img
월간 요금제를 이용하면: Pro $0.0477Max $0.0461
4 MP
≈2048×2048
$0.075/img$0.0575/img
월간 요금제를 이용하면: Pro $0.0551Max $0.0526
1 MP 편집
참조 이미지 1–8장
$0.045/img$0.0279/img
3 MP 편집
참조 이미지 1–8장
$0.075/img$0.0514/img
월간 요금제를 이용하면: Pro $0.0501Max $0.0488

월간 요금제 대부분 모델 가격을 할인하며(각 가격 아래 표시), 사용한 만큼만 결제할 수도 있습니다. Pro $499/월 · Max $4,999/월.

  • 공식 가격: FLUX.2 [pro]의 BFL API 정가(첫 출력 메가픽셀당 $0.03, 추가 MP당 $0.015; 입력 이미지는 MP당 $0.015이므로 편집 행의 공식 가격에는 1 MP 입력 이미지 한 장이 포함됩니다). 가격 확인일 2026년 10월 18일.
  • 이미지 편집은 출력 크기(1 MP 또는 3 MP)별 정액 요금으로 입력 이미지를 최대 8장까지 사용할 수 있으며, 입력 이미지도 요금에 포함됩니다.