查询Model服务预置路由模板
更新时间:2026-09-21
该接口用于查询不同 Model 场景和协议对应的预置路由模板,供创建或编辑 Model 服务时使用。
请求结构
Plain Text
1POST /?action=DescribePresetRoutes HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
无特殊请求参数。
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| 模型场景编码(Map 的 key) | Map<String, List<ModelProtocolPresetRouteGroupUO>> | 按模型场景分组的预置路由模板,key 为模型场景编码(如 TEXT_GENERATION、EMBEDDING),value 为该场景下各协议的预置路由模板列表 |
请求示例
Plain Text
1POST /?action=DescribePresetRoutes HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "TEXT_GENERATION": [
9 {
10 "protocol": "OPENAI_COMPATIBLE",
11 "routes": [
12 {
13 "id": "R1",
14 "name": "OPENAI_COMPATIBLE_V1_CHAT_COMPLETIONS",
15 "method": "POST",
16 "path": "/chat/completions",
17 "support": true
18 },
19 {
20 "id": "R2",
21 "name": "OPENAI_COMPATIBLE_V1_COMPLETIONS",
22 "method": "POST",
23 "path": "/completions",
24 "support": true
25 },
26 {
27 "id": "R3",
28 "name": "OPENAI_COMPATIBLE_V1_RESPONSES",
29 "method": "POST",
30 "path": "/responses",
31 "support": true
32 }
33 ]
34 },
35 {
36 "protocol": "ANTHROPIC_COMPATIBLE",
37 "routes": [
38 {
39 "id": "R4",
40 "name": "ANTHROPIC_COMPATIBLE_V1_MESSAGES",
41 "method": "POST",
42 "path": "/v1/messages",
43 "support": true
44 }
45 ]
46 },
47 {
48 "protocol": "QIANFAN",
49 "routes": [
50 {
51 "id": "R8",
52 "name": "QIANFAN_V2_CHAT_COMPLETIONS",
53 "method": "POST",
54 "path": "/v2/chat/completions",
55 "support": true
56 },
57 {
58 "id": "R9",
59 "name": "QIANFAN_V2_COMPLETIONS",
60 "method": "POST",
61 "path": "/v2/completions",
62 "support": true
63 },
64 {
65 "id": "R10",
66 "name": "QIANFAN_V2_RESPONSES",
67 "method": "POST",
68 "path": "/v2/responses",
69 "support": true
70 }
71 ]
72 }
73 ],
74 "EMBEDDING": [
75 {
76 "protocol": "OPENAI_COMPATIBLE",
77 "routes": [
78 {
79 "id": "R45",
80 "name": "OPENAI_COMPATIBLE_V1_EMBEDDINGS",
81 "method": "POST",
82 "path": "/v1/embeddings",
83 "support": true
84 }
85 ]
86 }
87 ]
88}
评价此篇文章
