Node.js server runtime · Per-request credentials

Gemini API bridge for
your own credentials

Use your own Gemini cookies through a clean REST API, playground, and normalized bridge layer. Private, secure, and developer-first.

No storage

Zero server-side cookie persistence.

Real-time

Direct bridge to Gemini Reverse Client.

RESTful

Standard JSON and SSE streaming.

The Workflow

How the Bridge Works

Your Credentials

Input your Secure-1PSID cookies per-request.

Bridge Request

Send standard REST requests to our gateway.

Reverse Engine

Bridge instantiates a temporary Gemini client.

Clean Response

Get structured JSON or streaming data back.

Features

Powerful Bridge Capabilities

Chat Completion

Normalized AI responses with classified outputs.

Streaming

Real-time Server Sent Events for progressive UI.

File Input

Natively process documents and images.

Dynamic Models

Automatically discover models on your account.

Account Quota

Monitor your compute usage and credit limits.

Gemini Gems

Apply system prompts with custom Gems.

Deep Research

Autonomous agent for comprehensive web analysis.

History

Manage and retrieve conversation history.

Onboarding

Setup your credentials

Gemini Bridge API operates as a stateless gateway. You must provide your own session cookies to authorize requests. Follow these steps to extract them from your browser.

Go to https://gemini.google.com and log in with your Google account. Ensure you are on the main chat interface and the session is fully active.

Security & Privacy Protocol

Crucial Precautions

  • Cookies are sensitive credentials. Treat them like passwords.

  • Never share your __Secure-1PSID with anyone else.

  • Do not commit these values to version control (Git).

  • This bridge is stateless; cookies are sent per-request.

  • Log out from Google to immediately invalidate any leaked cookies.

Required Request Headers

x-gemini-psid: ••••••••abcd

Required

x-gemini-psidts: ••••••••efgh

Optional

Interactive

API Playground

Request Configuration

Normalized Bridge Console

Run a request to see the Gemini response

Node.js Server Runtime | Per-request Credentials
Stateless Gateway Architecture

Reference

API Documentation

Endpoints

POST
/api/chat

Generate Content

Generate a response from Gemini using a single prompt.

Request Headers
x-gemini-psidRequired

The primary __Secure-1PSID session cookie from gemini.google.com.

x-gemini-psidtsOptional

Recommended for session stability and refresh capability.

Payload Specification
{
  "prompt": "Explain quantum computing in simple terms",
  "model": "gemini-3-flash",
  "temporary": true,
  "extended_thinking": false,
  "gem": null
}
Success Pattern
{
  "success": true,
  "data": { ... },
  "requestId": "uuid-v4",
  "timestamp": "ISO-8601"
}
Error Pattern
{
  "success": false,
  "error": {
    "code": "MISSING_GEMINI_CREDENTIALS",
    "message": "Detailed explanation here"
  },
  "requestId": "uuid-v4",
  "timestamp": "ISO-8601"
}
Standard Error Codes
Error CodeStatusDescription
MISSING_GEMINI_CREDENTIALS401Missing x-gemini-psid header
INVALID_GEMINI_CREDENTIALS401Malformed session cookies
BRIDGE_AUTH_ERROR401Invalid x-bridge-api-key
INVALID_BODY400JSON payload is invalid or missing fields
GEMINI_AUTH_ERROR401Cookies expired or revoked by Google
USAGE_LIMIT_EXCEEDED429Account quota or IP rate limit reached
MODEL_INVALID400Requested model ID is not available
TIMEOUT504Gemini upstream took too long to respond
TEMPORARILY_BLOCKED429IP address flagged for unusual activity
API_ERROR502Unexpected response from Gemini internal API
INTERNAL_ERROR500Bridge server logic failure

Implementation

Code Examples

curl -X POST "https://gemini.miftah.eu.cc/api/chat" \
  -H "Content-Type: application/json" \
  -H "x-gemini-psid: YOUR___SECURE_1PSID" \
  -d '{
    "prompt": "Hello Gemini, explain the bridge pattern",
    "model": "gemini-3-flash",
    "temporary": true
  }'