[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92735":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":12,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":15,"starSnapshotCount":15,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},92735,"ikik-api","wenyi401\u002Fikik-api","wenyi401","ikik-api 是基于 Sub2API 二次开发的 AI API 网关与订阅管理平台，包含共享私有账号池、拼车池、免费模型清单、让Claude、Openai、Gemini、Grok、Kiro 订阅统一接入，原生工具无缝使用。",null,"Go",195,12,68,1,0,44.54,"GNU Lesser General Public License v3.0",false,"master",[],"2026-07-22 04:02:06","# ikik-api\n\n![Go](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGo-1.26.5-00ADD8?logo=go&logoColor=white)\n![Vue](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVue-3-42b883?logo=vuedotjs&logoColor=white)\n![PostgreSQL](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPostgreSQL-15+-4169E1?logo=postgresql&logoColor=white)\n![Redis](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FRedis-7+-DC382D?logo=redis&logoColor=white)\n![Docker](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocker-ready-2496ED?logo=docker&logoColor=white)\n![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-LGPL--3.0-blue)\n\nikik-api is a self-hosted AI API gateway and subscription management platform based on Sub2API. It provides account pooling, API key management, multi-provider request forwarding, usage accounting, subscription billing, moderation controls, and admin operations for AI API services.\n\nEnglish | [中文](README_CN.md) | [日本語](README_JA.md)\n\nWebsite: [https:\u002F\u002Fikik.net](https:\u002F\u002Fikik.net)\n\nQQ group: `146499741`\n\nThis repository is intended for private deployment, customization, and secondary development. It does not include production secrets, private server configuration, hosted-service credentials, or commercial operation data.\n\n## Important Notice\n\nPlease read the following carefully before deploying or operating this project:\n\n- Terms of service risk: routing requests through subscription or account-based upstreams may violate the terms of service of some upstream providers. Review the relevant provider agreements before use.\n- Compliance: use this project only in compliance with the laws and regulations of your country or region.\n- Account risk: account bans, quota resets, service interruptions, upstream policy changes, and billing errors are operational risks that must be handled by the deployer.\n- Disclaimer: this project is provided for technical learning, self-hosting, and secondary development. You are responsible for your own deployment, data, users, payments, and upstream accounts.\n\n## Features\n\n- OpenAI-compatible gateway endpoints for chat, responses, models, embeddings, image, and streaming workloads.\n- Grok OAuth, Kiro OAuth, free-model provider onboarding, and configurable private-account access flows.\n- Multi-provider routing for OpenAI-compatible channels and account-based upstreams.\n- Account pool management with public, private, owned, and carpool-style scheduling concepts.\n- API key management with multi-group routing, IP access controls, quota controls, usage records, and billing metadata.\n- User subscriptions, recharge flows, redeem codes, invitation rewards, and shop\u002Fcard-key workflows.\n- Admin dashboard for users, accounts, channels, payments, moderation, risk events, data management, and system settings.\n- Content moderation and risk-control integration points for request\u002Fresponse auditing.\n- Built-in release workflow for tagged builds, Docker images, archives, and GitHub Releases.\n- Frontend console built with Vue 3, TypeScript, Pinia, Vue Router, Tailwind CSS, and Vite.\n- Backend service built with Go, Gin, Ent, PostgreSQL, Redis, and modular service boundaries.\n\n## Version 1.0.3 Updates\n\n- Upgraded the backend toolchain to Go 1.26.5 and refreshed vulnerable AWS SDK dependencies used by storage integrations.\n- Added Grok OAuth integration, Kiro OAuth integration, K12 account-level support, and video-related gateway endpoint coverage.\n- Added free-model provider onboarding, multi-group API key routing, and API Key IP access-control support.\n- Improved carpool pool, private account, subscription, billing, reasoning-token, and usage-stat workflows.\n- Updated CI, security scanning, and frontend audit handling for the current dependency set.\n\n## Tech Stack\n\n- Backend: Go 1.26.5, Gin, Ent, PostgreSQL, Redis\n- Frontend: Vue 3, TypeScript, Vite, Pinia, Tailwind CSS\n- Testing: Go test, Vitest, vue-tsc, ESLint\n- Deployment: Docker or source build, with external PostgreSQL and Redis recommended\n\n## Repository Layout\n\n```text\n.\n├── backend\u002F              # Go backend, migrations, services, handlers, repositories\n├── frontend\u002F             # Vue 3 admin\u002Fuser console\n├── deploy\u002F               # Deployment examples and configuration template\n├── docs\u002F                 # Additional integration and operation documents\n├── assets\u002F               # Static project assets\n├── Makefile              # Common build and test entry points\n└── Dockerfile            # Production image build\n```\n\n## Requirements\n\n- Go 1.26.5\n- Node.js 20+\n- pnpm 9+\n- PostgreSQL\n- Redis\n- Docker, optional but recommended for deployment\n\n## Configuration\n\nStart from the example configuration:\n\n```bash\ncp deploy\u002Fconfig.example.yaml deploy\u002Fconfig.yaml\n```\n\nEdit the generated configuration for your environment:\n\n- `server`: host, port, frontend URL, request body limits, CORS, and security headers.\n- `database`: PostgreSQL connection settings.\n- `redis`: cache and queue backend settings.\n- `gateway`: upstream timeout, body-size limits, routing, and model behavior.\n- `security`: URL allowlist, response header filtering, proxy fallback, and CSP.\n- payment, email, storage, moderation, and OAuth sections as needed.\n\nNever commit real production credentials. Local and deployment-specific config files are intentionally ignored by git.\n\n## Development\n\nInstall frontend dependencies:\n\n```bash\npnpm --dir frontend install\n```\n\nRun the frontend dev server:\n\n```bash\npnpm --dir frontend run dev\n```\n\nRun the backend from source:\n\n```bash\ncd backend\ngo run .\u002Fcmd\u002Fserver\n```\n\nOn first run, the backend may start the setup flow if no valid configuration or installation state is detected.\n\n## Build\n\nBuild backend and frontend:\n\n```bash\nmake build\n```\n\nBuild only the backend:\n\n```bash\nmake build-backend\n```\n\nBuild only the frontend:\n\n```bash\nmake build-frontend\n```\n\nBuild a Docker image:\n\n```bash\ndocker build -t ikik-api:local .\n```\n\n## Tests\n\nRun all configured checks:\n\n```bash\nmake test\n```\n\nRun backend tests:\n\n```bash\ncd backend\ngo test -tags=unit .\u002F...\ngo test -tags=integration .\u002F...\n```\n\nRun frontend checks:\n\n```bash\npnpm --dir frontend run lint:check\npnpm --dir frontend run typecheck\npnpm --dir frontend run i18n:audit:strict\npnpm --dir frontend exec vitest run\n```\n\nRun golangci-lint with the repository configuration:\n\n```bash\ncd backend\ngolangci-lint run .\u002F... --timeout=30m\n```\n\nIf `golangci-lint` is not installed locally, use the same version as CI:\n\n```bash\ncd backend\ngo run github.com\u002Fgolangci\u002Fgolangci-lint\u002Fv2\u002Fcmd\u002Fgolangci-lint@v2.9.0 run .\u002F... --timeout=30m\n```\n\n## Deployment Notes\n\nFor production, run ikik-api behind a reverse proxy such as Nginx, Caddy, or a managed load balancer.\n\n### Nginx Reverse Proxy Note\n\nWhen using Nginx with account scheduling, sticky sessions, Codex CLI, or clients that send headers containing underscores, enable underscore headers in the Nginx `http` block:\n\n```nginx\nunderscores_in_headers on;\n```\n\nNginx drops headers containing underscores by default. That can break session routing and some native client compatibility paths.\n\nRecommended production basics:\n\n- Use PostgreSQL and Redis outside the application container.\n- Mount a production config file instead of baking secrets into the image.\n- Terminate TLS at the reverse proxy or load balancer.\n- Keep `\u002Fapi\u002F*`, `\u002Fv1\u002F*`, streaming, and gateway routes out of CDN cache.\n- Configure request body limits consistently across the reverse proxy and backend.\n- Back up PostgreSQL before applying migrations or upgrading the application.\n\n## Security\n\n- Do not commit API keys, OAuth secrets, payment keys, database passwords, or server credentials.\n- Review `deploy\u002Fconfig.example.yaml` before exposing the service publicly.\n- Restrict admin access with strong passwords, MFA where available, and trusted reverse-proxy rules.\n- Keep payment, storage, moderation, and email credentials scoped to the minimum required permissions.\n- Run `make secret-scan` before publishing changes.\n\n## License\n\nThis project follows the license included in [LICENSE](LICENSE).\n\n## Acknowledgements\n\nikik-api is based on Sub2API and extends it for self-hosted AI gateway, subscription, accounting, and operation workflows.\n\n- [PIXEL-API\u002FPixelAPI](https:\u002F\u002Fgithub.com\u002FPIXEL-API\u002FPixelAPI)\n- [Wei-Shaw\u002Fsub2api](https:\u002F\u002Fgithub.com\u002FWei-Shaw\u002Fsub2api)\n","ikik-api 是一个自托管的 AI API 网关与订阅管理平台，基于 Sub2API 二次开发，支持统一接入 Claude、OpenAI、Gemini、Grok、Kiro 等多厂商 AI 服务。核心功能包括多账号池（共享\u002F私有\u002F拼车）、API 密钥分级管理、多提供商请求路由、用量统计、订阅计费、内容审核与后台管理。采用 Go + Gin 后端、Vue 3 前端，依赖 PostgreSQL 和 Redis，提供 Docker 部署支持。适用于个人开发者、小团队或企业内部需统一管控 AI API 订阅、分发与计费的场景，强调私有部署与二次定制能力。",2,"2026-07-10 02:30:20","CREATED_QUERY"]