{
"contents": [{
"parts":[
{ "text": "List a few popular cookie recipes, and include the amounts of ingredients." }
]
}],
"generationConfig": {
"responseMimeType": "application/json",
"responseSchema": {
"type": "ARRAY",
"items": {
"type": "OBJECT",
"properties": {
"recipeName": { "type": "STRING" },
"ingredients": {
"type": "ARRAY",
"items": { "type": "STRING" }
}
},
"propertyOrdering": ["recipeName", "ingredients"]
}
}
}
}
curl --location --request POST '/v1beta/models/:generateContent' \
--header 'x-goog-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [{
"parts":[
{ "text": "List a few popular cookie recipes, and include the amounts of ingredients." }
]
}],
"generationConfig": {
"responseMimeType": "application/json",
"responseSchema": {
"type": "ARRAY",
"items": {
"type": "OBJECT",
"properties": {
"recipeName": { "type": "STRING" },
"ingredients": {
"type": "ARRAY",
"items": { "type": "STRING" }
}
},
"propertyOrdering": ["recipeName", "ingredients"]
}
}
}
}'
{
"candidates": [
{
"content": {
"parts": [
{
"text": "[\n {\n \"recipeName\": \"Classic Chocolate Chip Cookies\",\n \"ingredients\": [\n \"2 1/4 cups all-purpose flour\",\n \"1 teaspoon baking soda\",\n \"1 teaspoon salt\",\n \"1 cup (2 sticks) unsalted butter, softened\",\n \"3/4 cup granulated sugar\",\n \"3/4 cup packed light brown sugar\",\n \"1 teaspoon vanilla extract\",\n \"2 large eggs\",\n \"2 cups (12 oz) semi-sweet chocolate chips\"\n ]\n },\n {\n \"recipeName\": \"Hearty Oatmeal Raisin Cookies\",\n \"ingredients\": [\n \"1 1/2 cups all-purpose flour\",\n \"1 teaspoon baking soda\",\n \"1 teaspoon ground cinnamon\",\n \"1/2 teaspoon salt\",\n \"1 cup (2 sticks) unsalted butter, softened\",\n \"1 cup packed light brown sugar\",\n \"1/2 cup granulated sugar\",\n \"1 teaspoon vanilla extract\",\n \"2 large eggs\",\n \"3 cups old-fashioned rolled oats\",\n \"1 1/2 cups raisins\"\n ]\n },\n {\n \"recipeName\": \"Classic Peanut Butter Cookies\",\n \"ingredients\": [\n \"1 1/4 cups all-purpose flour\",\n \"1/2 teaspoon baking soda\",\n \"1/4 teaspoon salt\",\n \"1/2 cup (1 stick) unsalted butter, softened\",\n \"1/2 cup granulated sugar\",\n \"1/2 cup packed light brown sugar\",\n \"1 large egg\",\n \"1 teaspoon vanilla extract\",\n \"1 cup creamy peanut butter\"\n ]\n }\n]"
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0
}
],
"usageMetadata": {
"promptTokenCount": 15,
"candidatesTokenCount": 390,
"totalTokenCount": 970,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 15
}
],
"thoughtsTokenCount": 565
},
"modelVersion": "gemini-2.5-flash",
"responseId": "1OG6aKq3NMKzqtsP5Omk-Q0"
}