curl --request POST \
--url https://model-api.skyengine.com.cn/v1beta/models/{model}:streamGenerateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"parts": [
{
"text": "请详细介绍人工智能的未来发展趋势"
}
]
}
]
}
'{
"candidates": [
{
"content": {
"parts": [
{
"text": "你好,请介绍一下你自己"
}
],
"role": "user"
},
"finishReason": "FINISH_REASON_UNSPECIFIED",
"index": 123,
"safetyRatings": [
{
"category": "<string>",
"probability": "HARM_PROBABILITY_UNSPECIFIED",
"blocked": true
}
],
"citationMetadata": {
"citationSources": [
{
"startIndex": 123,
"endIndex": 123,
"uri": "<string>",
"license": "<string>"
}
]
},
"tokenCount": 123
}
],
"promptFeedback": {
"blockReason": "BLOCK_REASON_UNSPECIFIED",
"safetyRatings": [
{
"category": "<string>",
"probability": "HARM_PROBABILITY_UNSPECIFIED",
"blocked": true
}
]
},
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123,
"cachedContentTokenCount": 123
},
"modelVersion": "gemini-2.5-flash"
}Gemini接口
streamGenerateContent
使用指定模型流式生成内容
POST
/
v1beta
/
models
/
{model}
:streamGenerateContent
curl --request POST \
--url https://model-api.skyengine.com.cn/v1beta/models/{model}:streamGenerateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"parts": [
{
"text": "请详细介绍人工智能的未来发展趋势"
}
]
}
]
}
'{
"candidates": [
{
"content": {
"parts": [
{
"text": "你好,请介绍一下你自己"
}
],
"role": "user"
},
"finishReason": "FINISH_REASON_UNSPECIFIED",
"index": 123,
"safetyRatings": [
{
"category": "<string>",
"probability": "HARM_PROBABILITY_UNSPECIFIED",
"blocked": true
}
],
"citationMetadata": {
"citationSources": [
{
"startIndex": 123,
"endIndex": 123,
"uri": "<string>",
"license": "<string>"
}
]
},
"tokenCount": 123
}
],
"promptFeedback": {
"blockReason": "BLOCK_REASON_UNSPECIFIED",
"safetyRatings": [
{
"category": "<string>",
"probability": "HARM_PROBABILITY_UNSPECIFIED",
"blocked": true
}
]
},
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123,
"cachedContentTokenCount": 123
},
"modelVersion": "gemini-2.5-flash"
}Authorizations
ModelHub API密钥认证。在 Authorization HTTP Header 中包含您的 API-Key,格式为 Bearer {API_KEY}
Path Parameters
模型名称,如 gemini-2.5-flash
Example:
"gemini-2.5-flash"
Body
application/json
输入内容列表,表示对话历史
Show child attributes
Show child attributes
Example:
[{ "parts": [{ "text": "你好,请介绍一下你自己" }] }]
可用的工具列表
Show child attributes
Show child attributes
工具配置选项
Show child attributes
Show child attributes
安全设置
Show child attributes
Show child attributes
系统指令
Show child attributes
Show child attributes
生成配置参数
Show child attributes
Show child attributes

