Skip to content

Commit 2d14b2b

Browse files
rootclaude
authored andcommitted
feat: remove /v1/chat/completions endpoint
- Delete chat route and controller files - Update routes/index.ts to remove chat references - Update server.ts error message to be generic - Update README.md and README.CN.md documentation This endpoint was a wrapper around images/videos APIs for OpenAI Chat API compatibility. Direct image/video generation APIs remain available. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 10cc883 commit 2d14b2b

6 files changed

Lines changed: 5 additions & 670 deletions

File tree

README.CN.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -504,25 +504,6 @@ curl -X POST http://localhost:5100/v1/videos/generations \
504504
505505
```
506506

507-
### 聊天完成
508-
509-
**POST** `/v1/chat/completions`
510-
511-
```bash
512-
curl -X POST http://localhost:5100/v1/chat/completions \
513-
-H "Content-Type: application/json" \
514-
-H "Authorization: Bearer YOUR_SESSION_ID" \
515-
-d '{
516-
"model": "jimeng-4.5",
517-
"messages": [
518-
{
519-
"role": "user",
520-
"content": "画一幅山水画"
521-
}
522-
]
523-
}'
524-
```
525-
526507
### Token API
527508

528509
#### Token 绑定代理功能 (新)
@@ -638,40 +619,6 @@ curl -X POST http://localhost:5100/token/receive \
638619
}
639620
```
640621

641-
### 聊天完成响应
642-
```json
643-
{
644-
"id": "chatcmpl-123",
645-
"object": "chat.completion",
646-
"created": 1759058768,
647-
"model": "jimeng-4.5",
648-
"choices": [
649-
{
650-
"index": 0,
651-
"message": {
652-
"role": "assistant",
653-
"content": "![image](https://example.com/generated-image.jpg)"
654-
},
655-
"finish_reason": "stop"
656-
}
657-
],
658-
"usage": {
659-
"prompt_tokens": 10,
660-
"completion_tokens": 20,
661-
"total_tokens": 30
662-
}
663-
}
664-
```
665-
666-
### 流式响应 (SSE)
667-
```
668-
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1759058768,"model":"jimeng-4.5","choices":[{"index":0,"delta":{"role":"assistant","content":"🎨 图像生成中,请稍候..."},"finish_reason":null}]}
669-
670-
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1759058768,"model":"jimeng-4.5","choices":[{"index":1,"delta":{"role":"assistant","content":"![image](https://example.com/image.jpg)"},"finish_reason":"stop"}]}
671-
672-
data: [DONE]
673-
```
674-
675622
## 🏗️ 项目架构
676623

677624
```
@@ -681,8 +628,7 @@ jimeng-api/
681628
│ │ ├── controllers/ # 控制器层
682629
│ │ │ ├── core.ts # 核心功能(网络请求、文件处理)
683630
│ │ │ ├── images.ts # 图像生成逻辑
684-
│ │ │ ├── videos.ts # 视频生成逻辑
685-
│ │ │ └── chat.ts # 聊天接口逻辑
631+
│ │ │ └── videos.ts # 视频生成逻辑
686632
│ │ ├── routes/ # 路由定义
687633
│ │ └── consts/ # 常量定义
688634
│ ├── lib/ # 核心库

README.md

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -473,18 +473,6 @@ curl -X POST http://localhost:5100/v1/videos/generations \
473473
474474
```
475475

476-
### Chat Completions
477-
478-
**POST** `/v1/chat/completions`
479-
480-
```bash
481-
curl -X POST http://localhost:5100/v1/chat/completions \
482-
-H "Content-Type: application/json" \
483-
-H "Authorization: Bearer YOUR_SESSION_ID" \
484-
-d \
485-
"{\"model\": \"jimeng-4.5\", \"messages\": [ { \"role\": \"user\", \"content\": \"Draw a landscape painting\" } ]}"
486-
```
487-
488476
### Token API
489477

490478
#### Token Bound Proxy Feature (New)
@@ -600,40 +588,6 @@ curl -X POST http://localhost:5100/token/receive \
600588
}
601589
```
602590

603-
### Chat Completion Response
604-
```json
605-
{
606-
"id": "chatcmpl-123",
607-
"object": "chat.completion",
608-
"created": 1759058768,
609-
"model": "jimeng-4.5",
610-
"choices": [
611-
{
612-
"index": 0,
613-
"message": {
614-
"role": "assistant",
615-
"content": "![image](https://example.com/generated-image.jpg)"
616-
},
617-
"finish_reason": "stop"
618-
}
619-
],
620-
"usage": {
621-
"prompt_tokens": 10,
622-
"completion_tokens": 20,
623-
"total_tokens": 30
624-
}
625-
}
626-
```
627-
628-
### Stream Response (SSE)
629-
```
630-
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1759058768,"model":"jimeng-4.5","choices":[{"index":0,"delta":{"role":"assistant","content":"🎨 Generating image, please wait..."},"finish_reason":null}]}
631-
632-
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1759058768,"model":"jimeng-4.5","choices":[{"index":1,"delta":{"role":"assistant","content":"![image](https://example.com/image.jpg)"},"finish_reason":"stop"}]}
633-
634-
data: [DONE]
635-
```
636-
637591
## 🏗️ Project Architecture
638592

639593
```
@@ -643,8 +597,7 @@ jimeng-api/
643597
│ │ ├── controllers/ # Controller layer
644598
│ │ │ ├── core.ts # Core functions (network requests, file handling)
645599
│ │ │ ├── images.ts # Image generation logic
646-
│ │ │ ├── videos.ts # Video generation logic
647-
│ │ │ └── chat.ts # Chat interface logic
600+
│ │ │ └── videos.ts # Video generation logic
648601
│ │ ├── routes/ # Route definitions
649602
│ │ └── consts/ # Constant definitions
650603
│ ├── lib/ # Core library

0 commit comments

Comments
 (0)