Skip to content

Commit 5db9abb

Browse files
committed
Overhaul README with enterprise documentation
1 parent b5c4150 commit 5db9abb

1 file changed

Lines changed: 95 additions & 55 deletions

File tree

README.md

Lines changed: 95 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,117 @@
88
<i>One API to rule them all. Unify OpenAI, Anthropic, Google, DeepSeek, and more behind a single endpoint.</i>
99

1010
<br/>
11+
12+
[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org)
13+
[![Docker](https://img.shields.io/badge/Docker-Supported-blue.svg)](https://docker.com)
14+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
1115
</div>
1216

1317
---
1418

19+
## 📑 Table of Contents
20+
- [✨ What is this?](#-what-is-this)
21+
- [📈 Enterprise Features](#-enterprise-features)
22+
- [🧠 Supported Providers](#-supported-providers)
23+
- [🏗️ System Architecture](#️-system-architecture)
24+
- [🚀 Quick Start](#-quick-start)
25+
- [📦 Docker Deployment](#-docker-deployment)
26+
- [⚙️ Advanced Configuration](#️-advanced-configuration)
27+
- [🛠️ Development](#️-development)
28+
29+
---
30+
1531
## ✨ What is this?
1632

17-
A dead-simple, single-binary gateway that turns **dozens of LLM providers** into one clean API.
18-
Run it once, forget about provider differences. Keys, models, endpoints — all abstracted.
33+
A dead-simple, single-binary gateway that turns **dozens of LLM providers** into one clean, standard OpenAI-compatible API.
34+
35+
Run it once and forget about provider differences. Keys, specific models, differing endpoints, and prompt formatting are all abstracted entirely away from your client code.
36+
37+
**Why?** Because juggling multiple SDKs, streaming formats, and API structures is a massive pain when trying to switch models mid-development. This just works.
38+
39+
---
40+
41+
## 📈 Enterprise Features
42+
43+
- **Zero Config**: Starts instantly, works out of the box, and stays up.
44+
- **Single Binary**: No complex dependencies, just run it natively or via Docker.
45+
- **100% OpenAI-Compatible**: Your existing code, libraries, and SDKs (like `openai-node` or `langchain`) work completely unchanged. Just swap the `baseURL`.
46+
- **Lightweight & Fast**: No bloated admin UIs. Features automatic response compression for reduced bandwidth and drastically lower latency.
47+
- **Streaming Support**: Flawlessly streams Server-Sent Events (SSE) across all supported providers natively.
48+
- **Free & Open Source**: MIT licensed forever, no hidden SaaS tiers.
1949

20-
**Why?** Because juggling multiple SDKs and API formats is a pain.
21-
This just works.
50+
---
51+
52+
## 🧠 Supported Providers
53+
54+
You can route requests seamlessly to any of these providers using the exact same `/v1/chat/completions` payload format:
55+
56+
- **OpenAI** (GPT-4o, GPT-3.5)
57+
- **Anthropic Claude** (Opus, Sonnet, Haiku)
58+
- **Google Gemini** (Gemini 1.5 Pro/Flash)
59+
- **Azure OpenAI**
60+
- **DeepSeek**
61+
- **Groq** (Llama 3, Mixtral)
62+
- **Together AI**
63+
- **Mistral AI**
64+
- **Local inference** (Ollama, LM Studio)
65+
- *+20 more API-compatible providers...*
66+
67+
---
68+
69+
## 🏗️ System Architecture
70+
71+
```mermaid
72+
graph LR
73+
Client[Your App / SDK] -->|OpenAI Format Request| Gateway[one-api Gateway]
74+
75+
subgraph one-api Gateway
76+
Router[API Router] --> Translator[Payload Translator]
77+
Translator --> Dispatcher[Request Dispatcher]
78+
end
79+
80+
Gateway -->|Native Format| P1[Anthropic API]
81+
Gateway -->|Native Format| P2[Google Gemini API]
82+
Gateway -->|Native Format| P3[OpenAI API]
83+
Gateway -->|Native Format| P4[Local Ollama]
84+
```
2285

2386
---
2487

2588
## 🚀 Quick Start
2689

90+
### 1. Clone & Install
2791
```bash
28-
# 1️⃣ Clone & install
2992
git clone https://github.com/shenald-dev/one-api
3093
cd one-api
3194
npm install
95+
```
3296

33-
# 2️⃣ Configure (copy .env.example → .env and add your keys)
97+
### 2. Configure Environment
98+
```bash
3499
cp .env.example .env
35-
# Edit .env with your provider API keys
100+
# Open .env and add your provider API keys
101+
```
36102

37-
# 3️⃣ Run
103+
### 3. Run the Server
104+
```bash
38105
npm start
106+
```
39107

40-
# 4️⃣ Use
108+
### 4. Test the Endpoint
109+
Point any curl command or SDK to `http://localhost:3000/v1`:
110+
```bash
41111
curl -H "Content-Type: application/json" \
42-
-d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello!"}]}' \
112+
-d '{"model":"claude-3-haiku-20240307","messages":[{"role":"user","content":"Hello!"}]}' \
43113
http://localhost:3000/v1/chat/completions
44114
```
45-
46-
That's it. Your app now talks to **any** LLM provider through the same `/v1` OpenAI-compatible interface.
115+
*Notice how you passed an Anthropic model to an OpenAI-compatible endpoint!*
47116

48117
---
49118

50-
## 🧠 Supported Providers
51-
52-
- OpenAI
53-
- Anthropic Claude
54-
- Google Gemini
55-
- Azure OpenAI
56-
- DeepSeek
57-
- Groq
58-
- Together AI
59-
- Mistral AI
60-
- Local inference (Ollama, LM Studio)
61-
- +20 more...
62-
63-
---
119+
## 📦 Docker Deployment (Recommended)
64120

65-
## 📦 Docker (recommended)
121+
The most robust way to run `one-api` in production:
66122

67123
```bash
68124
docker run -d \
@@ -73,68 +129,52 @@ docker run -d \
73129
shenald/one-api:latest
74130
```
75131

76-
Single command, up forever.
77-
78132
---
79133

80-
## ⚙️ Configuration
134+
## ⚙️ Advanced Configuration
81135

82-
Environment variables in `.env`:
136+
All routing is controlled via environment variables in the `.env` file:
83137

84138
```bash
85-
# Port
139+
# Server Configuration
86140
PORT=3000
141+
ENABLE_COMPRESSION=true
87142

88-
# Add any provider keys you need
143+
# Provider Keys
89144
OPENAI_API_KEY=sk-...
90145
ANTHROPIC_API_KEY=sk-...
91146
GOOGLE_API_KEY=...
92147
DEEPSEEK_API_KEY=...
93-
# ... see .env.example for full list
148+
GROQ_API_KEY=...
149+
OLLAMA_BASE_URL=http://localhost:11434
94150
```
95151

96-
No database, no migrations. JSON file storage. Just run.
97-
98-
---
99-
100-
## 📈 Why this over alternatives?
101-
102-
- **Zero config** — starts, works, stays
103-
- **Single binary** — no Node, no Python, just `npm i && npm start` or Docker
104-
- **OpenAI-compatible** — your existing code works unchanged
105-
- **Lightweight** — no admin UI bloat, just the API
106-
- **Fast** — response compression built-in for reduced bandwidth and lower latency
107-
- **Free & open** — MIT license, no SaaS tier
152+
No databases required. No migrations. State is entirely managed via configuration.
108153

109154
---
110155

111156
## 🛠️ Development
112157

158+
Want to add a new provider adapter?
113159
```bash
114160
# Install deps
115161
npm install
116162

117163
# Run dev with hot reload
118164
npm run dev
119165

120-
# Test
166+
# Run the test suite
121167
npm test
122168

123-
# Build Docker image
169+
# Build Docker image locally
124170
docker build -t shenald/one-api .
125171
```
126172

127173
---
128174

129-
## 📄 License
130-
131-
MIT — do whatever you want.
132-
133-
---
134-
135175
## 🙋‍♂️ About
136176

137-
Built by a vibe coder who got tired of rewriting integrations.
177+
Built by a vibe coder who got tired of rewriting API integrations.
138178
If it's useful, star it ⭐ — if not, open an issue and tell me why.
139179

140180
**Keep it simple.** 🧘

0 commit comments

Comments
 (0)