Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

LemonData supports the native Google Gemini API format for Gemini models. This allows direct compatibility with Google AI SDKs.

Path Parameters

model
string
required
Model name (e.g., gemini-2.5-pro, gemini-2.5-flash).

Query Parameters

key
string
API key (alternative to header authentication).

Authentication

Gemini endpoints support multiple authentication methods:
  • ?key=YOUR_API_KEY query parameter
  • x-goog-api-key: YOUR_API_KEY header
  • Authorization: Bearer YOUR_API_KEY header

Request Body

contents
array
required
Conversation contents.Each content object contains:
  • role (string): user or model
  • parts (array): Content parts. LemonData supports:
    • text parts: { "text": "..." }
    • inline media parts: inlineData / inline_data
    • URL-based file parts: fileData / file_data
For media parts, LemonData currently accepts image, audio, and video MIME types and forwards them through the Gemini-compatible public contract. 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.
systemInstruction
object
System instruction for the model.
generationConfig
object
Generation configuration:
  • temperature (number): Sampling temperature
  • topP (number): Nucleus sampling probability
  • topK (integer): Top-K sampling
  • maxOutputTokens (integer): Maximum output tokens
  • stopSequences (array): Stop sequences
safetySettings
array
Safety filter settings.

Response

candidates
array
Generated content candidates.
usageMetadata
object
Token usage information.
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
    }
  }'

Vision Input Example

For Gemini multimodal requests, place media inside contents[].parts[] using either inline bytes or URL-based file references. Supported media categories in the public Gemini contract:
  • image
  • audio
  • video
For inline media, use either inlineData or inline_data and pass Base64-encoded file bytes. For URL-based media, use either fileData or file_data and pass a public https URL.

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"
          }
        }
      ]
    }
  ]
}

Image Input Example

Use inline image bytes:
{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Please describe this image." },
        {
          "inlineData": {
            "mimeType": "image/jpeg",
            "data": "/9j/4AAQSkZJRgABAQ..."
          }
        }
      ]
    }
  ]
}
Use an image URL:
{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Please describe this image." },
        {
          "fileData": {
            "mimeType": "image/jpeg",
            "fileUri": "https://example.com/demo.jpg"
          }
        }
      ]
    }
  ]
}

Audio Input Example

Use an audio URL:
{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Transcribe and summarize this audio." },
        {
          "file_data": {
            "mime_type": "audio/mpeg",
            "file_uri": "https://example.com/sample.mp3"
          }
        }
      ]
    }
  ]
}

Video Input Example

Use a video URL:
{
  "contents": [
    {
      "role": "user",
      "parts": [
        { "text": "Describe this video briefly." },
        {
          "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
  }
}