// https://ai.google.dev/api/generate-content?hl=zh-cn#text
{
"model": "gemini-2.0-flash",
"cached_content": "cached content",
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello, please introduce yourself"
}
]
}
],
"system_instruction": {
"role": "system",
"parts": [
{
"text": "You are a helpful AI assistant"
}
]
},
"tools": [],
"safety_settings": [
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
}
],
"generation_config": {
"thinking_config": {
"include_thoughts": false,
"thinking_budget": 1000
},
"max_output_tokens": 4096,
"response_modalities": null,
"temperature": 1.8,
"top_p": 0.8,
"top_k": 40,
"candidate_count": 1,
"presence_penalty": 0.0,
"frequency_penalty": 0.0,
"stop_sequences": [
"END",
"STOP"
],
"response_mime_type": "text/plain",
"response_schema": null,
"seed": 12345,
"response_logprobs": false,
"logprobs": null,
"audio_timestamp": false
},
"stream": false,
"labels": {
"user_id": "12345",
"session_id": "session_001"
}
}
curl --location --request POST 'https://gptproto.com/v1beta/models/:streamGenerateContent?key=sk-*******************' \
--header 'Content-Type: application/json' \
--data-raw '// https://ai.google.dev/api/generate-content?hl=zh-cn#text
{
"model": "gemini-2.0-flash",
"cached_content": "cached content",
"contents": [
{
"role": "user",
"parts": [
{
"text": "Hello, please introduce yourself"
}
]
}
],
"system_instruction": {
"role": "system",
"parts": [
{
"text": "You are a helpful AI assistant"
}
]
},
"tools": [],
"safety_settings": [
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
}
],
"generation_config": {
"thinking_config": {
"include_thoughts": false,
"thinking_budget": 1000
},
"max_output_tokens": 4096,
"response_modalities": null,
"temperature": 1.8,
"top_p": 0.8,
"top_k": 40,
"candidate_count": 1,
"presence_penalty": 0.0,
"frequency_penalty": 0.0,
"stop_sequences": [
"END",
"STOP"
],
"response_mime_type": "text/plain",
"response_schema": null,
"seed": 12345,
"response_logprobs": false,
"logprobs": null,
"audio_timestamp": false
},
"stream": false,
"labels": {
"user_id": "12345",
"session_id": "session_001"
}
}'
{
"candidates": [
{
object (Candidate)
}
],
"promptFeedback": {
object (PromptFeedback)
},
"usageMetadata": {
object (UsageMetadata)
},
"modelVersion": string,
"responseId": string
}