AI STUDIO LAB · OPERATIONS

GenContent Control Room

درخواست‌ها، sessionها، Chrome profileها و virtual tab pool

در حال اتصال

به‌روزرسانی sessionها

این دستور را روی سیستم خودت اجرا کن؛ cookieها منتقل و Chrome profileها دوباره ساخته می‌شوند.

cd /home/h-mousavi/Projects/Hamed/aistudio-api && \
scripts/sync_sessions_to_server.sh \
  --ssh-port 9011 \
  --import-chatgpt \
  root@87.248.139.241:/opt/aistudio-api

نمونه‌های API

همهٔ نمونه‌ها OpenAI-compatible هستند. برای اجرای محلی، مقدار BASE_URL را روی http://127.0.0.1:3346 بگذار.

تولید متن

cURL · chat completions
BASE_URL="${OPENAI_BASE_URL:-https://aistudio.shekarchi-app.ir}"
curl -sS "$BASE_URL/v1/chat/completions" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "chatgpt/gpt-5.6-thinking-off",
    "messages": [
      {"role": "system", "content": "Answer briefly."},
      {"role": "user", "content": "What is the capital of Iran?"}
    ]
  }' | jq -r 'if .error then error(.error.message) else .choices[0].message.content end'
Python · chat completions
import json
import os
import urllib.request

base_url = os.getenv("OPENAI_BASE_URL", "https://aistudio.shekarchi-app.ir")
payload = {
    "model": "chatgpt/gpt-5.6-thinking-off",
    "messages": [{"role": "user", "content": "پایتخت ایران چیست؟"}],
}
request = urllib.request.Request(
    f"{base_url}/v1/chat/completions",
    data=json.dumps(payload).encode(),
    headers={"Content-Type": "application/json"},
    method="POST",
)
with urllib.request.urlopen(request, timeout=240) as response:
    result = json.load(response)
print(result["choices"][0]["message"]["content"])

تولید تصویر

cURL · image generation
set -euo pipefail
BASE_URL="${OPENAI_BASE_URL:-https://aistudio.shekarchi-app.ir}"
image_b64="$(curl -sS "$BASE_URL/v1/images/generations" \
  -H 'Content-Type: application/json' \
  -d '{"model":"chatgpt-web","prompt":"A minimal blue circle on white","n":1,"response_format":"b64_json"}' \
  | jq -er 'if .error then error(.error.message) else .data[0].b64_json end')"
printf '%s' "$image_b64" | base64 -d > generated.png
Python · image generation
import base64
import json
import os
import urllib.request

base_url = os.getenv("OPENAI_BASE_URL", "https://aistudio.shekarchi-app.ir")
payload = {"model": "chatgpt-web", "prompt": "A minimal blue circle on white", "n": 1, "response_format": "b64_json"}
request = urllib.request.Request(
    f"{base_url}/v1/images/generations",
    data=json.dumps(payload).encode(),
    headers={"Content-Type": "application/json"},
    method="POST",
)
with urllib.request.urlopen(request, timeout=420) as response:
    image = json.load(response)["data"][0]["b64_json"]
with open("generated.png", "wb") as output:
    output.write(base64.b64decode(image))

تصویر با عکس مرجع

cURL · multipart upload
set -euo pipefail
BASE_URL="${OPENAI_BASE_URL:-https://aistudio.shekarchi-app.ir}"
image_b64="$(curl -sS "$BASE_URL/v1/images/generations" \
  -F model=chatgpt-web \
  -F 'prompt=این تصاویر را به یک پوستر تبلیغاتی تبدیل کن' \
  -F image=@screen-1.png \
  -F image=@screen-2.png \
  | jq -er 'if .error then error(.error.message) else .data[0].b64_json end')"
printf '%s' "$image_b64" | base64 -d > poster.png
Python · آمادهٔ repository
cd /home/h-mousavi/Projects/Hamed/aistudio-api
OPENAI_BASE_URL=https://aistudio.shekarchi-app.ir \
python examples/chatgpt_image_with_references.py \
  --prompt 'این تصاویر را به یک پوستر تبلیغاتی تبدیل کن' \
  --output poster.png screen-1.png screen-2.png

روند درخواست

موفق و ناموفق در بازهٔ انتخابی

کلموفقخطا

تفکیک خطا

بر اساس phase و status

Phase

Status

Browser & Cookie Sessions

فقط metadata امن؛ هیچ cookie یا token نمایش داده نمی‌شود

ProfileSessionاتصالCookieRevisionExpiryHeartbeatWarm-up

مدل‌ها

حجم، موفقیت و latency

ModelRequestSuccessP50P95Empty

Tab Pool

ظرفیت و lifecycle tabهای مجازی

TabStateProfileGenerateLeaseAgeLast use

آخرین رخدادها

لیست محدود Redis با retention هفت‌روزه