本文档由帆智引擎整理发布,推荐使用 Apifox - API 文档、API 调试、API Mock、API 自动化测试!
Authorization: Bearer ********************{
"contents": [
{
"role": "user",
"parts": [
{
"text": "1+2+3+4+5+....+999?"
}
]
}
],
"systemInstruction": {
"role": "user",
"parts": [
{
"text": "hi"
}
]
},
"safetySettings": [
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_CIVIC_INTEGRITY",
"threshold": "BLOCK_NONE"
}
],
"tools": [],
"generationConfig": {
"temperature": 1,
"topP": 1,
"thinkingConfig": {
"includeThoughts": true,
"thinkingBudget": 26240
}
}
}curl --location -g --request POST '/v1beta/models/gemini-2.5-pro:streamGenerateContent?key={{YOUR_API_KEY}}&alt=sse' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"role": "user",
"parts": [
{
"text": "1+2+3+4+5+....+999?"
}
]
}
],
"systemInstruction": {
"role": "user",
"parts": [
{
"text": "hi"
}
]
},
"safetySettings": [
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "OFF"
},
{
"category": "HARM_CATEGORY_CIVIC_INTEGRITY",
"threshold": "BLOCK_NONE"
}
],
"tools": [],
"generationConfig": {
"temperature": 1,
"topP": 1,
"thinkingConfig": {
"includeThoughts": true,
"thinkingBudget": 26240
}
}
}'{}
扫码添加微信客服
关于帆智引擎api对接问题,可以随时咨询即可。

扫码添加微信客服