# fsc **Repository Path**: vectie/fsc ## Basic Information - **Project Name**: fsc - **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-01 - **Last Updated**: 2026-04-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # username/fsc Standalone model router with an OpenAI-style surface. Current endpoints: - `GET /health` - `GET /auth/bootstrap` - `POST /auth/register` - `GET /auth/me` - `POST /auth/keys` - `POST /auth/keys/revoke` - `GET /v1/models` - `POST /v1/chat/completions` - `POST /v1/responses` - `GET /ui` Current compatibility notes: - `stream=true` on `/v1/chat/completions` works for OpenAI-compatible providers and has a best-effort Anthropic-to-OpenAI SSE translation. - `stream=true` on `/v1/responses` works for OpenAI-compatible providers directly and uses a best-effort Anthropic-to-Responses SSE translation for Anthropic-backed providers. - Bailian entries using MoonClaw's `api: "openai-completions"` shape are treated as OpenAI-compatible routing. Auth model: - Current development mode is permissive: clients send any non-empty `Authorization: Bearer ...` token and the router accepts it. - The registration and key-management endpoints still exist, but `/v1/*` does not currently require a pre-issued key. - The upstream provider keys remain server-side only. Config format in `fsc.json`: ```json { "providers": { "openrouter": { "api": "openai", "baseUrl": "https://openrouter.ai/api/v1", "apiKey": "sk-or-...", "models": [ { "id": "claude-sonnet-4.5", "upstreamId": "anthropic/claude-sonnet-4.5", "name": "Claude Sonnet 4.5", "contextWindow": 200000, "maxTokens": 8192 } ] }, "anthropic": { "api": "anthropic", "baseUrl": "https://api.anthropic.com", "apiKey": "sk-ant-...", "models": [ { "id": "claude-sonnet-4.5", "upstreamId": "claude-sonnet-4-5-20250929" } ] } } } ``` Run: ```bash moon run cmd/main -- --config fsc.json --port 8080 --auth-store fsc-auth.json ``` If `--config` is omitted, `fsc` will look for: - `./fsc.json` - `./moonclaw.json` - `./.moonclaw/moonclaw.json` - `/Users/kq/.moonclaw/moonclaw.json` MoonClaw-compatible provider entries such as: ```json { "models": { "providers": { "bailian": { "baseUrl": "https://coding.dashscope.aliyuncs.com/v1", "apiKey": "sk-...", "api": "openai-completions", "models": [ { "id": "qwen3.5-plus", "contextWindow": 1000000, "maxTokens": 65536 } ] } } } } ``` are loaded directly and treated as OpenAI-compatible routing. To hide multiple upstream coding providers behind one public provider name and spread traffic across them, give each backend the same `"alias"` and optional `"weight"`: ```json { "providers": { "bailian-a": { "alias": "fsc", "weight": 3, "api": "openai-completions", "baseUrl": "https://endpoint-a.example.com/v1", "apiKey": "sk-a", "models": [ { "id": "qwen3.5-plus", "contextWindow": 1000000, "maxTokens": 65536 } ] }, "bailian-b": { "alias": "fsc", "weight": 1, "api": "openai-completions", "baseUrl": "https://endpoint-b.example.com/v1", "apiKey": "sk-b", "models": [ { "id": "qwen3.5-plus", "contextWindow": 1000000, "maxTokens": 65536 } ] } } } ``` Clients only see and send `fsc/qwen3.5-plus`. `/v1/models` deduplicates the public model list, request routing retries later backends when an earlier one returns `5xx` or fails at transport level, and `"weight"` biases how often a hidden backend is chosen relative to its siblings. Quick start: ```bash curl http://localhost:8080/auth/bootstrap ``` ```bash curl http://localhost:8080/auth/register \ -H 'Content-Type: application/json' \ -d '{"name":"Team Blue","key_name":"Default Key"}' ``` Then call the router with the returned API key: ```bash curl http://localhost:8080/v1/models \ -H 'Authorization: Bearer fsc_your_key_here' ``` Rabbita frontend: - Source lives in `ui/rabbita-console`. - It is a standalone MoonBit JS module using Rabbita, modeled after MoonClaw's Rabbita app structure. - Build it with: ```bash cd ui/rabbita-console moon check main --target js npm install npm run build ``` - Once `ui/rabbita-console/dist` exists, the router serves it at `http://localhost:8080/ui`. - If the bundle is missing, `/ui` falls back to a lightweight build-instructions page instead of failing silently.