Gemini overview

Get started with @orcushq/gemini, configure a GeminiWeb client, and explore model invocation, streaming, authentication, tools, and structured output.

Installation

Install @orcushq/gemini using your preferred package manager. Node.js 20 or later is required.

Package manager
bash
npm install @orcushq/gemini

Authentication

@orcushq/gemini requires two authentication values to make requests to Gemini Web: session cookies and an XSRF token. Obtain both values from the same signed-in Gemini Web session, configure them through environment variables, and pass them to GeminiWeb as cookies and xsrfToken. Keep your credentials private and out of source control. See Authentication for setup instructions and Find required keys to learn how to obtain these values.

Quick start

Create a GeminiWeb client with your authentication credentials and a supported model ID. Call invoke() with a prompt to receive the generated response and metadata.

src/app.ts
import { GeminiWeb } from '@orcushq/gemini' const model = new GeminiWeb({  model: 'gemini-3.6-flash',  cookies: process.env.GEMINI_COOKIES!,  xsrfToken: process.env.GEMINI_XSRF_TOKEN!,}) const response = await model.invoke(  'Explain closures in one sentence.',) console.log(response.content)console.log(response.finishReason)console.log(response.metadata.modelId)

Available features

  • Model invocation: Send a prompt and receive a generated response.
  • Streaming: Receive generated output incrementally.
  • Batch processing: Submit multiple inputs through the batch interface.
  • Structured output: Request output that follows a defined schema.
  • Tool calling: Use supported tool-calling functionality.
  • Image input: Send images as part of a message where supported.