Request
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
Body Params application/json
{
"contents": [
{
"role": "user",
"parts": [
{"text": "今天重庆天气如何?"}
]
}
],
"tools": [
{
"googleSearch": {}
}
]
}
Request Code Samples
curl --location --globoff '/v1beta/models/gemini-2.5-flash:generateContent?key=' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"contents": [
{
"role": "user",
"parts": [
{"text": "今天重庆天气如何?"}
]
}
],
"tools": [
{
"googleSearch": {}
}
]
}'
Responses
application/json
Modified at 2026-03-30 11:39:32