Skip to main content
Use /v1beta/models/{model}:generateContent for Gemini-compatible integrations.
The path model is a public APIAny.AI model ID.

Streaming

Call :streamGenerateContent instead of :generateContent to receive a Gemini server-sent event stream of incremental candidates chunks.

Structured output

Use generationConfig.responseMimeType: "application/json" with responseSchema for JSON output:

Parameters

Supported generationConfig: temperature, topP, topK, maxOutputTokens, stopSequences, responseMimeType, responseSchema, responseModalities (include IMAGE for image output). Also top-level tools (functionDeclarations) and systemInstruction.