@@ -11,174 +11,12 @@ export type GuideContent = {
1111 tips : string ;
1212} ;
1313
14- export const GUIDE_SLUGS = [
15- "quick-start-local-proxy" ,
16- "subscription-to-api" ,
17- "api-style-routing" ,
18- ] as const ;
14+ export const GUIDE_SLUGS = [ ] as const ;
1915
2016export type GuideSlug = ( typeof GUIDE_SLUGS ) [ number ] ;
2117
22- const GUIDE_CONTENT : Record < AppLanguage , Record < GuideSlug , GuideContent > > = {
23- "zh-CN" : {
24- "quick-start-local-proxy" : {
25- slug : "quick-start-local-proxy" ,
26- title : "快速启动本地代理" ,
27- description : "安装 clovapi,启动本地代理,并用稳定的本地 URL 调用模型 API。" ,
28- intro : "用最少步骤把 clovapi 跑起来:安装 CLI、启动代理、添加上游,再从客户端发起请求。" ,
29- steps : [
30- {
31- title : "安装 CLI" ,
32- body : "通过 npm 安装 clovapi。也可以使用桌面端管理配置和日志。" ,
33- command : "npm i -g @clovapi/cli" ,
34- } ,
35- {
36- title : "启动代理" ,
37- body : "代理默认监听 127.0.0.1:27483,所有请求都从本机进入。" ,
38- command : "clovapi proxy start" ,
39- } ,
40- {
41- title : "添加上游" ,
42- body : "保存 base URL、API key、API 风格和模型名称。保存后即可用 provider id 组成本地入口。" ,
43- command : "clovapi profiles add --provider custom-api --api-style responses --model my-model" ,
44- } ,
45- {
46- title : "发起请求" ,
47- body : "把客户端的 base URL 指到本地代理路径,例如 /custom-api/v1/responses。" ,
48- command : "http://127.0.0.1:27483/custom-api/v1/responses" ,
49- } ,
50- ] ,
51- tips : "桌面端会显示代理状态和调用日志,适合调试上游连通性、模型名称和协议格式。" ,
52- } ,
53- "subscription-to-api" : {
54- slug : "subscription-to-api" ,
55- title : "把官方订阅接入本地 API" ,
56- description : "通过 clovapi 登录 Codex 或 Claude 订阅,并在本地暴露为可调用的模型 API。" ,
57- intro : "官方订阅可以和自定义 API 一样通过本地入口调用,适合统一客户端配置和调用日志。" ,
58- steps : [
59- {
60- title : "登录订阅" ,
61- body : "使用桌面端登录,或通过 CLI 打开 OAuth 登录流程。" ,
62- command : "clovapi auth login --provider codex" ,
63- } ,
64- {
65- title : "启动代理" ,
66- body : "登录态保存在本机,代理会在请求时为对应上游构造认证信息。" ,
67- command : "clovapi proxy start" ,
68- } ,
69- {
70- title : "使用订阅入口" ,
71- body : "订阅供应商有固定 provider id,例如 codex 或 claude-code。" ,
72- command : "http://127.0.0.1:27483/codex/v1/responses" ,
73- } ,
74- ] ,
75- tips : "订阅登录态、请求日志和模型配置都留在本机;切换客户端时只需要复用本地 URL。" ,
76- } ,
77- "api-style-routing" : {
78- slug : "api-style-routing" ,
79- title : "选择 API 风格和模型路径" ,
80- description : "理解 chat、responses、message、gemini 四种入口,按客户端需要选择请求格式。" ,
81- intro : "clovapi 在本地做协议适配。客户端可以继续使用熟悉的 API 风格,上游配置负责实际转发。" ,
82- steps : [
83- {
84- title : "选择 API 风格" ,
85- body : "配置上游时选择 chat、responses、message 或 gemini。" ,
86- command : "clovapi profiles add --provider custom-api --api-style chat" ,
87- } ,
88- {
89- title : "使用对应路径" ,
90- body : "OpenAI Chat 使用 /v1/chat/completions,Responses 使用 /v1/responses,Anthropic 使用 /v1/messages。" ,
91- command : "/custom-api/v1/chat/completions\n/custom-api/v1/responses\n/custom-api/v1/messages" ,
92- } ,
93- {
94- title : "查看日志" ,
95- body : "在桌面端调用日志中查看入站请求、上游响应片段、token 用量和错误。" ,
96- } ,
97- ] ,
98- tips : "如果客户端报协议错误,先确认路径和 api_style 是否匹配,再检查模型 ID 与上游支持情况。" ,
99- } ,
100- } ,
101- en : {
102- "quick-start-local-proxy" : {
103- slug : "quick-start-local-proxy" ,
104- title : "Start the local proxy" ,
105- description : "Install clovapi, start the local proxy, and call model APIs through a stable localhost URL." ,
106- intro : "Bring clovapi online with a short path: install the CLI, start the proxy, add an upstream, and point clients at localhost." ,
107- steps : [
108- {
109- title : "Install the CLI" ,
110- body : "Install clovapi with npm. The desktop app can manage the same proxy, settings, and logs." ,
111- command : "npm i -g @clovapi/cli" ,
112- } ,
113- {
114- title : "Start the proxy" ,
115- body : "The proxy listens on 127.0.0.1:27483 by default." ,
116- command : "clovapi proxy start" ,
117- } ,
118- {
119- title : "Add an upstream" ,
120- body : "Save the base URL, API key, API style, and model name. The provider id becomes part of the local URL." ,
121- command : "clovapi profiles add --provider custom-api --api-style responses --model my-model" ,
122- } ,
123- {
124- title : "Send requests" ,
125- body : "Point the client base URL to the local proxy path, such as /custom-api/v1/responses." ,
126- command : "http://127.0.0.1:27483/custom-api/v1/responses" ,
127- } ,
128- ] ,
129- tips : "Use the desktop app to inspect proxy status and call logs while debugging upstream connectivity, model names, and protocol format." ,
130- } ,
131- "subscription-to-api" : {
132- slug : "subscription-to-api" ,
133- title : "Use subscriptions as local APIs" ,
134- description : "Sign in to Codex or Claude subscriptions and expose them as callable local model APIs." ,
135- intro : "Official subscriptions can be called through the same localhost flow as custom upstream APIs." ,
136- steps : [
137- {
138- title : "Sign in" ,
139- body : "Use the desktop app or the CLI OAuth flow." ,
140- command : "clovapi auth login --provider codex" ,
141- } ,
142- {
143- title : "Start the proxy" ,
144- body : "Session data stays local. The proxy builds upstream auth when requests arrive." ,
145- command : "clovapi proxy start" ,
146- } ,
147- {
148- title : "Call the subscription endpoint" ,
149- body : "Built-in subscriptions use stable provider ids such as codex and claude-code." ,
150- command : "http://127.0.0.1:27483/codex/v1/responses" ,
151- } ,
152- ] ,
153- tips : "Keep subscription sessions, call logs, and model settings local; reuse the same local URL across clients." ,
154- } ,
155- "api-style-routing" : {
156- slug : "api-style-routing" ,
157- title : "Pick API styles and routes" ,
158- description : "Understand chat, responses, message, and gemini routes, then choose the request format your client expects." ,
159- intro : "clovapi adapts protocols locally. Clients keep their familiar API shape while upstream settings handle forwarding." ,
160- steps : [
161- {
162- title : "Choose an API style" ,
163- body : "Configure upstreams as chat, responses, message, or gemini." ,
164- command : "clovapi profiles add --provider custom-api --api-style chat" ,
165- } ,
166- {
167- title : "Use the matching path" ,
168- body : "OpenAI Chat uses /v1/chat/completions, Responses uses /v1/responses, and Anthropic uses /v1/messages." ,
169- command : "/custom-api/v1/chat/completions\n/custom-api/v1/responses\n/custom-api/v1/messages" ,
170- } ,
171- {
172- title : "Inspect logs" ,
173- body : "Use the desktop call log to inspect inbound requests, upstream response chunks, token usage, and errors." ,
174- } ,
175- ] ,
176- tips : "If a client reports a protocol error, first check the route and api_style, then verify the model id upstream supports." ,
177- } ,
178- } ,
179- } ;
180-
18118export function getGuideContent ( slug : string , language : AppLanguage ) : GuideContent | undefined {
182- if ( ! GUIDE_SLUGS . includes ( slug as GuideSlug ) ) return undefined ;
183- return GUIDE_CONTENT [ language ] [ slug as GuideSlug ] ;
19+ void slug ;
20+ void language ;
21+ return undefined ;
18422}
0 commit comments