Maisi-AI API Doc
首页全部
OpenAI语言模型图像模型视频模型音频模型
首页全部
OpenAI语言模型图像模型视频模型音频模型
  1. Gemini
  • 语言模型
    • Claude
      • Anthropic Messages
    • OpenAI
      • Chat聊天
      • Response
    • Gemini
      • 聊天接口(非流)
        POST
      • 聊天接口(流式)
        POST
  • 图像模型
    • Gpt-image2图像
      • 生成图像
      • 图片编辑
    • Midjourney绘图
      • 任务提交
        • 提交Imagine任务
        • 提交Action任务
        • 提交Blend任务
        • 提交Modal任务
        • 提交Describe任务
        • 提交Shorten任务
        • 提交SwapFace任务
        • 提交Video任务
        • 上传文件到discord
      • 任务查询
        • 指定id查询任务
        • 指定id列表查询任务
        • 获取任务图片的seed
    • Nano Banana生图
      • 官方格式(文生图)
      • 官方格式(图生图)
  • 视频模型
    • 国产视频模型说明文档
    • Grok-video视频
      • Grok提交视频生成
      • Grok查询任务状态
      • Grok下载视频接口
    • Seedance-2.0视频
      • SeeDance2系列视频生成说明
      • 文生视频
      • 首尾帧生成视频
      • 多图参考生成
      • 多模态视频生成
      • 官方格式参数生成
      • 查询视频生成结果
  • 音频模型
  • 平台接口
  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
Bodyapplication/json

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/gemini/v1beta/models/:streamGenerateContent' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data '{
    "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