Floway is a self-hosted LLM API gateway for coding agents and API clients. It puts subscription-backed and token-backed model providers behind one gateway, then routes each model through the API shape the client already speaks.
- Use GitHub Copilot, ChatGPT subscriptions, Claude.ai subscriptions, Azure OpenAI, custom OpenAI- or Anthropic-compatible providers, and Ollama from one deployment.
- Serve OpenAI, Anthropic, Gemini-compatible, audio transcription, and rerank APIs with cross-protocol translation where needed.
- Manage upstreams, routing order, model aliases, API keys, and web search from a dashboard.
- Generate one-command Claude Code and Codex configurations from an API key.
- Run on Cloudflare Workers or Node.js, with Docker Compose provided for a self-hosted server and dashboard.
Docker Compose is the shortest path to a complete local deployment:
git clone https://github.com/Menci/Floway.git
cd Floway
ADMIN_KEY='replace-with-a-secret' docker compose -f docker/docker-compose.yml up --build -dOpen http://localhost:18088, leave the username blank, and use ADMIN_KEY as
the password. Then:
- Add at least one provider under Settings → Upstreams.
- Create a key under API Keys.
- Give that key to a client as a bearer token or
x-api-key, or use Agent Setup to configure Claude Code or Codex.
The gateway API is also exposed directly at http://localhost:8788. SQLite and
uploaded files persist in the floway-data volume.
| API | Routes |
|---|---|
| OpenAI Completions | POST /v1/completions |
| OpenAI Chat Completions | POST /v1/chat/completions |
| OpenAI Responses | POST /v1/responses, POST /v1/responses/compact, WebSocket GET /v1/responses |
| OpenAI Embeddings | POST /v1/embeddings |
| OpenAI Images | POST /v1/images/generations, POST /v1/images/edits |
| OpenAI Audio Transcriptions | POST /v1/audio/transcriptions |
| OpenAI Models | GET /v1/models |
| Anthropic Messages | POST /v1/messages, POST /v1/messages/count_tokens |
| Google Gemini | POST /v1beta/models/... |
| Cohere Rerank v1 | POST /v1/rerank |
| Cohere Rerank v2 | POST /v2/rerank |
| Jina Rerank | POST /jina/v1/rerank |
| Voyage Rerank | POST /voyage/v1/rerank |
Rerank models are manual Custom models. Each model selects its outbound Cohere, Jina, Voyage, DashScope-compatible, or DashScope-native protocol and may override that protocol's canonical path; there is no upstream-wide rerank path.
Audio transcription is a buffered multipart passthrough for Custom, Azure, and Ollama-compatible upstreams. JSON, text, subtitle, and transcription SSE responses retain their upstream wire shape.
| Provider | Authentication |
|---|---|
| GitHub Copilot | GitHub device OAuth |
| Codex | ChatGPT subscription through the Codex CLI OAuth client |
| Claude Code | Claude.ai Pro or Max subscription through the Claude Code CLI OAuth client |
| Custom | OpenAI- or Anthropic-compatible endpoint and credential |
| Azure | Azure OpenAI endpoint, API key, and deployments |
| Ollama | ollama.com or a self-hosted Ollama-compatible server |
Requires Node.js 22.5+, pnpm 10.x, and a Cloudflare account.
pnpm install
pnpm wrangler login
cp wrangler.example.jsonc wrangler.jsonc
# Follow the comments in wrangler.jsonc to create the required resources and
# replace every <YOUR_*> placeholder.
pnpm run db:migrate
pnpm run devThe local dashboard runs at http://localhost:5174. For production, configure the admin secret, apply the remote migrations, and deploy:
pnpm wrangler secret put ADMIN_KEY
pnpm run db:migrate:remote
pnpm run deployThe Node.js target applies SQLite migrations automatically and defaults to
./data/floway.db, ./data/files, and port 8788:
pnpm install
ADMIN_KEY='replace-with-a-secret' pnpm run dev:nodeIt serves the gateway and control-plane APIs but not the dashboard. Use Docker
Compose for the complete self-hosted UI, or serve the web app separately.
Production Node.js deployments must set both NODE_ENV=production and a
non-empty ADMIN_KEY.
Podman users can instead follow the systemd deployment guide.
pnpm install
pnpm run dev
pnpm run test
pnpm run lint
pnpm run typecheckMore detail lives in AGENTS.md — architecture, workspace layout, verification, and contributor rules.
MIT