🔌 Gemini API proxy
gemini-3.6-flash.Base URL and authorization
https://rpek.tech/google-api/api
Pass the token in the Authorization: Bearer <token> header. X-Api-Key, x-goog-api-key and the ?key= parameter are accepted too. CORS is open, so you can call it straight from the browser, but then your site's visitors will see the token, so it's better to call it from a backend.
curl https://rpek.tech/google-api/api/v1/me -H "Authorization: Bearer TOKEN"
1. Image analysis
Accepts an image in one of three ways and returns a structured description (in Russian by default, in English with lang=en). JPG, PNG, WEBP, GIF, BMP, HEIC up to 10 MB.
| Method | How to send |
|---|---|
| multipart/form-data | field image (file), optional question, model, lang |
| application/json | {"image_base64": "...", "question": "...", "model": "...", "lang": "en"}, base64 may include the data: prefix |
| by URL | {"image_url": "https://..."} or the image_url form field |
question: your own question about the image, the reply comes in the answer field. model: a Gemini model name if you need a non-default one. lang: response language, ru (default), en, es, pt or tr; send it as a form field, in the JSON body or in the query string ?lang=en. It also sets the language of error messages.
curl
curl https://rpek.tech/google-api/api/v1/analyze \
-H "Authorization: Bearer TOKEN" \
-F "image=@photo.jpg" \
-F "question=How many people are in the photo?" \
-F "lang=en"
PHP
$ch = curl_init('https://rpek.tech/google-api/api/v1/analyze');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer TOKEN'],
CURLOPT_POSTFIELDS => ['image' => new CURLFile('photo.jpg'), 'question' => 'What is this?', 'lang' => 'en'],
CURLOPT_RETURNTRANSFER => true,
]);
$res = json_decode(curl_exec($ch), true);
echo $res['ok'] ? $res['description'] : 'Error: ' . $res['error'];
JavaScript (Node / browser)
const fd = new FormData();
fd.append('image', fileInput.files[0]);
fd.append('question', 'What is in the picture?');
fd.append('lang', 'en');
const res = await fetch('https://rpek.tech/google-api/api/v1/analyze', {
method: 'POST', headers: { Authorization: 'Bearer TOKEN' }, body: fd,
});
const data = await res.json();
console.log(data.title, data.description, data.objects);
Python
import requests
r = requests.post('https://rpek.tech/google-api/api/v1/analyze',
headers={'Authorization': 'Bearer TOKEN'},
files={'image': open('photo.jpg', 'rb')},
data={'question': 'What place is this?', 'lang': 'en'})
print(r.json())
Response
{
"ok": true,
"model": "gemini-3.6-flash",
"title": "Ginger cat on a windowsill",
"description": "A ginger cat is sitting on a windowsill and looking out of the window...",
"objects": [{"name": "cat", "count": 1}, {"name": "window", "count": 1}],
"tags": ["cat", "animals", "home", "window"],
"text": "", // text from the image, verbatim
"people": 0,
"emotions": [], // facial emotions, if there are people
"place": "", // the place, if it can be determined
"colors": [{"name": "ginger", "hex": "#d2691e"}],
"type": "photo", // photo | screenshot | drawing | meme | document | diagram | logo | other
"nsfw": false,
"fun_fact": "...",
"answer": "", // answer to question
"tokens": 1800 // Gemini tokens used
}
This is the response with lang=en. Without it (or with lang=ru) the fields are the same, but the values are in Russian.
On error: {"ok": false, "error": "message", "error_type": "unauthorized | rate_limited | too_large | unsupported_media | upstream_error | blocked | bad_request"} with the matching HTTP code (401, 429, 413, 415, 502, 400).
2. Transparent Gemini API proxy
Everything after /v1/gemini/ is forwarded to generativelanguage.googleapis.com with the server's key. The request body and the response are passed through unchanged, and streaming (alt=sse) works. So any official SDK will do: set baseUrl and pass your token instead of a Google key.
curl
curl "https://rpek.tech/google-api/api/v1/gemini/v1beta/models/gemini-3.6-flash:generateContent" \
-H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"Hi! Who are you?"}]}]}'
Python, google-genai
from google import genai
client = genai.Client(api_key='TOKEN',
http_options={'base_url': 'https://rpek.tech/google-api/api/v1/gemini'})
r = client.models.generate_content(model='gemini-3.6-flash', contents='Hi!')
print(r.text)
JavaScript, @google/genai
import { GoogleGenAI } from '@google/genai';
const ai = new GoogleGenAI({ apiKey: 'TOKEN',
httpOptions: { baseUrl: 'https://rpek.tech/google-api/api/v1/gemini' } });
const r = await ai.models.generateContent({ model: 'gemini-3.6-flash', contents: 'Hi!' });
console.log(r.text);
Image via the proxy (plain REST)
{
"contents": [{ "parts": [
{ "inline_data": { "mime_type": "image/jpeg", "data": "<base64>" } },
{ "text": "What is in the picture? Answer in English." }
]}]
}
Available models: gemini-3.6-flash (default, fast), gemini-3.1-pro-preview (smarter and slower), gemini-3.1-flash-lite. Current list of models: GET /v1/gemini/v1beta/models.
Limits
- Per-token limits (30 requests per minute and 1000 per day by default) plus an overall daily cap for the server. Exceeding them returns HTTP 429.
- Request body up to 20 MB, image up to 10 MB.
- Images are not stored on the server. The log records the time, IP, client name, method, status and token count.
- The service runs on Google's free quota with no availability guarantees. For production with heavy traffic, get in touch to arrange it separately.