{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sandbase-ai/json-schema/sandbase-ai-gemini-generate-content-request-schema.json",
  "title": "GeminiGenerateContentRequest",
  "description": "Google Gemini GenerateContent request. Native passthrough mappings preserve provider-defined fields; translated mappings use the documented capability subset.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sandbase-ai-openapi.json#/components/schemas/GeminiGenerateContentRequest",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "contents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/GeminiContent"
      }
    },
    "systemInstruction": {
      "$ref": "#/$defs/GeminiContent"
    },
    "generationConfig": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "temperature": {
          "type": "number"
        },
        "topP": {
          "type": "number"
        },
        "topK": {
          "type": "integer"
        },
        "maxOutputTokens": {
          "type": "integer"
        },
        "stopSequences": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "candidateCount": {
          "type": "integer",
          "description": "Translated mappings accept only 1 when supplied; native passthrough mappings preserve the provider request."
        },
        "seed": {
          "type": "integer"
        },
        "presencePenalty": {
          "type": "number"
        },
        "frequencyPenalty": {
          "type": "number"
        },
        "responseMimeType": {
          "type": "string",
          "enum": [
            "text/plain",
            "application/json",
            "text/x.enum"
          ]
        },
        "responseSchema": {
          "type": "object",
          "additionalProperties": true
        },
        "responseModalities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Native image mappings support provider image modalities. Other translated mappings may support TEXT only."
        },
        "thinkingConfig": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "toolConfig": {
      "type": "object",
      "additionalProperties": true
    },
    "safetySettings": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "cachedContent": {
      "type": "string",
      "description": "Passed through when the selected provider supports Gemini context caching."
    }
  },
  "$defs": {
    "GeminiContent": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "user",
            "model"
          ]
        },
        "parts": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "description": "Text, image inlineData, public HTTP(S) image fileData, functionCall, or functionResponse part."
          }
        }
      }
    }
  }
}