explaingit

mooooooooner/myichuan

28TypeScript

TLDR

This repository is a TypeScript project that wraps the chat endpoints of a third-party service called Magai (beta.magai.co) so that they look like OpenAI and Anthropic API endpoints.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

This repository is a TypeScript project that wraps the chat endpoints of a third-party service called Magai (beta.magai.co) so that they look like OpenAI and Anthropic API endpoints. The README opens by saying the project is meant for CTF and research scenarios. Once running, a local proxy listens on port 8787 and a small web management portal listens on port 5174. The proxy exposes the standard endpoints a developer would expect from an OpenAI-compatible service: POST /v1/chat/completions for chat, POST /v1/images/generations for image generation, plus Anthropic-style endpoints at /anthropic/v1/messages and /v1/messages. A client app pointed at the local proxy with a configured API key can therefore talk to Magai's models through familiar OpenAI or Anthropic client libraries. The default known model in the README is Claude Sonnet 4.6. A setup script takes the user through the process from scratch. It checks that Node 20 or newer is installed, generates an .env file, asks how many Magai accounts to auto-register, runs pnpm install, and writes the registered email and password into a file called accounts.json. The web portal then accepts the proxy API key and lets the operator view the account pool, import additional credentials, manage models, and run image generations. The README documents an account pool with round-robin rotation across multiple Magai logins, with optional per-request override using an accountId field. It explains the upstream call chain in detail, from refreshing a Supabase token to invoking Magai's internal server actions to streaming the response back as either OpenAI or Anthropic shaped output. There are also two browser console snippets the user is expected to paste into Magai's site to export refresh tokens and historical model identifiers from local storage. The proxy logic lives in apps/server/src/index.ts and the React plus Vite plus Tailwind admin UI lives in apps/web-portal. Files like accounts.json and .env are gitignored so credentials are not committed by accident.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.