Maisi-AI API Doc
首页全部OpenAI语言模型
图像模型视频模型音频模型
首页全部OpenAI语言模型
图像模型视频模型音频模型
  1. Gemini
  • Claude
    • Anthropic Messages
      POST
  • OpenAI
    • Chat聊天接口
      POST
    • Response
      POST
  • Gemini
    • 聊天接口(非流)
      POST
    • 聊天接口(流式)
      POST
  1. Gemini

聊天接口(流式)

POST
/gemini/v1beta/models/{mode}:streamGenerateContent
由于Gemini字段命名混淆,蛇形以及小驼峰都可以使用, 本平台约定:仅使用小驼峰字段
接口有滞后性,最新文档请参考官方文档:
https://ai.google.dev/api/generate-content#method:-models.generatecontent

请求参数

Path 参数

Header 参数

Body 参数application/json必填

示例

返回响应

🟢200成功
application/json
Body

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/gemini/v1beta/models/:streamGenerateContent' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "contents": [
        {
            "parts": [
                {
                    "codeExecutionResult": {},
                    "executableCode": {},
                    "functionCall": {
                        "name": "string"
                    },
                    "functionResponse": {
                        "name": "string",
                        "response": {
                            "content": "string",
                            "name": "string"
                        }
                    },
                    "inlineData": {
                        "data": "string",
                        "mime_type": "string"
                    },
                    "text": "string",
                    "thought": true,
                    "thoughtSignature": "string"
                }
            ],
            "role": "model"
        }
    ],
    "generationConfig": {
        "maxOutputTokens": 0,
        "responseMimeType": "string",
        "responseModalities": [
            "AUDIO"
        ],
        "responseSchema": {
            "items": {
                "properties": {
                    "recipe_name": {
                        "type": "string"
                    }
                },
                "type": "string"
            },
            "type": "string"
        },
        "speechConfig": {
            "languageCode": "string",
            "multiSpeakerVoiceConfig": {
                "speakerVoiceConfigs": [
                    {
                        "speaker": "string",
                        "voiceConfig": {
                            "prebuiltVoiceConfig": {
                                "voiceName": "string"
                            }
                        }
                    }
                ]
            },
            "voiceConfig": {
                "prebuiltVoiceConfig": {
                    "voiceName": "string"
                }
            }
        },
        "stopSequences": [
            "string"
        ],
        "temperature": 0,
        "thinkingConfig": {
            "includeThoughts": true,
            "thinkingBudget": 0
        },
        "topK": 0,
        "topP": 0
    },
    "safetySettings": [
        {}
    ],
    "system_instruction": {
        "parts": {
            "text": "string"
        }
    },
    "tool_config": {
        "functionCallingConfig": {
            "allowedFunctionNames": [
                "string"
            ],
            "mode": "string"
        }
    },
    "tools": [
        {
            "codeExecution": {},
            "functionDeclarations": [
                {
                    "description": "string",
                    "name": "string",
                    "parameters": {
                        "properties": {
                            "rgb_hex": {
                                "description": "string",
                                "type": "string"
                            }
                        },
                        "required": [
                            "string"
                        ],
                        "type": "string"
                    }
                }
            ],
            "googleSearch": {}
        }
    ]
}'
响应示例响应示例
{}
修改于 2026-04-15 09:27:44
上一页
聊天接口(非流)
Built with