Skip to main content
使用 /v1beta/models/{model}:generateContent 调用 Gemini 兼容接口。
路径中的 model 是 APIAny.AI 的公开模型 ID。

流式

把路径里的 :generateContent 换成 :streamGenerateContent,即可获得 Gemini SSE 流(逐块返回增量 candidates)。

结构化输出

generationConfig.responseMimeType: "application/json" 配合 responseSchema 得到 JSON 输出:

参数

支持 generationConfigtemperaturetopPtopKmaxOutputTokensstopSequencesresponseMimeTyperesponseSchemaresponseModalities (含 IMAGE 时返回图片)。另支持顶层 tools(functionDeclarations)与 systemInstruction