Docs Native format /v1beta/models/gemini-2.5-pro:streamGenerateContent
API reference

Text generation + thinking-flow

Official documentation: https://ai.google.dev/gemini-api/docs/text-generation?hl=zh-cnmulti-turn-conversations

POST/v1beta/models/gemini-2.5-pro:streamGenerateContent

Body Parametersapplication/json

contents* array

List of content (multi-turn / multi-modal)

items
object object

Responses

200 application/json
response-200 object
400 Bad request or validation failed application/json
response-400 object
properties
error* object
401 Missing or invalid API Key application/json
response-401 object
Request Body Example
1{
2"contents": [
3{
4"parts": [
5{
6"text": "1+2+3+4+5+....+999?"
7}
8],
9"role": "user"
10}
11],
12"generationConfig": {
13"temperature": 1,
14"thinkingConfig": {
15"includeThoughts": true,
16"thinkingBudget": 26240
17},
18"topP": 1
19},
20"safetySettings": [
21{
22"category": "HARM_CATEGORY_HATE_SPEECH",
23"threshold": "OFF"
24},
25{
26"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
27"threshold": "OFF"
28},
29{
30"category": "HARM_CATEGORY_HARASSMENT",
31"threshold": "OFF"
32},
33{
34"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
35"threshold": "OFF"
36},
37{
38"category": "HARM_CATEGORY_CIVIC_INTEGRITY",
39"threshold": "BLOCK_NONE"
40}
41],
42"systemInstruction": {
43"parts": [
44{
45"text": "hi"
46}
47],
48"role": "user"
49},
50"tools": []
51}
Code Sample cURL
1curl -X POST "https://api.digislash.com/v1beta/models/gemini-2.5-pro:streamGenerateContent" \
2-H "Authorization: Bearer <API Key>" \
3-H "Content-Type: application/json" \
4-d '{
5"contents": [
6{
7"parts": [
8{
9"text": "1+2+3+4+5+....+999?"
10}
11],
12"role": "user"
13}
14],
15"generationConfig": {
16"temperature": 1,
17"thinkingConfig": {
18"includeThoughts": true,
19"thinkingBudget": 26240
20},
21"topP": 1
22},
23"safetySettings": [
24{
25"category": "HARM_CATEGORY_HATE_SPEECH",
26"threshold": "OFF"
27},
28{
29"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
30"threshold": "OFF"
31},
32{
33"category": "HARM_CATEGORY_HARASSMENT",
34"threshold": "OFF"
35},
36{
37"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
38"threshold": "OFF"
39},
40{
41"category": "HARM_CATEGORY_CIVIC_INTEGRITY",
42"threshold": "BLOCK_NONE"
43}
44],
45"systemInstruction": {
46"parts": [
47{
48"text": "hi"
49}
50],
51"role": "user"
52},
53"tools": []
54}'
Response
1▼{
2"id": "resp_example",
3"object": "response",
4"status": "completed"
5}