# ai-api-hub **Repository Path**: pldz/ai-api-hub ## Basic Information - **Project Name**: ai-api-hub - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-25 - **Last Updated**: 2026-06-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ๐ AI API HUB > One interface, every model. Your API keys, your data, your rules. **AI API HUB** is a unified chat & image generation frontend for multiple AI providers, running entirely in your browserโno backend, no telemetry, just you and the models having a conversation. --- ## ๐ค What Models Are We Talking About? This is why you're here, right? Here's the current lineup: ### ๐ฌ Chat Models | Model | Providers | Chat Endpoint | Vision | Web Search | Vibe Check | | --------------------- | -------------------- | ------------------- | ------ | -------------- | ---------------------------------------------------------- | | **GPT-5.5** | OpenAI ยท Azure | `/responses` | โ | โ | The latest and greatest. Expensive, but worth every token | | **GPT-5.4** | OpenAI ยท Azure | `/responses` | โ | โ | The sweet spot between brains and speed | | **GPT-4.1** | OpenAI ยท Azure | `/responses` | โ | โ | Battle-tested veteran, still shipping | | **GPT-4o** | OpenAI ยท Azure | `/responses` | โ | โ | Lightweight & fastโyour daily driver | | **DeepSeek V4 Pro** | DeepSeek ยท DashScope | `/chat/completions` | โ | โ (DashScope) | 1M token context window. Absolute unit for Chinese | | **DeepSeek V4 Flash** | DeepSeek ยท DashScope | `/chat/completions` | โ | โ (DashScope) | Pro's speedy siblingโcheap and cheerful | | **Qwen Plus** | DashScope | `/chat/completions` | โ | โ | General-purpose Qwen text chat | | **Qwen 3.7 Max** | DashScope | `/chat/completions` | โ | โ | Alibaba's flagship. Chinese comprehension on another level | ### ๐จ Image Generation | Model | Provider | Image-to-Image | Inpainting | Output Sizes | | ---------------------- | -------------- | -------------- | ---------- | -------------------------------- | | **GPT-Image-2** | OpenAI ยท Azure | โ | โ | Up to 3840ร2160 (8 sizes + auto) | | **Qwen-Image-2.0 Pro** | DashScope | โ | โ | Up to 3840ร2160 (7 sizes) | ### ๐ฌ Video Generation | Model | Provider | Input | Resolution | Description | | -------------------- | --------- | ----------------- | ------------ | ------------------------------------------------- | | **Wan2.7 I2V** | DashScope | Image + Audio | 720P ยท 1080P | Image-to-Video: animate a still image into a clip | | **Wan2.7 T2V** | DashScope | Text only | 720P ยท 1080P | Text-to-Video: generate video from prompt alone | | **Wan2.7 R2V** | DashScope | Image/Audio/Video | 720P ยท 1080P | Reference-to-Video: multi-modal guided generation | | **Wan2.7 VideoEdit** | DashScope | Image/Audio/Video | 720P ยท 1080P | Video Editing: modify existing video with prompts | > ๐ก **But wait, there's more** โ you can add any custom model that speaks OpenAI / DashScope compatible APIs. Running locally? Go for it. Third-party proxy? You do you. --- ## โจ Features - ๐ **Multi-Provider Aggregation** โ One UI for OpenAI, Azure, DeepSeek, and DashScope. - ๐ **Streaming (SSE)** โ Real-time typewriter responses with abort support. Impatient? Hit stop anytime - ๐จ **Image Generation & Editing** โ Text-to-image, image-to-image, plus a built-in brush mask editor for surgical edits - ๐ **Web Search** โ Supported models can search the web mid-conversation. Yes, just like that other chatbot - ๐ **Prompt Templates** โ Write once, reuse forever. Stop copy-pasting system instructions like a caveman - ๐ฌ **Conversation Management** โ Create, rename, delete, batch operations. Sidebar shows live runtime status per session - ๐ **Token Tracking** โ Input/output tokens per turn, normalized across providers. Know where your credits are going - ๐จ **11 Themes** โ Light ยท Dark ยท Cupcake ยท Acid ยท Lemonade ยท Night ยท Coffee ยท Winter ยท Dim ยท Nord ยท Sunset - ๐ **i18n** โ English & Simplified Chinese, auto-detected from your browser. Switch anytime - ๐ฆ **Config Import/Export** โ URL query params, file upload, or paste JSON. One-click export to back everything up - ๐ **100% Local** โ All data lives in `localStorage` + `IndexedDB`. No server, no accounts, your keys stay yours --- ## ๐๏ธ Tech Stack | Category | Stack | | --------- | ----------------------------------------------------- | | Framework | Vue 3 (Composition API + SFC) | | Language | TypeScript | | Build | Vite 6 | | State | Vuex 4 | | Routing | Vue Router 4 (Hash mode) | | i18n | vue-i18n 9 | | UI | DaisyUI 4 + Tailwind CSS 3 | | Markdown | markdown-it 14 + highlight.js 11 | | Streaming | Native Fetch API + ReadableStream (custom SSE parser) | --- ## ๐ Getting Started ### Prerequisites - Node.js โฅ 18 - npm โฅ 9 ### Quick Start ```bash npm install # Install dependencies npm run dev # Start dev server โ http://127.0.0.1:20090 ``` ### Other Commands ```bash npm run build # Production build โ dist/ npm run preview # Preview production build npm run typecheck # TypeScript type check ``` --- ## ๐ฎ How to Use 1. Open the app, click **"Enter Workspace"** 2. Go to **Settings โ Chat Models**, plug in your API key and endpoint 3. Create a new conversation, start chatting! 4. Want images? Add an image model in **Settings โ Image Models**, then switch to the **Image** tab ### ๐ URL-Based Config Import Encode your config as Base64 JSON or host it somewhere, then pass it as a URL paramโperfect for incognito mode: ``` http://127.0.0.1:20090/#/?config=BASE64_ENCODED_JSON http://127.0.0.1:20090/#/?config=https://example.com/my-config.json ``` --- ## ๐ Project Structure ``` src/ โโโ ai-capability/ # AI provider abstraction layer (Template Method pattern) โ โโโ common/ # Shared: BaseChatClient, BaseImageClient, SSE transport, usage โ โโโ chat/ # Chat capability โ โ โโโ providers/ # Clients: OpenAI, Azure, DeepSeek, DashScope โ โ โโโ executor.ts # Route โ factory โ ChatExecutor โ โ โโโ gateway.ts # Public API (chat, streaming, abort) โ โโโ image/ # Image capability โ โ โโโ providers/ # Clients: OpenAI, Azure, DashScope โ โ โโโ executor.ts # Route โ factory โ ImageExecutor โ โ โโโ gateway.ts # Public API (generate, edit) โ โโโ video/ # Video capability โ โโโ providers/ # Clients: DashScope โ โโโ executor.ts # Route โ factory โ VideoExecutor โ โโโ gateway.ts # Public API (generate video) โโโ components/ # Reusable Vue components โโโ constants/ # App metadata, model catalog, parameter presets โโโ i18n/ # EN & ZH dictionaries โโโ models/ # Data normalization & API param builders โโโ router/ # Hash-based routes โโโ services/ # Business logic (settings, conversations, images, markdown) โโโ store/ # Vuex state management โโโ types/ # TypeScript type definitions โโโ views/ # Page components (chat, image, settings, layout) ``` --- ## โ ๏ธโ ๏ธโ ๏ธ Video Generation Supported by Nginx Proxy. Add the DashScope reverse proxy inside the same `server` block and scope it under the `/io/llm/` route only. Requests to `/io/llm/ai-api-hub-dashscope-proxy/` will be forwarded to `https://dashscope.aliyuncs.com/`, while the `/io/llm/` SPA will continue to be served from `/usr/share/nginx/templates/ai-api-hub/`. Make sure the proxy `location` is placed before the static `/io/llm/` location so Nginx matches the proxy rule first. In the frontend, use `/io/llm/ai-api-hub-dashscope-proxy/...` as the API base path instead of `/ai-api-hub-dashscope-proxy/...`. This keeps the DashScope proxy limited to the LLM demo route and prevents it from affecting other site paths. The nginx configuration shall like this: ```txt location ^~ /io/llm/ai-api-hub-dashscope-proxy/ { proxy_pass https://dashscope.aliyuncs.com/; proxy_http_version 1.1; proxy_ssl_server_name on; proxy_set_header Host dashscope.aliyuncs.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Proxy AuthorizationใX-DashScope-Async... proxy_pass_request_headers on; # If support stram output. proxy_buffering off; proxy_cache off; proxy_read_timeout 300s; proxy_send_timeout 300s; } ``` --- ## ๐ License [MIT](LICENSE) ---
Made with โค๏ธ and probably too much โ