Skip to content

Commit c0d46dc

Browse files
committed
doc: update public mock server
1 parent 6937b04 commit c0d46dc

File tree

2 files changed

+75
-11
lines changed

2 files changed

+75
-11
lines changed

README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,31 @@ A complete OpenAI API compatible mock server that returns predefined test data w
1616

1717
## 🚀 Quick Start
1818

19-
### Method 1: Docker (Recommended)
19+
### Method 1: Public Service (No Setup Required)
2020

21-
The easiest way to run Mock OpenAI API is using Docker from [Docker Hub](https://hub.docker.com/r/zerob13/mock-openai-api):
21+
The quickest way to get started is using our public deployment service:
22+
23+
**Base URL**: `https://mockllm.anya2a.com/v1`
24+
**API Key**: `DeepChat`
25+
26+
```bash
27+
# Test the public service
28+
curl https://mockllm.anya2a.com/v1/models \
29+
-H "Authorization: Bearer DeepChat"
30+
31+
# Chat completion example
32+
curl -X POST https://mockllm.anya2a.com/v1/chat/completions \
33+
-H "Content-Type: application/json" \
34+
-H "Authorization: Bearer DeepChat" \
35+
-d '{
36+
"model": "mock-gpt-thinking",
37+
"messages": [{"role": "user", "content": "Hello"}]
38+
}'
39+
```
40+
41+
### Method 2: Docker (Recommended for Local Development)
42+
43+
The easiest way to run Mock OpenAI API locally is using Docker from [Docker Hub](https://hub.docker.com/r/zerob13/mock-openai-api):
2244

2345
```bash
2446
# Pull and run the latest image
@@ -44,7 +66,7 @@ Available environment variables:
4466
- `TZ`: Timezone setting (default: UTC)
4567
- `NODE_ENV`: Node.js environment (default: production)
4668

47-
### Method 2: Docker Compose
69+
### Method 3: Docker Compose
4870

4971
Create a `docker-compose.yml` file:
5072

@@ -68,7 +90,7 @@ Then run:
6890
docker-compose up -d
6991
```
7092

71-
### Method 3: NPM Installation
93+
### Method 4: NPM Installation
7294

7395
```bash
7496
npm install -g mock-openai-api
@@ -420,10 +442,13 @@ docker run -p 3000:3000 my-mock-openai-api
420442
### Testing with curl
421443

422444
```bash
423-
# Test health check
424-
curl http://localhost:3000/health
445+
# Test public service
446+
curl https://mockllm.anya2a.com/health
447+
curl https://mockllm.anya2a.com/v1/models \
448+
-H "Authorization: Bearer DeepChat"
425449

426-
# Test model list
450+
# Test local service
451+
curl http://localhost:3000/health
427452
curl http://localhost:3000/v1/models
428453

429454
# Test thinking model
@@ -475,7 +500,14 @@ curl -X POST http://localhost:3000/v1/images/generations \
475500
```javascript
476501
import OpenAI from 'openai';
477502

503+
// Using the public service
478504
const client = new OpenAI({
505+
baseURL: 'https://mockllm.anya2a.com/v1',
506+
apiKey: 'DeepChat'
507+
});
508+
509+
// Or using local deployment
510+
const localClient = new OpenAI({
479511
baseURL: 'http://localhost:3000/v1',
480512
apiKey: 'mock-key' // can be any value
481513
});

README.zh.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,29 @@
1313

1414
## 🚀 快速开始
1515

16-
### 安装
16+
### 方法 1:公共服务(无需安装配置)
17+
18+
最快的使用方式是直接使用我们的公共部署服务:
19+
20+
**服务地址**: `https://mockllm.anya2a.com/v1`
21+
**API密钥**: `DeepChat`
22+
23+
```bash
24+
# 测试公共服务
25+
curl https://mockllm.anya2a.com/v1/models \
26+
-H "Authorization: Bearer DeepChat"
27+
28+
# 聊天完成示例
29+
curl -X POST https://mockllm.anya2a.com/v1/chat/completions \
30+
-H "Content-Type: application/json" \
31+
-H "Authorization: Bearer DeepChat" \
32+
-d '{
33+
"model": "mock-gpt-thinking",
34+
"messages": [{"role": "user", "content": "你好"}]
35+
}'
36+
```
37+
38+
### 方法 2:NPM 安装(本地部署)
1739

1840
```bash
1941
npm install -g mock-openai-api
@@ -310,10 +332,13 @@ docker run -p 3000:3000 mock-openai-api
310332
### 使用 curl 测试
311333

312334
```bash
313-
# 测试健康检查
314-
curl http://localhost:3000/health
335+
# 测试公共服务
336+
curl https://mockllm.anya2a.com/health
337+
curl https://mockllm.anya2a.com/v1/models \
338+
-H "Authorization: Bearer DeepChat"
315339

316-
# 测试模型列表
340+
# 测试本地服务
341+
curl http://localhost:3000/health
317342
curl http://localhost:3000/v1/models
318343

319344
# 测试思考型模型
@@ -365,7 +390,14 @@ curl -X POST http://localhost:3000/v1/images/generations \
365390
```javascript
366391
import OpenAI from 'openai';
367392

393+
// 使用公共服务
368394
const client = new OpenAI({
395+
baseURL: 'https://mockllm.anya2a.com/v1',
396+
apiKey: 'DeepChat'
397+
});
398+
399+
// 或使用本地部署
400+
const localClient = new OpenAI({
369401
baseURL: 'http://localhost:3000/v1',
370402
apiKey: 'mock-key' // 可以是任意值
371403
});

0 commit comments

Comments
 (0)