OpenAI-compatible proxy for PixAI, Naistera, and Civitai APIs with web dashboard. Handles task polling, batch generation, LoRAs, upscaling. Auto-adds anime style to Naistera. Login protected.
Quick start: npm install → npm start → http://localhost:3000 → admin/admin
Proxy server translating OpenAI-compatible requests to PixAI and Naistera APIs. Includes full-featured web dashboard.
PixAI uses a task-based API (create task → poll → get results). Naistera returns images directly but isn't OpenAI-compatible. Civitai uses a job-based orchestration API. This proxy handles that complexity and exposes simple OpenAI-compatible endpoints.
- 🔐 Login Protected - Configurable credentials
- 📑 Tabbed Interface - Generate, Naistera, Queue, History, Favorites, Presets
- 💾 Persistent Settings - Saved in localStorage
- 📱 Mobile Friendly
- 🖼️ Batch Generation - 1, 2, or 4 images
- 📐 Resolution Presets - 512x512 to 1024x1024
- 🎭 LoRA Support - Multiple LoRAs with weights
- 👤 Face Fix - ADetailer
- ⬆️ Upscale - 1.5x or 2x hires fix
- 🎛️ ControlNet Tile - Enhanced upscale detail
- ⚙️ Full Control - Steps, CFG, Sampler, Seed
- 🖼️ Img2Img - Transform existing images
- 🌟 Simple API - Just prompt and go
- 📐 Aspect Ratios - 1:1, 16:9, 9:16, 3:2, 2:3
- 🎨 Presets - Digital Art, Realism
- 🎲 Variety Generation - Multiple images with prompt variations
- 🎌 Auto-anime - Automatically adds anime style unless realistic requested
- 📜 Image History - Last 50 images
- ⭐ Favorite Prompts - Save/load prompts
- 💾 Model Presets - Save model + LoRA + settings combos
- 📋 Generation Queue - Queue multiple jobs
- 💰 Cost Tracking - Estimated credit usage
- 🔌 OpenAI Compatible - Multiple endpoints
- 🌐 CORS Enabled - Works from browsers
git clone https://github.com/platberlitz/pixai-proxy.git
cd pixai-proxy
npm install
npm startEnvironment variables:
ADMIN_USER=myuser # Default: admin
ADMIN_PASS=mypass # Default: admin
PORT=3000POST /v1 or POST /v1/images/generations
{
"prompt": "1girl, masterpiece",
"negative_prompt": "bad quality",
"width": 768,
"height": 1024,
"model": "1648918127446573124",
"n": 4,
"steps": 25,
"cfg_scale": 6,
"sampler": "Euler a",
"seed": -1,
"loras": [{"id": "123", "weight": 0.7}],
"facefix": true,
"upscale": 1.5,
"image_url": "https://...",
"strength": 0.7
}Images Generation:
POST /naistera/v1/images/generations
{
"prompt": "a beautiful sunset",
"aspect_ratio": "16:9",
"preset": "digital",
"n": 1
}Chat Completions (OpenAI compatible):
POST /naistera/v1/chat/completions
{
"messages": [{"role": "user", "content": "a beautiful sunset [16:9] [digital]"}]
}Use [aspect] and [preset] in prompt to set options.
Images Generation:
POST /civitai/v1/images/generations
{
"prompt": "a beautiful landscape",
"negative_prompt": "blurry, low quality",
"model": "urn:air:sd1:checkpoint:civitai:4201@130072",
"width": 512,
"height": 768,
"n": 1,
"steps": 20,
"cfg_scale": 7
}Chat Completions (OpenAI compatible):
POST /civitai/v1/chat/completions
{
"messages": [{"role": "user", "content": "a beautiful landscape [512x768]"}]
}Use [WxH] for dimensions and [model:urn:air:...] to specify model AIR in prompt.
- API Key: https://pixai.art/en/profile/edit/api
- Model IDs: Last number in model page URL
- Token: Get from @naistera_blocks_bot on Telegram
- API Token: https://civitai.com/user/account → API Keys
- Model AIRs: Find on model pages (e.g.,
urn:air:sd1:checkpoint:civitai:4201@130072)
Works with SillyTavern Quick Image Gen:
For PixAI:
- Select Reverse Proxy
- Set URL to
https://your-proxy.com/v1 - Enter PixAI API key and model ID
For Naistera:
- Select Reverse Proxy
- Set URL to
https://your-proxy.com/naistera/v1/images/generations - Enter Naistera token
For Civitai:
- Select Reverse Proxy
- Set URL to
https://your-proxy.com/civitai/v1/images/generations - Enter Civitai API token
MIT