Gemini AI Studio icon

Gemini AI Studio

Use the Google Gemini API through direct AI Studio REST calls

Actions16

Content → Stream Generate Content

AI-generated

Summary

Stream generated content from the Google Gemini API using a specified Gemini model, receiving incremental text chunks as a streaming response.

Inputs

  • Model (required) — The Gemini model ID or resource name used for content generation, e.g., gemini-3-flash-preview or models/gemini-flash-latest.
  • Input Mode (required) — Choose how to provide input content: Simple Text prompt, structured Contents JSON, or the complete Raw Request JSON.
  • Prompt (required) — The simple text prompt to generate content from (required if Input Mode is Simple Text).
  • Multimodal Parts — Additional binary or file data parts appended to the simple prompt, allowing multimodal input.
  • Contents (JSON) (required) — Structured Gemini contents array supporting text, inlineData, fileData, and roles (used when Input Mode is Contents JSON).
  • Raw Request Body (JSON) (required) — Entire JSON request body sent to the Gemini :generateContent endpoint. Use this for full control beyond exposed fields (used with Raw Request JSON input mode).
  • System Instruction — Optional system instruction text sent as system_instruction.parts[0].text to guide content generation.
  • Options — Collection of advanced generation options including candidate count, temperature, max output tokens, stop sequences, cached content reference, safety settings, tools, and others affecting the generation behavior.

Output shape

a single item containing a JSON object summarizing the streamed content generation, including the concatenated text output, array of incremental text chunks, model used, and raw chunks.

The output JSON includes 'text' (full joined output), 'texts' (array of individual text chunks), 'model' (model identifier), and 'chunks' (raw streaming response events). The operation streams incremental outputs but returns them after completion as a summary object.

Examples

Example 1: Generating streamed text content from a simple prompt

Model set to 'gemini-flash-latest' with Input Mode 'Simple Text' and a brief prompt. Optionally add a system instruction or multimodal data parts. The node streams and collects output text chunks until complete.

Links

Discussion