OpenAI-compatible text generation endpoint. Supports streaming and conversation history.
curl http://HOST_IP:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini",
"messages": [
{"role": "user", "content": "Tell me a joke!"}
],
"stream": false
}'
OpenAI-compatible image generation using Google's Imagen model. Downloads images locally.
curl http://HOST_IP:8000/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"prompt": "A futuristic city in violet and cyan colors"
}'
Lists all available models, including standard Gemini and custom-created Google Gems.
curl http://HOST_IP:8000/v1/models \ -H "Authorization: Bearer YOUR_API_KEY"
Tự động: Extension lấy cookie tài khoản Gemini đang login trong Chrome.
Khi API báo cookie lỗi/hết hạn, server tự đánh dấu provider Disconnected và yêu cầu Extension
đẩy cookie mới (heartbeat ~15s). SDK cũng tự refresh __Secure-1PSIDTS nền.
Giữ Chrome login gemini.google.com,
port extension = 8000.
| Name | Status | Usage Count | Connection Identifier | Action |
|---|
| Name | Access Scope | Masked Key | Created At | Action |
|---|
| Agent Name & ID | Base Model | Description | Action |
|---|
| Timestamp | Client IP | Method | Endpoint | AI Agent | Status | Duration | Tokens |
|---|
Trải nghiệm giao tiếp Gemini AI, tạo ảnh Imagen 3 và tạo video Veo chất lượng cao trực tiếp trên Studio.
Gemini API Studio là giải pháp tối ưu giúp bạn xây dựng, quản lý và phân phối API từ các tài khoản Google Gemini một cách ổn định, tự động xoay vòng tài khoản (load balance) và dự phòng lỗi (failover) thời gian thực. Hệ thống cung cấp API chuẩn định dạng OpenAI giúp dễ dàng tích hợp vào bất kỳ ứng dụng AI nào hiện có.
chrome://extensions → bật Developer mode →
Load unpacked → chọn thư mục
extension-auth-helper/extension-auth-helper.
Trong Options của extension, đặt Backend Port = 8000
(trùng với api_server.py).
Server hỗ trợ endpoint chuẩn OpenAI Chat Completions tại địa chỉ: http://<IP-CỦA-SERVER>:8000/v1/chat/completions.
Bạn có thể sử dụng các thư viện chuẩn của OpenAI hoặc gửi trực tiếp qua HTTP Client.
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gemini-1.5-flash",
"messages": [
{"role": "user", "content": "Xin chào, giới thiệu bản thân đi!"}
],
"temperature": 0.7
}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="http://localhost:8000/v1"
)
response = client.chat.completions.create(
model="gemini-1.5-flash",
messages=[
{"role": "user", "content": "Chào bạn!"}
],
temperature=0.7
)
print(response.choices[0].message.content)