콘텐츠로 이동
캐스털리 오픈콘솔

이미지

gemini-2.5-flash-image API

이 페이지에 표시된 정확한 모델 ID를 사용하여 Modelflare를 통해 gemini-2.5-flash-image을 호출하세요.

정확한 모델 ID gemini-2.5-flash-image를 사용하세요. 모델 필드는 이 페이지와 정확히 일치해야 합니다.

랙에서 들어 올려 보라색에서 주황색까지의 그라데이션 벽으로 분류되는 페인트 칩 카드.

샘플 출력gemini-2.5-flash-imagePOST /v1beta/models/gemini-2.5-flash-image:generateContent

매개변수: size=2Kratio=16:9

프롬프트: The paint aisle of a hardware store, fluorescent tubes and rows of colour chip cards. A woman in a chrome puffer coat has just run one hand along the rack. Every card she touched has lifted off its peg and the whole aisle is filling with them, thousands of paper chips turning in the air and sorting themselves into a single smooth gradient wall from deep violet to hot orange. Cold fluorescent ambient, one hard warm slash of light from the end of the aisle. Wide low camera down the aisle, paper edges catching the light, film grain, no text.

이 샘플을 생성한 요청
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "The paint aisle of a hardware store, fluorescent tubes and rows of colour chip cards. A woman in a chrome puffer coat has just run one hand along the rack. Every card she touched has lifted off its peg and the whole aisle is filling with them, thousands of paper chips turning in the air and sorting themselves into a single smooth gradient wall from deep violet to hot orange. Cold fluorescent ambient, one hard warm slash of light from the end of the aisle. Wide low camera down the aisle, paper edges catching the light, film grain, no text."
}
]
}
],
"generationConfig": {
"responseModalities": [
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "2K"
}
}
}

https://modelflare.dev과 함께 Modelflare API 키를 사용합니다. 게이트웨이 진입점은 POST /v1/models/{model}:generateContent입니다.

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
터미널 창bash
curl "https://modelflare.dev/v1/models/gemini-2.5-flash-image:generateContent" \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [{"text": "A white cat runs through a neon-lit street in the rain"}]}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"], "imageConfig": {"aspectRatio": "16:9", "imageSize": "1K"}}
}'

Gemini 이미지 모델은 기본 contents 및 generationConfig을 사용합니다. 편집은 동일한 parts[]에 텍스트 명령과 inline_data를 보냅니다.

Gemini 이미지 모델은 기본 Gemini generateContent를 사용합니다. 동일한 contents[].parts[]에 텍스트와 참조 이미지를 넣습니다. 이미지는 inline_data를 사용합니다. 이러한 모델을 /v1/images/generations, /v1/images/edits 또는 OpenAI /v1/responses로 보내지 마십시오. imageSize 열거형은 모델별로 다르며 아래와 같습니다.

필드 필수 노트
contents[].parts[].text 예 텍스트 프롬프트 또는 편집 지침
contents[].parts[].inline_data 아니요 Base64 이미지 데이터 및 MIME 유형
contents[].parts[].inline_data.mime_type 아니요 image/jpeg / image/png / image/webp
contents[].parts[].inline_data.data 아니요 Base64로 인코딩된 참조 이미지 콘텐츠
generationConfig.responseModalities 예 ["IMAGE"] 또는 ["TEXT", "IMAGE"]
generationConfig.imageConfig.aspectRatio 아니요 1:1 / 4:3 / 3:4 / 16:9 / 9:16
generationConfig.imageConfig.imageSize 아니요 1K / 2K / 4K

Gemini 2.5 플래시 이미지는 1:1, 4:3, 3:4, 16:9 및 9:16과 함께 1K, 2K 및 4K를 지원합니다. 공식 문서에는 참조 이미지 수 한도가 게시되지 않으므로 게이트웨이는 로컬 한도를 추가하지 않습니다.

편집 명령과 참조 이미지를 동일한 contents[].parts[]에 넣습니다. inline_data.data은 Base64 이미지 콘텐츠입니다. Gemini 이미지 모델을 OpenAI 이미지 또는 Responses 엔드포인트로 보내지 마십시오.

터미널 창bash
curl "https://modelflare.dev/v1/models/gemini-2.5-flash-image:generateContent" \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [
{"text": "Keep the subject and lighting, but replace the background with a misty pine forest."},
{"inline_data": {"mime_type": "image/jpeg", "data": "BASE64_IMAGE_DATA"}}
]}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"], "imageConfig": {"aspectRatio": "1:1", "imageSize": "1K"}}
}'

candidates[].content.parts[] 읽기; 응답에 텍스트와 이미지 부분이 함께 포함될 수 있으므로 모든 부분이 이미지라고 가정하지 마십시오.

필드 노트
candidates[].content.parts[].inline_data 생성된 이미지 MIME 유형 및 Base64 데이터
candidates[].content.parts[].text TEXT 요청 시 텍스트 캡션이 반환됨
candidates[].finishReason 완료 또는 안전 사유
usageMetadata 서비스 반환 시 입출력 토큰 사용량

Modelflare는 gemini-2.5-flash-image에 대한 기본 Gemini 응답 형태를 유지하고 사용 가능한 이미지 부분을 유지합니다.

기본 Gemini 요청의 필드 오류, 크기/비율 제한 및 안전 거부는 Gemini 호환 오류 응답으로 유지됩니다. 게이트웨이는 이를 OpenAI 이미지 응답으로 다시 작성하지 않습니다.

이 페이지에서는 Modelflare 모델 생성 및 편집 호출을 다룹니다. 검색 또는 지도 강화, 음성 관리 및 요소 라이브러리 관리는 이 공개 모델 호출 표면 외부의 리소스 API이며 필수 요청 필드가 아닙니다.

이 모델은 통화당 청구를 사용합니다. 현재 고객 가격, 참조 정가 및 전체 사양은 모델 가격 페이지를 참조하세요.

미디어 계약 · v1

계약 ID: media.gemini-2-5-flash-image.v1어댑터: image.gemini.native.v1@v1지문: 240c1369048275e3ae3ec16db479ebda38b31af481c1ca118c04ae0f23d66ead

공식 출처: Google

계약 매개변수

인텐트 필드컨트롤옵션
sizeselect1K / 2K / 4K
ratioselect1:1 / 4:3 / 3:4 / 16:9 / 9:16

지원되는 기능

  • allowed_values · size · 1K, 2K, 4K
  • allowed_values · ratio · 1:1, 4:3, 3:4, 16:9, 9:16

구조화된 요청 예시

text

인텐트

{
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "1:1",
  "size": "1K"
}

제공자 요청

{
  "contents": [
    {
      "parts": [
        {
          "text": "A red paper kite over a quiet harbour at dusk."
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "imageConfig": {
      "aspectRatio": "1:1",
      "imageSize": "1K"
    },
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  },
  "systemInstruction": {
    "parts": [
      {
        "text": "Generate an image for the user's request. If details are missing, choose reasonable defaults and still return an image. Do not ask clarifying questions."
      }
    ]
  }
}

reference

인텐트

{
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "1:1",
  "size": "1K"
}

제공자 요청

{
  "contents": [
    {
      "parts": [
        {
          "text": "A red paper kite over a quiet harbour at dusk."
        },
        {
          "inline_data": {
            "data": "AAAA",
            "mime_type": "image/png"
          }
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "imageConfig": {
      "aspectRatio": "1:1",
      "imageSize": "1K"
    },
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  },
  "systemInstruction": {
    "parts": [
      {
        "text": "Generate an image for the user's request. If details are missing, choose reasonable defaults and still return an image. Do not ask clarifying questions."
      }
    ]
  }
}