Google Gemini · Schema

GenerateContentResponse

Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in GenerateContentResponse.prompt_feedback and for each candidate in finishReason and safetyRatings.

Agentic AIArtificial IntelligenceCode GenerationEmbeddingsGenerative AIImage GenerationLLMMachine LearningMultimodal

Properties

Name Type Description
candidates array Candidate responses from the model. There may be multiple candidates if candidateCount was set in the GenerationConfig.
promptFeedback object
usageMetadata object
modelVersion string The model version used to generate the response.
responseId string Unique identifier for the response.
View JSON Schema on GitHub

JSON Schema

google-gemini-generatecontentresponse-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/GenerateContentResponse",
  "title": "GenerateContentResponse",
  "type": "object",
  "description": "Response from the model supporting multiple candidate responses. Safety ratings and content filtering are reported for both prompt in GenerateContentResponse.prompt_feedback and for each candidate in finishReason and safetyRatings.",
  "properties": {
    "candidates": {
      "type": "array",
      "description": "Candidate responses from the model. There may be multiple candidates if candidateCount was set in the GenerationConfig.",
      "items": {
        "$ref": "#/components/schemas/Candidate"
      }
    },
    "promptFeedback": {
      "$ref": "#/components/schemas/PromptFeedback"
    },
    "usageMetadata": {
      "$ref": "#/components/schemas/UsageMetadata"
    },
    "modelVersion": {
      "type": "string",
      "description": "The model version used to generate the response."
    },
    "responseId": {
      "type": "string",
      "description": "Unique identifier for the response."
    }
  }
}