Rivya AI 문서
모델 API 페이지

Grok Imagine Image 2.0 API 연동

Rivya Public API v1에서 Grok Imagine Image 2.0을 모델 ID grok-imagine-image-2-0, 지원 입력, 파라미터, Files API 규칙, 크레딧, 응답 예시와 함께 사용하세요.

API로 사용 가능텍스트 또는 URL 준비됨; 참조 모드는 Files API 사용이미지
API 모델 ID

grok-imagine-image-2-0

입력

text, file

Files API

참조 모드에 필요

기본 크레딧

per_image · text_to_image=4 · image_edit=4 · ⌈total⌉

기능

이미지

과금

FIXED

프롬프트 제한

20000 자

요청 계약

모델 ID는 최상위 수준에 보냅니다. 모델별 제어값은 params에 넣습니다.

Key유형필수기본값설명
modelstringgrok-imagine-image-2-0grok-imagine-image-2-0을 API 모델 ID로 사용합니다.
promptstring-이 모델은 최대 20000자까지 사용할 수 있습니다.
paramsobject아니요-모델별 파라미터 객체입니다. 허용되는 키는 아래 행을 확인하세요.
client_request_idstring아니요-자체 시스템에서 요청을 추적하기 위한 선택적 클라이언트 ID입니다.

모델 파라미터

Key유형필수기본값범위옵션설명
aspect_ratioselect아니요1:1-1:1, 2:3, 3:2, 16:9, 9:16, auto참조 이미지를 한 장 이상 업로드해야 자동 옵션을 사용할 수 있습니다.

업로드 정책

참조 파일을 먼저 업로드한 다음 반환된 URL과 durationToken을 params.referenceMediaItems 안에 넣으세요.

참조 규칙

참조 이미지: JPEG, PNG 또는 WebP 이미지를 한 장에서 다섯 장까지 업로드할 수 있으며, 각 이미지는 최대 10 MB입니다. 모든 참조 이미지에는 서명된 업로드 메타데이터가 필요합니다.

최대 파일 수

5

허용되는 파일 종류

image

재생시간 토큰

재생시간 검증이 필요한 경우 비디오 및 오디오 참조는 /api/v1/files의 durationToken을 포함해야 합니다.

kind최대 크기MIME 유형
image10 MBimage/jpeg, image/png, image/webp

최소 요청

{
  "model": "grok-imagine-image-2-0",
  "prompt": "A clean editorial product image on a soft studio background",
  "params": {
    "aspect_ratio": "1:1"
  }
}

참조 파일 요청

{
  "model": "grok-imagine-image-2-0",
  "prompt": "A clean editorial product image on a soft studio background",
  "params": {
    "aspect_ratio": "1:1",
    "referenceMediaItems": [
      {
        "url": "https://cdn.example.com/reference-image.png",
        "kind": "image",
        "name": "reference-image.png",
        "mimeType": "image/png",
        "width": 1024,
        "height": 1024,
        "sizeBytes": 1048576,
        "imageDimensionsToken": "image_dimensions_token_from_original_files_api_upload_response"
      }
    ]
  }
}

생성 응답

생성 엔드포인트는 공개 작업 ID를 반환합니다. 작업이 성공하거나 실패할 때까지 상태 엔드포인트를 폴링하세요.

{
  "id": "task_grok_imagine_image_2_0_example",
  "status": "queued",
  "model": "grok-imagine-image-2-0",
  "reserved_credits": 4,
  "final_credits": 0,
  "settlement_status": "RESERVED",
  "created_at": "2026-05-11T00:00:00.000Z",
  "updated_at": "2026-05-11T00:00:00.000Z",
  "result": null,
  "error": null
}

일반 오류

validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found

일부 모드는 Files API 참조 업로드가 필요합니다.