Self-hosted LLM gateway that proxies OpenAI, Anthropic and compatible APIs with routing, failover, request logging and a web dashboard.
bestruirui/octopus
A self-hosted LLM API gateway for individuals that aggregates multiple provider channels behind one endpoint with failover and cost tracking.
Open-source alternative to:OpenRouter
- Stars
- 2,741
- Forks
- 450
- Open issues
- 16
- Last commit
- 16 days ago
What is it?
Octopus is a self-hosted gateway that sits between your clients and several LLM providers. You configure upstream channels for providers such as OpenAI, Anthropic and Gemini, then group channels under a single model name so clients call one endpoint regardless of which provider serves the request.
It converts between OpenAI Chat, OpenAI Responses and Anthropic API formats, so tools like Claude Code and Codex can be pointed at it with a base URL change. When an upstream channel fails, requests automatically move to another available channel. Model pricing is synced from models.dev and can be overridden manually, and request statistics, token usage and costs are tracked and shown in a web management panel.
The project ships as a single Go binary with an embedded web UI, and stores data in SQLite, MySQL or PostgreSQL. It can also be run with Docker.
Key features
- 01Aggregates multiple LLM provider channels under unified group model names
- 02Converts between OpenAI Chat, OpenAI Responses and Anthropic API formats
- 03Automatically fails over to another channel when an upstream channel errors
- 04Syncs model prices and available model lists from upstream sources
- 05Tracks request counts, token usage and cost in a web dashboard
- 06Runs as a single binary with SQLite, MySQL or PostgreSQL storage
Use cases
- Pointing Claude Code or Codex at multiple providers through one local endpoint
- Giving a personal setup a single API key and model name across several LLM accounts
- Keeping agent tasks running when one upstream provider has an outage
- Tracking token spend across different LLM providers in one place
Quick start
- 1
Run the Docker container
docker run -d --name octopus -v /path/to/data:/app/data -p 8080:8080 bestrui/octopus - 2
Or download the binary from the releases page and start it
./octopus start
Things to know
- Default admin credentials are admin/admin, so you must change the password right after first login.
- Statistics are buffered in memory, so forced termination such as kill -9 can lose data.
- MySQL and PostgreSQL databases must be created manually before use.
In collections
Topics
FAQ
- What is octopus?
- A self-hosted LLM API gateway for individuals that aggregates multiple provider channels behind one endpoint with failover and cost tracking. Octopus is a self-hosted gateway that sits between your clients and several LLM providers. You configure upstream channels for providers such as OpenAI, Anthropic and Gemini, then group channels under a single model name so clients call one endpoint regardless of which provider serves the request.
- Is octopus free to use? What license does it have?
- octopus is open source under the AGPL-3.0 license. Check the license terms before using it in commercial products.
- Is octopus still maintained?
- Actively maintained. The last commit to octopus was on Oct 23, 2026.
- What can I use octopus for?
- Pointing Claude Code or Codex at multiple providers through one local endpoint Giving a personal setup a single API key and model name across several LLM accounts Keeping agent tasks running when one upstream provider has an outage Tracking token spend across different LLM providers in one place
- How do I install octopus?
- Run the Docker container: docker run -d --name octopus -v /path/to/data:/app/data -p 8080:8080 bestrui/octopus Or download the binary from the releases page and start it: ./octopus start
- Where can I get octopus?
- The source code and installation instructions are on GitHub: https://github.com/bestruirui/octopus
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An open-source API gateway that routes LLM requests across multiple providers through an OpenAI-compatible interface, with key management and usage analytics.
Self-hosted gateway that exposes many LLM providers (OpenAI, Anthropic, Gemini, Vertex, Azure, AWS and more) behind one OpenAI-compatible API with load balancing.
A self-hosted AI gateway that exposes OpenAI, Claude and Gemini compatible APIs in front of many upstream model providers, with routing, keys, quotas and cost tracking.
Self-hosted, OpenAI-compatible LLM gateway that routes one endpoint to 40+ providers with virtual keys, budgets, and usage tracking.
Self-hosted AI gateway that puts API keys and subscription accounts from many providers behind one endpoint, with scheduling, failover and usage logs.