Skip to main content
Gemini 互換の連携には /v1beta/models/{model}:generateContent を使用します。
パス中の model は APIAny.AI の公開モデル ID です。

ストリーミング

パス中の :generateContent:streamGenerateContent に置き換えると、Gemini の SSE ストリーム (増分の candidates をチャンクごとに返す)を取得できます。

構造化出力

generationConfig.responseMimeType: "application/json"responseSchema と組み合わせると、 JSON 出力が得られます:

パラメータ

対応している generationConfigtemperaturetopPtopKmaxOutputTokensstopSequencesresponseMimeTyperesponseSchemaresponseModalitiesIMAGE を含めると画像を返します)。さらにトップレベルの tools(functionDeclarations)と systemInstruction にも対応しています。