gemini api v2.0.0
A powerful API wrapper for Google's Gemini AI via gemini-webapi. Access advanced language models, multi-turn conversations, thinking mode, image generation, and Google extensions through a simple REST interface.
authentication
API endpoints use X-API-Key header authentication. Admin endpoints use HTTP Basic Auth.
api key authentication
admin panel auth
base configuration
Quick Start Example
# Ask Gemini a question curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Explain quantum computing", "model": "gemini-2.5-flash"}'
endpoint reference
Complete reference of all available API endpoints, organized by authentication requirement.
// public endpoints (no auth required)
HTTP 302 redirect to /info.html
curl https://api5.exploit.bot/status
{
"status": "operational",
"version": "2.0.0",
"authenticated": true
}
curl https://api5.exploit.bot/auth/status
curl https://api5.exploit.bot/models
{
"models": [
"gemini-2.5-flash",
"gemini-2.5-pro",
"gemini-3.0-pro"
],
"default": "gemini-2.5-flash"
}
curl https://api5.exploit.bot/extensions
curl https://api5.exploit.bot/features
Serves this comprehensive API documentation page.
Interactive Swagger UI for exploring and testing API endpoints.
// protected endpoints (X-API-Key: eric required)
| header | value | required |
|---|---|---|
| Content-Type | application/json |
required |
| X-API-Key | eric |
required |
| parameter | type | required | description |
|---|---|---|---|
| message | string | required | The message or prompt to send to Gemini |
| model | string | optional | Model to use (default: gemini-2.5-flash) |
curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Explain quantum computing", "model": "gemini-2.5-flash"}'
{
"status": "success",
"response": "Quantum computing is a type of computation...",
"thoughts": "Let me explain quantum computing concepts...",
"images": [],
"conversation_id": "conv_abc123xyz",
"model": "gemini-2.5-flash"
}
| header | value | required |
|---|---|---|
| Content-Type | application/json |
required |
| X-API-Key | eric |
required |
| parameter | type | required | description |
|---|---|---|---|
| message | string | required | The message or prompt to send to Gemini |
| model | string | optional | Model to use (default: gemini-2.5-flash) |
data: {"token": "Hello"}
data: {"token": " "}
data: {"token": "world!"}
data: {"done": true}
curl -N -X POST https://api5.exploit.bot/ask/stream \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Tell me a joke"}'
const response = await fetch('https://api5.exploit.bot/ask/stream', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'eric' }, body: JSON.stringify({ message: 'Hello' }) }); const reader = response.body.getReader(); const decoder = new TextDecoder(); while (true) { const { value, done } = await reader.read(); if (done) break; const chunk = decoder.decode(value); const lines = chunk.split('\n'); for (const line of lines) { if (line.startsWith('data: ')) { const data = JSON.parse(line.slice(6)); if (data.token) process.stdout.write(data.token); if (data.done) console.log('\n[Stream complete]'); } } }
import requests response = requests.post( 'https://api5.exploit.bot/ask/stream', headers={'X-API-Key': 'eric', 'Content-Type': 'application/json'}, json={'message': 'Hello'}, stream=True ) for line in response.iter_lines(): if line: line = line.decode('utf-8') if line.startswith('data: '): import json data = json.loads(line[6:]) if 'token' in data: print(data['token'], end='', flush=True) if data.get('done'): print('\n[Done]')
- The complete response is received from Gemini first
- Response is then split into words and delivered via SSE
- Expect an initial delay before tokens start appearing (while Gemini processes the request)
- For real token-by-token streaming, an official Gemini API key is required
| header | value | required |
|---|---|---|
| Content-Type | application/json |
required |
| X-API-Key | eric |
required |
| parameter | type | required | description |
|---|---|---|---|
| message | string | required | Your message in the conversation |
| conversation_id | string | optional | ID to continue an existing conversation |
| model | string | optional | Model to use (default: gemini-2.5-flash) |
curl -X POST https://api5.exploit.bot/chat \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "What is the capital of France?"}'
curl -X POST https://api5.exploit.bot/chat \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "What is its population?", "conversation_id": "conv_abc123xyz"}'
{
"status": "success",
"response": "The capital of France is Paris.",
"thoughts": null,
"images": [],
"conversation_id": "conv_abc123xyz",
"model": "gemini-2.5-flash"
}
| parameter | type | description |
|---|---|---|
| conversation_id | string | The ID of the conversation to delete |
curl -X DELETE https://api5.exploit.bot/chat/conv_abc123xyz \ -H "X-API-Key: eric"
curl https://api5.exploit.bot/chat/active \ -H "X-API-Key: eric"
// admin endpoints (Basic Auth: admin:jinho2310)
Requires HTTP Basic Auth with username admin and password jinho2310
Requires HTTP Basic Auth with username admin and password jinho2310
Submit cookies obtained from gemini.google.com to authenticate the API backend.
Sends a test message to verify the Gemini connection is working correctly.
Reinitialize the gemini-webapi client with current cookies. Useful after updating cookies or recovering from errors.
Web interface for viewing and filtering API request logs. Shows request details including method, path, status, duration, and timestamps.
| parameter | type | required | description |
|---|---|---|---|
| limit | integer | optional | Maximum number of log entries to return (default: 100) |
{
"logs": [
{
"timestamp": "2024-01-15T10:30:00Z",
"method": "POST",
"path": "/ask",
"status_code": 200,
"duration_ms": 1523,
"client_ip": "192.168.1.1"
}
],
"total": 1
}
available models
Choose the right model for your use case. All models support 1M token context (1,048,576 tokens input, 65,536 tokens output).
| model code | name | description | capabilities |
|---|---|---|---|
| gemini-2.5-flash DEFAULT | Gemini 2.5 Flash | Fast & efficient, 1M context | text images video audio thinking code_execution search_grounding |
| gemini-2.5-pro | Gemini 2.5 Pro | Advanced thinking, best for code/math | text images video audio thinking code_execution search_grounding |
| gemini-3.0-pro | Gemini 3 Pro | Most intelligent, best multimodal | text images video audio thinking code_execution search_grounding |
| unspecified | Default Model | Uses Gemini's default (currently 2.5 Flash) | text images video audio thinking code_execution search_grounding |
βΈ Model Capabilities (ALL models)
# Default model (2.5 Flash) curl -s -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Hello!"}' | jq # Gemini 3 Pro (most intelligent) curl -s -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Complex question", "model": "gemini-3.0-pro"}' | jq # Gemini 2.5 Pro (best for code) curl -s -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Write Python code", "model": "gemini-2.5-pro"}' | jq
gemini extensions
Use @ prefix in your messages to invoke Google extensions for enhanced functionality.
# Search YouTube curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "@YouTube find tutorials on Python machine learning"}' # Search Google Maps curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "@Google Maps find coffee shops near Times Square"}' # Search for flights curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "@Google Flights find flights from NYC to LA next week"}'
features
Key capabilities of the Gemini API wrapper.
Multi-turn Conversations
Maintain conversation context across multiple messages using conversation_id. Perfect for chatbots and interactive applications.
Thinking/Reasoning Mode
Models can show their reasoning process. The thinking process is returned in the 'thoughts' field of responses.
Image Generation
Ask Gemini to "generate an image of..." and receive generated images. Works best with gemini-3.0-pro model.
Google Extensions
Access YouTube, Gmail, Maps, Drive, Flights, and Hotels using @ prefix in your messages.
1M Token Context
All models support up to 1 million token context window via gemini-webapi for handling large documents.
Code Execution
gemini-2.5-pro can execute code to solve problems, run calculations, and test solutions.
error codes
Common error responses and their solutions.
Bad Request
Missing required field, invalid model name, or malformed request body.
message field and uses a valid model name.
Unauthorized
Missing or invalid API key, or Gemini authentication error.
X-API-Key: eric header.
Not Found
The requested endpoint or resource does not exist.
Internal Server Error
An unexpected error occurred on the server.
/status endpoint and retry after a moment.
Gateway Timeout
The request took too long to complete.
gemini-2.5-flash.
code examples
Ready-to-use examples in different languages.
import requests # API configuration BASE_URL = "https://api5.exploit.bot" API_KEY = "eric" # Headers with API key headers = { "Content-Type": "application/json", "X-API-Key": API_KEY } # Single message with /ask response = requests.post( f"{BASE_URL}/ask", headers=headers, json={ "message": "Explain quantum computing", "model": "gemini-2.5-flash" } ) data = response.json() print("Response:", data["response"]) if data.get("thoughts"): print("Thoughts:", data["thoughts"]) # Multi-turn conversation with /chat chat_response = requests.post( f"{BASE_URL}/chat", headers=headers, json={"message": "What is the capital of France?"} ) conv_id = chat_response.json()["conversation_id"] # Continue the conversation follow_up = requests.post( f"{BASE_URL}/chat", headers=headers, json={ "message": "What is its population?", "conversation_id": conv_id } ) print(follow_up.json()["response"])
const BASE_URL = 'https://api5.exploit.bot'; const API_KEY = 'eric'; async function askGemini(message, model = 'gemini-2.5-flash') { const response = await fetch(`${BASE_URL}/ask`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY }, body: JSON.stringify({ message, model }) }); return response.json(); } async function chat(message, conversationId = null) { const body = { message }; if (conversationId) body.conversation_id = conversationId; const response = await fetch(`${BASE_URL}/chat`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY }, body: JSON.stringify(body) }); return response.json(); } // Usage examples askGemini('Explain quantum computing') .then(data => { console.log(data.response); if (data.thoughts) console.log('Thoughts:', data.thoughts); }); // Multi-turn conversation chat('What is Python?') .then(data => chat('Show me an example', data.conversation_id)) .then(data => console.log(data.response));
# Check service status (public) curl https://api5.exploit.bot/status # List available models (public) curl https://api5.exploit.bot/models # List extensions (public) curl https://api5.exploit.bot/extensions # Single message (requires X-API-Key) curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Hello, Gemini!", "model": "gemini-2.5-flash"}' # Start a conversation curl -X POST https://api5.exploit.bot/chat \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "What is the capital of Japan?"}' # Continue conversation (use conversation_id from previous response) curl -X POST https://api5.exploit.bot/chat \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "What is its population?", "conversation_id": "YOUR_CONV_ID"}' # List active conversations curl https://api5.exploit.bot/chat/active \ -H "X-API-Key: eric" # Delete a conversation curl -X DELETE https://api5.exploit.bot/chat/YOUR_CONV_ID \ -H "X-API-Key: eric" # Use YouTube extension curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "@YouTube find videos about machine learning"}' # Request image generation (use gemini-3.0-pro) curl -X POST https://api5.exploit.bot/ask \ -H "Content-Type: application/json" \ -H "X-API-Key: eric" \ -d '{"message": "Generate an image of a futuristic city", "model": "gemini-3.0-pro"}'