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

이미지

gemini-3.1-flash-image API

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

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

꽃집 냉장실의 철제 선반 위에 꽃이 불어 유리로 변하는 모습.

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

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

프롬프트: The cold room of a flower shop, steel shelves and buckets of cut stems. A figure in an acid-green vinyl coat has just pulled one bucket toward the door. Along that whole shelf the flowers have begun turning to blown glass, petal by petal, the transformation running outward from the bucket like frost: stems still green at the base, heads already clear and ringing, throwing hard coloured caustics across the steel. One hard pink light through the open cooler door, cold blue shade behind. Wide low camera, macro-sharp on the glass edges, real weight, film grain, no text.

이 샘플을 생성한 요청
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "The cold room of a flower shop, steel shelves and buckets of cut stems. A figure in an acid-green vinyl coat has just pulled one bucket toward the door. Along that whole shelf the flowers have begun turning to blown glass, petal by petal, the transformation running outward from the bucket like frost: stems still green at the base, heads already clear and ringing, throwing hard coloured caustics across the steel. One hard pink light through the open cooler door, cold blue shade behind. Wide low camera, macro-sharp on the glass edges, real weight, 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-3.1-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 아니요 512 / 1K / 2K / 4K

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

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

터미널 창bash
curl "https://modelflare.dev/v1/models/gemini-3.1-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-3.1-flash-image에 대한 기본 Gemini 응답 형태를 유지하고 사용 가능한 이미지 부분을 유지합니다.

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

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

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

미디어 계약 · v1

계약 ID: media.gemini-3-1-flash-image.v1어댑터: image.gemini.native.v1@v1지문: fb4adc579d570a2f8d4371edde0dc6bfa1042a004eb39641c63bd98fa4c7c8cc

공식 출처: Google

계약 매개변수

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

지원되는 기능

  • allowed_values · size · 512, 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": "512"
}

제공자 요청

{
  "contents": [
    {
      "parts": [
        {
          "text": "A red paper kite over a quiet harbour at dusk."
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "imageConfig": {
      "aspectRatio": "1:1",
      "imageSize": "512"
    },
    "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": "512"
}

제공자 요청

{
  "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": "512"
    },
    "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."
      }
    ]
  }
}