header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params
Header Params
Body Params application/json
Example
{"contents":[{"role":"user","parts":[{"text":"What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50."}]}],"tools":[{"codeExecution":{}}]}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--globoff'/v1beta/models/gemini-2.5-pro:generateContent?key=' \
--header'Authorization: Bearer <token>' \
--header'Content-Type: application/json' \
--data'{
"contents": [
{
"role": "user",
"parts": [
{"text": "What is the sum of the first 50 prime numbers? Generate and run code for the calculation, and make sure you get all 50."}
]
}
],
"tools": [
{
"codeExecution": {}
}
]
}'