메인 콘텐츠로 건너뛰기
LemonData는 Gemini 모델에 대해 네이티브 Google Gemini API 형식을 지원합니다. 이를 통해 Google AI SDK와 직접적인 호환이 가능합니다.

경로 파라미터

model
string
필수
모델 이름 (예: gemini-2.5-pro, gemini-2.5-flash).For production integrations, prefer URL-based fileData / file_data media parts with a public https URL. LemonData will route supported Gemini-native channels through the native path when possible and automatically fall back to the compatible internal conversion path when a native-ready route is unavailable for that multimodal request.

쿼리 파라미터

key
string
API 키 (헤더 인증의 대안).

인증

Gemini 엔드포인트는 여러 인증 방법을 지원합니다:
  • ?key=YOUR_API_KEY 쿼리 파라미터
  • x-goog-api-key: YOUR_API_KEY 헤더
  • Authorization: Bearer YOUR_API_KEY 헤더

요청 본문

contents
array
필수
대화 내용.각 콘텐츠 객체는 다음을 포함합니다:
  • role (string): user 또는 model
  • parts (array): 콘텐츠 part. LemonData는 현재 다음을 지원합니다:
    • 텍스트 part: { "text": "..." }
    • 인라인 미디어 part: inlineData / inline_data
    • URL 기반 파일 part: fileData / file_data
미디어 part의 경우 LemonData는 현재 이미지, 오디오, 비디오 MIME type을 받아 Gemini 호환 공개 계약을 통해 전달합니다.
systemInstruction
object
모델을 위한 시스템 지침.
generationConfig
object
생성 설정:
  • temperature (number): 샘플링 온도
  • topP (number): Nucleus 샘플링 확률
  • topK (integer): Top-K 샘플링
  • maxOutputTokens (integer): 최대 출력 토큰 수
  • stopSequences (array): 중단 시퀀스
safetySettings
array
안전 필터 설정.

응답

candidates
array
생성된 콘텐츠 후보.
usageMetadata
object
토큰 사용 정보.
curl -X POST "https://api.lemondata.cc/v1beta/models/gemini-2.5-pro:generateContent?key=sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "parts": [{"text": "Hello, Gemini!"}]
      }
    ],
    "generationConfig": {
      "temperature": 0.7,
      "maxOutputTokens": 1024
    }
  }'

멀티모달 입력 예시

Gemini 멀티모달 요청에서는 미디어를 contents[].parts[] 안에 넣고, 인라인 바이트 또는 URL 기반 파일 참조 중 하나를 사용합니다. 현재 공개 Gemini 계약에서 지원하는 미디어 카테고리:
  • image
  • audio
  • video
인라인 미디어는 inlineData 또는 inline_data 를 사용하고 Base64 인코딩된 파일 바이트를 전달합니다. URL 미디어는 fileData 또는 file_data 를 사용하고 공개적으로 접근 가능한 https URL을 전달합니다.

이미지 입력 예시

{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "이 이미지를 설명해 주세요." },
        {
          "inlineData": {
            "mimeType": "image/jpeg",
            "data": "/9j/4AAQSkZJRgABAQ..."
          }
        }
      ]
    }
  ]
}

오디오 입력 예시

{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "이 오디오를 전사하고 요약해 주세요." },
        {
          "file_data": {
            "mime_type": "audio/mpeg",
            "file_uri": "https://example.com/sample.mp3"
          }
        }
      ]
    }
  ]
}

비디오 입력 예시

{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "이 비디오를 간단히 설명해 주세요." },
        {
          "fileData": {
            "mimeType": "video/mp4",
            "fileUri": "https://example.com/sample.mp4"
          }
        }
      ]
    }
  ]
}
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {"text": "Hello! How can I assist you today?"}
        ]
      },
      "finishReason": "STOP",
      "safetyRatings": [
        {"category": "HARM_CATEGORY_HARASSMENT", "probability": "NEGLIGIBLE"}
      ]
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 5,
    "candidatesTokenCount": 10,
    "totalTokenCount": 15
  }
}

Video Input Example

{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Please describe this video." },
        {
          "fileData": {
            "mimeType": "video/mp4",
            "fileUri": "https://example.com/demo.mp4"
          }
        }
      ]
    }
  ]
}

Audio Input Example

{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Please describe this audio." },
        {
          "fileData": {
            "mimeType": "audio/mpeg",
            "fileUri": "https://example.com/demo.mp3"
          }
        }
      ]
    }
  ]
}