cURL
curl --request POST \ --url https://www.anyfast.ai/v1beta/models/gemini-2.5-flash:generateContent \ --header 'Content-Type: application/json' \ --data ' { "contents": [ { "role": "user", "parts": [ { "text": "What is the weather in Chongqing today?" } ] } ], "tools": [ { "googleSearch": {} } ] } '
{ "candidates": [ { "content": { "parts": [ { "text": "Based on search results, the weather in Chongqing today..." } ], "role": "model" }, "finishReason": "STOP", "groundingMetadata": { "searchEntryPoint": {}, "groundingChunks": [ {} ] } } ], "usageMetadata": { "promptTokenCount": 123, "candidatesTokenCount": 123, "totalTokenCount": 123 } }
Generate response using Gemini model with Google Search grounding.
API Key
Array of conversation contents.
Show child attributes
[ { "role": "user", "parts": [ { "text": "What is the weather in Chongqing today?" } ] } ]
Tool configuration to enable Google Search.
[{ "googleSearch": {} }]
Response generated successfully