{
"contents": [
{
"parts": [
{
"text": "列出几种流行的曲奇饼干食谱,并包含配料用量。"
}
]
}
],
"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 -g --request POST 'http://api.example.com/v1beta/models/gemini-2.5-flash:generateContent?key=sk-xxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "列出几种流行的曲奇饼干食谱,并包含配料用量。"
}
]
}
],
"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": {
"role": "model",
"parts": [
{
"text": "[\n {\n \"recipeName\": \"经典巧克力曲奇\",\n \"ingredients\": [\n \"115克 无盐黄油,室温软化\",\n \"150克 红糖\",\n \"50克 细砂糖\",\n \"1个 大鸡蛋\",\n \"1茶匙 香草精\",\n \"190克 中筋面粉\",\n \"1/2茶匙 小苏打\",\n \"1/4茶匙 盐\",\n \"150克 巧克力豆\"\n ]\n },\n {\n \"recipeName\": \"燕麦葡萄干曲奇\",\n \"ingredients\": [\n \"115克 无盐黄油,室温软化\",\n \"100克 红糖\",\n \"50克 细砂糖\",\n \"1个 大鸡蛋\",\n \"1茶匙 香草精\",\n \"120克 中筋面粉\",\n \"1/2茶匙 小苏打\",\n \"1/2茶匙 肉桂粉\",\n \"1/4茶匙 盐\",\n \"150克 老式燕麦片\",\n \"100克 葡萄干\"\n ]\n },\n {\n \"recipeName\": \"花生酱曲奇\",\n \"ingredients\": [\n \"115克 无盐黄油,室温软化\",\n \"100克 花生酱\",\n \"100克 红糖\",\n \"100克 细砂糖\",\n \"1个 大鸡蛋\",\n \"1茶匙 香草精\",\n \"150克 中筋面粉\",\n \"1茶匙 小苏打\",\n \"1/4茶匙 盐\"\n ]\n }\n]"
}
]
},
"finishReason": "STOP",
"avgLogprobs": -0.16219970554981417
}
],
"usageMetadata": {
"promptTokenCount": 30,
"candidatesTokenCount": 412,
"totalTokenCount": 1281,
"trafficType": "ON_DEMAND",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 30
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 412
}
],
"thoughtsTokenCount": 839
},
"modelVersion": "gemini-2.5-flash",
"createTime": "2025-11-29T14:39:44.101329Z",
"responseId": "sAUradGXBp6O998PlfbTuQU"
}