POST
/
v1beta
/
models
/
{model}
:generateContent
curl -X POST "https://api.example.com/v1beta/models/gemini-2.5-pro:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{"text": "What is the latest news about AI?"}]
      }
    ],
    "tools": [
      {
        "googleSearch": {}
      }
    ]
  }'
Enhanced generation using Google Gemini models combined with Google Search.

Request Parameters

key
string
required
API key.
contents
array
required
Content array.
tools
array
Tools configuration, including Google Search tool.
curl -X POST "https://api.example.com/v1beta/models/gemini-2.5-pro:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{"text": "What is the latest news about AI?"}]
      }
    ],
    "tools": [
      {
        "googleSearch": {}
      }
    ]
  }'