live & operational

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.

api5.exploit.bot
base url https://api5.exploit.bot
version 2.0.0
auth X-API-Key: eric
default model gemini-2.5-flash

authentication

API endpoints use X-API-Key header authentication. Admin endpoints use HTTP Basic Auth.

api key authentication

header name X-API-Key
api key value eric
required for /ask, /chat, DELETE /chat/*

admin panel auth

auth type HTTP Basic Auth
username admin
password jinho2310
protects /auth.html, /howtouse.html

base configuration

base url https://api5.exploit.bot
protocol HTTPS (TLS 1.3)
content-type application/json

Quick Start Example

curl
# 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)

GET
/
Redirects to /info.html documentation
🌐 public
β–Ό
behavior

HTTP 302 redirect to /info.html

GET
/status
Get API service status and version information
🌐 public
β–Ό
example request
curl
curl https://api5.exploit.bot/status
example response
json
{
  "status": "operational",
  "version": "2.0.0",
  "authenticated": true
}
GET
/auth/status
Check current Gemini authentication status
🌐 public
β–Ό
example request
curl
curl https://api5.exploit.bot/auth/status
GET
/models
List all available Gemini models
🌐 public
β–Ό
example request
curl
curl https://api5.exploit.bot/models
example response
json
{
  "models": [
    "gemini-2.5-flash",
    "gemini-2.5-pro",
    "gemini-3.0-pro"
  ],
  "default": "gemini-2.5-flash"
}
GET
/extensions
List available Gemini extensions
🌐 public
β–Ό
example request
curl
curl https://api5.exploit.bot/extensions
GET
/features
List all available API features
🌐 public
β–Ό
example request
curl
curl https://api5.exploit.bot/features
GET
/info.html
This API documentation page
🌐 public
β–Ό
description

Serves this comprehensive API documentation page.

GET
/docs
Swagger UI interactive API documentation
🌐 public
β–Ό
description

Interactive Swagger UI for exploring and testing API endpoints.

// protected endpoints (X-API-Key: eric required)

POST
/ask
Send a single message to Gemini and receive a response
πŸ” X-API-Key
β–Ό
required headers
header value required
Content-Type application/json required
X-API-Key eric required
request body parameters
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)
example request
curl
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"}'
example response
json
{
  "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"
}
POST
/ask/stream
Stream Gemini responses using Server-Sent Events (SSE). Responses are delivered word-by-word for a real-time streaming experience.
πŸ” X-API-Key
β–Ό
required headers
header value required
Content-Type application/json required
X-API-Key eric required
request body parameters
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)
sse response format
sse
data: {"token": "Hello"}

data: {"token": " "}

data: {"token": "world!"}

data: {"done": true}
example request (curl)
curl
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"}'
example (javascript)
javascript
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]');
    }
  }
}
example (python)
python
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]')
⚠️ Simulated Streaming Notice Gemini's web API doesn't support real token streaming. The streaming behavior is simulated:
  • 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
POST
/chat
Multi-turn conversation with context preservation
πŸ” X-API-Key
β–Ό
required headers
header value required
Content-Type application/json required
X-API-Key eric required
request body parameters
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)
example: start new conversation
curl
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?"}'
example: continue conversation
curl
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"}'
example response
json
{
  "status": "success",
  "response": "The capital of France is Paris.",
  "thoughts": null,
  "images": [],
  "conversation_id": "conv_abc123xyz",
  "model": "gemini-2.5-flash"
}
DELETE
/chat/{conversation_id}
Delete a specific conversation
πŸ” X-API-Key
β–Ό
path parameters
parameter type description
conversation_id string The ID of the conversation to delete
example request
curl
curl -X DELETE https://api5.exploit.bot/chat/conv_abc123xyz \
  -H "X-API-Key: eric"
GET
/chat/active
List all active conversations
πŸ” X-API-Key
β–Ό
example request
curl
curl https://api5.exploit.bot/chat/active \
  -H "X-API-Key: eric"

// admin endpoints (Basic Auth: admin:jinho2310)

GET
/auth.html
Cookie configuration panel for Gemini authentication
πŸ”’ Basic Auth
β–Ό
authentication

Requires HTTP Basic Auth with username admin and password jinho2310

GET
/howtouse.html
Detailed usage guide
πŸ”’ Basic Auth
β–Ό
authentication

Requires HTTP Basic Auth with username admin and password jinho2310

POST
/auth/cookies
Save Google session cookies for Gemini authentication
πŸ”’ Basic Auth
β–Ό
description

Submit cookies obtained from gemini.google.com to authenticate the API backend.

POST
/auth/test
Test connection with current authentication
πŸ”’ Basic Auth
β–Ό
description

Sends a test message to verify the Gemini connection is working correctly.

POST
/auth/reinitialize
Reinitialize the Gemini client
πŸ”’ Basic Auth
β–Ό
description

Reinitialize the gemini-webapi client with current cookies. Useful after updating cookies or recovering from errors.

GET
/logs
Request logs viewer - web interface for viewing API request history
πŸ”’ Basic Auth
β–Ό
description

Web interface for viewing and filtering API request logs. Shows request details including method, path, status, duration, and timestamps.

GET
/logs/data
Request logs JSON API - retrieve logs in JSON format
πŸ”’ Basic Auth
β–Ό
query parameters
parameter type required description
limit integer optional Maximum number of log entries to return (default: 100)
example response
json
{
  "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)

Context: 1,048,576 tokens input
Output: 65,536 tokens
Input: text, images, video, audio
Features: thinking, code_execution, search_grounding
model examples
# 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.

πŸ“Ί
YouTube@YouTube
Search and get information from YouTube videos
πŸ“§
Gmail@Gmail
Access and search your Gmail messages
πŸ—ΊοΈ
Google Maps@Google Maps
Get location information, directions, and place details
πŸ“
Google Drive@Google Drive
Access and search files in your Google Drive
✈️
Google Flights@Google Flights
Search for flights and get pricing information
🏨
Google Hotels@Google Hotels
Search for hotels and accommodations
using extensions
# 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.

400

Bad Request

Missing required field, invalid model name, or malformed request body.

Ensure your request includes a message field and uses a valid model name.
401

Unauthorized

Missing or invalid API key, or Gemini authentication error.

Ensure your request includes X-API-Key: eric header.
404

Not Found

The requested endpoint or resource does not exist.

Check the endpoint path and ensure you're using a valid conversation_id.
500

Internal Server Error

An unexpected error occurred on the server.

Check /status endpoint and retry after a moment.
504

Gateway Timeout

The request took too long to complete.

Try a simpler query or use a faster model like gemini-2.5-flash.

code examples

Ready-to-use examples in different languages.

python
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"])
javascript (fetch)
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));
curl (complete examples)
# 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"}'