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
Requiredx-gemini-psidts: ••••••••efgh
OptionalInteractive
API Playground
Request Configuration
Reference
API Documentation
Endpoints
/api/chatGenerate Content
Generate a response from Gemini using a single prompt.
Request Headers
x-gemini-psidRequiredThe primary __Secure-1PSID session cookie from gemini.google.com.
x-gemini-psidtsOptionalRecommended 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 Code | Status | Description |
|---|---|---|
| MISSING_GEMINI_CREDENTIALS | 401 | Missing x-gemini-psid header |
| INVALID_GEMINI_CREDENTIALS | 401 | Malformed session cookies |
| BRIDGE_AUTH_ERROR | 401 | Invalid x-bridge-api-key |
| INVALID_BODY | 400 | JSON payload is invalid or missing fields |
| GEMINI_AUTH_ERROR | 401 | Cookies expired or revoked by Google |
| USAGE_LIMIT_EXCEEDED | 429 | Account quota or IP rate limit reached |
| MODEL_INVALID | 400 | Requested model ID is not available |
| TIMEOUT | 504 | Gemini upstream took too long to respond |
| TEMPORARILY_BLOCKED | 429 | IP address flagged for unusual activity |
| API_ERROR | 502 | Unexpected response from Gemini internal API |
| INTERNAL_ERROR | 500 | Bridge server logic failure |
Implementation
Code Examples