POST /v1beta/models/gemini-2.5-pro:generateContent
Method: POSTEndpoint: /v1beta/models/gemini-2.5-pro:generateContent
This section contains endpoint-specific behavior, parameters, or usage notes for this API. This section contains endpoint-specific behavior, parameters, or usage notes for this API.
Request Parameters
Header Parameters
text
Content-Type
string
Required
Example:
application/json
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}Body Parameters application/json
text
contents
array
[object]
Required
parts
array
[object]
Optional
generationConfig
object
Required
thinkingConfig
object
Required
Example
{
"contents"
:
[
{
"parts"
:
[
{
"text"
:
"Explain how AI works in a few words"
}
]
}
]
,
"generationConfig"
:
{
"thinkingConfig"
:
{
"thinkingBudget"
:
128
,
"includeThoughts"
:
true
}
}
}Example Request
Shell
bash
curl --location --request POST '/v1beta/models/gemini-2.5-pro:generateContent' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "Explain how AI works in a few words"
}
]
}
],
"generationConfig": {
"thinkingConfig": {
"thinkingBudget": 128,
"includeThoughts": true
}
}
}'Response
🟢 200 Success
Content Type: application/json
Response Schema
text
objectExample
json
{}