@redonvn/event-ws-cliproxyapi-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +428 -0
- package/dist/claude/client.d.ts +8 -0
- package/dist/claude/client.js +16 -0
- package/dist/claude/index.d.ts +2 -0
- package/dist/claude/index.js +1 -0
- package/dist/client.d.ts +19 -0
- package/dist/client.js +96 -0
- package/dist/cliproxy/client.d.ts +41 -0
- package/dist/cliproxy/client.js +43 -0
- package/dist/cliproxy/index.d.ts +2 -0
- package/dist/cliproxy/index.js +1 -0
- package/dist/codec.d.ts +8 -0
- package/dist/codec.js +79 -0
- package/dist/errors/index.d.ts +13 -0
- package/dist/errors/index.js +26 -0
- package/dist/gemini/client.d.ts +9 -0
- package/dist/gemini/client.js +19 -0
- package/dist/gemini/index.d.ts +2 -0
- package/dist/gemini/index.js +1 -0
- package/dist/http/client.d.ts +260 -0
- package/dist/http/client.js +591 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/index.js +2 -0
- package/dist/http/types.d.ts +783 -0
- package/dist/http/types.js +1 -0
- package/dist/http-client.d.ts +259 -0
- package/dist/http-client.js +557 -0
- package/dist/http-types.d.ts +677 -0
- package/dist/http-types.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/management/client.d.ts +187 -0
- package/dist/management/client.js +399 -0
- package/dist/management/index.d.ts +2 -0
- package/dist/management/index.js +1 -0
- package/dist/openai/client.d.ts +10 -0
- package/dist/openai/client.js +23 -0
- package/dist/openai/index.d.ts +2 -0
- package/dist/openai/index.js +1 -0
- package/dist/shared/errors.d.ts +13 -0
- package/dist/shared/errors.js +26 -0
- package/dist/shared/http.d.ts +29 -0
- package/dist/shared/http.js +125 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/types.d.ts +789 -0
- package/dist/shared/types.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types.d.ts +101 -0
- package/dist/types.js +1 -0
- package/dist/utils/index.d.ts +0 -0
- package/dist/utils/index.js +2 -0
- package/dist/ws/client.d.ts +20 -0
- package/dist/ws/client.js +114 -0
- package/dist/ws/codec.d.ts +8 -0
- package/dist/ws/codec.js +100 -0
- package/dist/ws/index.d.ts +3 -0
- package/dist/ws/index.js +3 -0
- package/dist/ws/types.d.ts +101 -0
- package/dist/ws/types.js +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { AmpModelMapping, AmpModelMappingsPatch, AmpUpstreamAPIKeyEntry, AmpUpstreamAPIKeysPatch, ApiCallRequest, ApiCallResponse, AuthFileDeleteResponse, AuthFileListQuery, AuthFileListResponse, AuthFileModelsQuery, AuthFileModelsResponse, AuthFileStatusRequest, AuthFileStatusResponse, AuthStatusResponse, ClaudeKey, ClaudeKeyPatch, CodexKey, CodexKeyPatch, Config, DeleteLogsResponse, ErrorLogFilesResponse, GeminiKey, GeminiKeyPatch, KeyedValueResponse, LogLinesResponse, OAuthCallbackRequest, OAuthCallbackResponse, OAuthExcludedModelsPatch, OAuthModelAlias, OAuthModelAliasPatch, OAuthStartResponse, OpenAICompatibility, OpenAICompatPatch, PatchByIndexOrMatch, PatchStringListRequest, UsageExportResponse, UsageGetResponse, UsageImportRequest, UsageImportResponse, VertexCompatKey, VertexCompatPatch } from '../shared/types.js';
|
|
2
|
+
import { BaseHttpClient } from '../shared/http.js';
|
|
3
|
+
export declare class ManagementClient extends BaseHttpClient {
|
|
4
|
+
getUsage(): Promise<UsageGetResponse>;
|
|
5
|
+
exportUsage(): Promise<UsageExportResponse>;
|
|
6
|
+
importUsage(body: UsageImportRequest): Promise<UsageImportResponse>;
|
|
7
|
+
getConfig(): Promise<Config>;
|
|
8
|
+
getConfigYaml(): Promise<string>;
|
|
9
|
+
putConfigYaml(body: string): Promise<KeyedValueResponse<"status", "ok">>;
|
|
10
|
+
getLatestVersion(): Promise<KeyedValueResponse<"latest-version", string>>;
|
|
11
|
+
getDebug(): Promise<KeyedValueResponse<"debug", boolean>>;
|
|
12
|
+
putDebug(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
13
|
+
patchDebug(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
14
|
+
getLoggingToFile(): Promise<KeyedValueResponse<"logging-to-file", boolean>>;
|
|
15
|
+
putLoggingToFile(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
16
|
+
patchLoggingToFile(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
17
|
+
getLogsMaxTotalSizeMB(): Promise<KeyedValueResponse<"logs-max-total-size-mb", number>>;
|
|
18
|
+
putLogsMaxTotalSizeMB(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
19
|
+
patchLogsMaxTotalSizeMB(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
20
|
+
getErrorLogsMaxFiles(): Promise<KeyedValueResponse<"error-logs-max-files", number>>;
|
|
21
|
+
putErrorLogsMaxFiles(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
22
|
+
patchErrorLogsMaxFiles(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
23
|
+
getUsageStatisticsEnabled(): Promise<KeyedValueResponse<"usage-statistics-enabled", boolean>>;
|
|
24
|
+
putUsageStatisticsEnabled(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
25
|
+
patchUsageStatisticsEnabled(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
26
|
+
getProxyUrl(): Promise<KeyedValueResponse<"proxy-url", string>>;
|
|
27
|
+
putProxyUrl(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
28
|
+
patchProxyUrl(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
29
|
+
deleteProxyUrl(): Promise<KeyedValueResponse<"status", "ok">>;
|
|
30
|
+
apiCall(body: ApiCallRequest): Promise<ApiCallResponse>;
|
|
31
|
+
getSwitchProject(): Promise<KeyedValueResponse<"switch-project", boolean>>;
|
|
32
|
+
putSwitchProject(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
33
|
+
patchSwitchProject(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
34
|
+
getSwitchPreviewModel(): Promise<KeyedValueResponse<"switch-preview-model", boolean>>;
|
|
35
|
+
putSwitchPreviewModel(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
36
|
+
patchSwitchPreviewModel(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
37
|
+
getApiKeys(): Promise<KeyedValueResponse<"api-keys", string[]>>;
|
|
38
|
+
putApiKeys(body: string[] | {
|
|
39
|
+
items: string[];
|
|
40
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
41
|
+
patchApiKeys(body: PatchStringListRequest): Promise<KeyedValueResponse<"status", "ok">>;
|
|
42
|
+
deleteApiKeys(query?: {
|
|
43
|
+
index?: number;
|
|
44
|
+
value?: string;
|
|
45
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
46
|
+
getGeminiKeys(): Promise<KeyedValueResponse<"gemini-api-key", GeminiKey[]>>;
|
|
47
|
+
putGeminiKeys(body: GeminiKey[] | {
|
|
48
|
+
items: GeminiKey[];
|
|
49
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
50
|
+
patchGeminiKey(body: PatchByIndexOrMatch<GeminiKeyPatch>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
51
|
+
deleteGeminiKey(query?: {
|
|
52
|
+
'api-key'?: string;
|
|
53
|
+
index?: number;
|
|
54
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
55
|
+
getLogs(query?: {
|
|
56
|
+
limit?: number;
|
|
57
|
+
after?: number;
|
|
58
|
+
}): Promise<LogLinesResponse>;
|
|
59
|
+
deleteLogs(): Promise<DeleteLogsResponse>;
|
|
60
|
+
getRequestErrorLogs(): Promise<ErrorLogFilesResponse>;
|
|
61
|
+
downloadRequestErrorLog(name: string): Promise<Response>;
|
|
62
|
+
getRequestLogById(id: string): Promise<Response>;
|
|
63
|
+
getRequestLog(): Promise<KeyedValueResponse<"request-log", boolean>>;
|
|
64
|
+
putRequestLog(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
65
|
+
patchRequestLog(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
66
|
+
getWebsocketAuth(): Promise<KeyedValueResponse<"ws-auth", boolean>>;
|
|
67
|
+
putWebsocketAuth(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
68
|
+
patchWebsocketAuth(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
69
|
+
getAmpCode(): Promise<KeyedValueResponse<"ampcode", import("../shared/types.js").AmpCodeConfig>>;
|
|
70
|
+
getAmpUpstreamUrl(): Promise<KeyedValueResponse<"upstream-url", string>>;
|
|
71
|
+
putAmpUpstreamUrl(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
72
|
+
patchAmpUpstreamUrl(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
73
|
+
deleteAmpUpstreamUrl(): Promise<KeyedValueResponse<"status", "ok">>;
|
|
74
|
+
getAmpUpstreamApiKey(): Promise<KeyedValueResponse<"upstream-api-key", string>>;
|
|
75
|
+
putAmpUpstreamApiKey(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
76
|
+
patchAmpUpstreamApiKey(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
77
|
+
deleteAmpUpstreamApiKey(): Promise<KeyedValueResponse<"status", "ok">>;
|
|
78
|
+
getAmpRestrictManagementToLocalhost(): Promise<KeyedValueResponse<"restrict-management-to-localhost", boolean>>;
|
|
79
|
+
putAmpRestrictManagementToLocalhost(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
80
|
+
patchAmpRestrictManagementToLocalhost(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
81
|
+
getAmpModelMappings(): Promise<KeyedValueResponse<"model-mappings", AmpModelMapping[]>>;
|
|
82
|
+
putAmpModelMappings(body: AmpModelMapping[] | AmpModelMappingsPatch): Promise<KeyedValueResponse<"status", "ok">>;
|
|
83
|
+
patchAmpModelMappings(body: AmpModelMappingsPatch): Promise<KeyedValueResponse<"status", "ok">>;
|
|
84
|
+
deleteAmpModelMappings(query?: {
|
|
85
|
+
index?: number;
|
|
86
|
+
match?: string;
|
|
87
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
88
|
+
getAmpForceModelMappings(): Promise<KeyedValueResponse<"force-model-mappings", boolean>>;
|
|
89
|
+
putAmpForceModelMappings(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
90
|
+
patchAmpForceModelMappings(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
91
|
+
getAmpUpstreamApiKeys(): Promise<KeyedValueResponse<"upstream-api-keys", AmpUpstreamAPIKeyEntry[]>>;
|
|
92
|
+
putAmpUpstreamApiKeys(body: AmpUpstreamAPIKeyEntry[] | AmpUpstreamAPIKeysPatch): Promise<KeyedValueResponse<"status", "ok">>;
|
|
93
|
+
patchAmpUpstreamApiKeys(body: AmpUpstreamAPIKeysPatch): Promise<KeyedValueResponse<"status", "ok">>;
|
|
94
|
+
deleteAmpUpstreamApiKeys(query?: {
|
|
95
|
+
index?: number;
|
|
96
|
+
match?: string;
|
|
97
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
98
|
+
getRequestRetry(): Promise<KeyedValueResponse<"request-retry", number>>;
|
|
99
|
+
putRequestRetry(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
100
|
+
patchRequestRetry(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
101
|
+
getMaxRetryInterval(): Promise<KeyedValueResponse<"max-retry-interval", number>>;
|
|
102
|
+
putMaxRetryInterval(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
103
|
+
patchMaxRetryInterval(body: KeyedValueResponse<'value', number>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
104
|
+
getForceModelPrefix(): Promise<KeyedValueResponse<"force-model-prefix", boolean>>;
|
|
105
|
+
putForceModelPrefix(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
106
|
+
patchForceModelPrefix(body: KeyedValueResponse<'value', boolean>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
107
|
+
getRoutingStrategy(): Promise<KeyedValueResponse<"strategy", string>>;
|
|
108
|
+
putRoutingStrategy(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
109
|
+
patchRoutingStrategy(body: KeyedValueResponse<'value', string>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
110
|
+
getClaudeKeys(): Promise<KeyedValueResponse<"claude-api-key", ClaudeKey[]>>;
|
|
111
|
+
putClaudeKeys(body: ClaudeKey[] | {
|
|
112
|
+
items: ClaudeKey[];
|
|
113
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
114
|
+
patchClaudeKey(body: PatchByIndexOrMatch<ClaudeKeyPatch>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
115
|
+
deleteClaudeKey(query?: {
|
|
116
|
+
'api-key'?: string;
|
|
117
|
+
index?: number;
|
|
118
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
119
|
+
getCodexKeys(): Promise<KeyedValueResponse<"codex-api-key", CodexKey[]>>;
|
|
120
|
+
putCodexKeys(body: CodexKey[] | {
|
|
121
|
+
items: CodexKey[];
|
|
122
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
123
|
+
patchCodexKey(body: PatchByIndexOrMatch<CodexKeyPatch>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
124
|
+
deleteCodexKey(query?: {
|
|
125
|
+
'api-key'?: string;
|
|
126
|
+
index?: number;
|
|
127
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
128
|
+
getOpenAICompatibility(): Promise<KeyedValueResponse<"openai-compatibility", OpenAICompatibility[]>>;
|
|
129
|
+
putOpenAICompatibility(body: OpenAICompatibility[] | {
|
|
130
|
+
items: OpenAICompatibility[];
|
|
131
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
132
|
+
patchOpenAICompatibility(body: PatchByIndexOrMatch<OpenAICompatPatch>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
133
|
+
deleteOpenAICompatibility(query?: {
|
|
134
|
+
name?: string;
|
|
135
|
+
index?: number;
|
|
136
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
137
|
+
getVertexCompatKeys(): Promise<KeyedValueResponse<"vertex-api-key", VertexCompatKey[]>>;
|
|
138
|
+
putVertexCompatKeys(body: VertexCompatKey[] | {
|
|
139
|
+
items: VertexCompatKey[];
|
|
140
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
141
|
+
patchVertexCompatKey(body: PatchByIndexOrMatch<VertexCompatPatch>): Promise<KeyedValueResponse<"status", "ok">>;
|
|
142
|
+
deleteVertexCompatKey(query?: {
|
|
143
|
+
'api-key'?: string;
|
|
144
|
+
index?: number;
|
|
145
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
146
|
+
getOAuthExcludedModels(): Promise<KeyedValueResponse<"oauth-excluded-models", Record<string, string[]>>>;
|
|
147
|
+
putOAuthExcludedModels(body: Record<string, string[]> | {
|
|
148
|
+
items: Record<string, string[]>;
|
|
149
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
150
|
+
patchOAuthExcludedModels(body: OAuthExcludedModelsPatch): Promise<KeyedValueResponse<"status", "ok">>;
|
|
151
|
+
deleteOAuthExcludedModels(query?: {
|
|
152
|
+
provider?: string;
|
|
153
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
154
|
+
getOAuthModelAlias(): Promise<KeyedValueResponse<"oauth-model-alias", Record<string, OAuthModelAlias[]>>>;
|
|
155
|
+
putOAuthModelAlias(body: Record<string, OAuthModelAlias[]> | {
|
|
156
|
+
items: Record<string, OAuthModelAlias[]>;
|
|
157
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
158
|
+
patchOAuthModelAlias(body: PatchByIndexOrMatch<OAuthModelAliasPatch> | OAuthModelAliasPatch): Promise<KeyedValueResponse<"status", "ok">>;
|
|
159
|
+
deleteOAuthModelAlias(query?: {
|
|
160
|
+
provider?: string;
|
|
161
|
+
channel?: string;
|
|
162
|
+
}): Promise<KeyedValueResponse<"status", "ok">>;
|
|
163
|
+
listAuthFiles(query?: AuthFileListQuery): Promise<AuthFileListResponse>;
|
|
164
|
+
getAuthFileModels(query: AuthFileModelsQuery): Promise<AuthFileModelsResponse>;
|
|
165
|
+
getStaticModelDefinitions(channel: string): Promise<Response>;
|
|
166
|
+
downloadAuthFile(query: {
|
|
167
|
+
name: string;
|
|
168
|
+
}): Promise<Response>;
|
|
169
|
+
uploadAuthFile(file: Blob, name?: string): Promise<Response>;
|
|
170
|
+
deleteAuthFile(query: {
|
|
171
|
+
name: string;
|
|
172
|
+
}): Promise<AuthFileDeleteResponse>;
|
|
173
|
+
patchAuthFileStatus(body: AuthFileStatusRequest): Promise<AuthFileStatusResponse>;
|
|
174
|
+
importVertexCredential(file: Blob): Promise<Response>;
|
|
175
|
+
requestAnthropicAuthUrl(): Promise<OAuthStartResponse>;
|
|
176
|
+
requestCodexAuthUrl(): Promise<OAuthStartResponse>;
|
|
177
|
+
requestGeminiCliAuthUrl(): Promise<OAuthStartResponse>;
|
|
178
|
+
requestAntigravityAuthUrl(): Promise<OAuthStartResponse>;
|
|
179
|
+
requestQwenAuthUrl(): Promise<OAuthStartResponse>;
|
|
180
|
+
requestKimiAuthUrl(): Promise<OAuthStartResponse>;
|
|
181
|
+
requestIFlowAuthUrl(): Promise<OAuthStartResponse>;
|
|
182
|
+
requestIFlowCookieToken(body: KeyedValueResponse<'cookie', string>): Promise<OAuthStartResponse>;
|
|
183
|
+
postOAuthCallback(body: OAuthCallbackRequest): Promise<OAuthCallbackResponse>;
|
|
184
|
+
getAuthStatus(query?: {
|
|
185
|
+
state?: string;
|
|
186
|
+
}): Promise<AuthStatusResponse>;
|
|
187
|
+
}
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { BaseHttpClient } from '../shared/http.js';
|
|
2
|
+
export class ManagementClient extends BaseHttpClient {
|
|
3
|
+
getUsage() {
|
|
4
|
+
return this.requestJson('GET', '/v0/management/usage', undefined, undefined, 'management');
|
|
5
|
+
}
|
|
6
|
+
exportUsage() {
|
|
7
|
+
return this.requestJson('GET', '/v0/management/usage/export', undefined, undefined, 'management');
|
|
8
|
+
}
|
|
9
|
+
importUsage(body) {
|
|
10
|
+
return this.requestJson('POST', '/v0/management/usage/import', body, undefined, 'management');
|
|
11
|
+
}
|
|
12
|
+
getConfig() {
|
|
13
|
+
return this.requestJson('GET', '/v0/management/config', undefined, undefined, 'management');
|
|
14
|
+
}
|
|
15
|
+
getConfigYaml() {
|
|
16
|
+
return this.requestText('GET', '/v0/management/config.yaml', undefined, undefined, 'management');
|
|
17
|
+
}
|
|
18
|
+
putConfigYaml(body) {
|
|
19
|
+
return this.requestRaw('PUT', '/v0/management/config.yaml', body, { headers: { 'Content-Type': 'text/yaml' } }, 'management').then(async (res) => {
|
|
20
|
+
const text = await res.text();
|
|
21
|
+
return text ? JSON.parse(text) : { status: 'ok' };
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getLatestVersion() {
|
|
25
|
+
return this.requestJson('GET', '/v0/management/latest-version', undefined, undefined, 'management');
|
|
26
|
+
}
|
|
27
|
+
getDebug() {
|
|
28
|
+
return this.requestJson('GET', '/v0/management/debug', undefined, undefined, 'management');
|
|
29
|
+
}
|
|
30
|
+
putDebug(body) {
|
|
31
|
+
return this.requestJson('PUT', '/v0/management/debug', body, undefined, 'management');
|
|
32
|
+
}
|
|
33
|
+
patchDebug(body) {
|
|
34
|
+
return this.requestJson('PATCH', '/v0/management/debug', body, undefined, 'management');
|
|
35
|
+
}
|
|
36
|
+
getLoggingToFile() {
|
|
37
|
+
return this.requestJson('GET', '/v0/management/logging-to-file', undefined, undefined, 'management');
|
|
38
|
+
}
|
|
39
|
+
putLoggingToFile(body) {
|
|
40
|
+
return this.requestJson('PUT', '/v0/management/logging-to-file', body, undefined, 'management');
|
|
41
|
+
}
|
|
42
|
+
patchLoggingToFile(body) {
|
|
43
|
+
return this.requestJson('PATCH', '/v0/management/logging-to-file', body, undefined, 'management');
|
|
44
|
+
}
|
|
45
|
+
getLogsMaxTotalSizeMB() {
|
|
46
|
+
return this.requestJson('GET', '/v0/management/logs-max-total-size-mb', undefined, undefined, 'management');
|
|
47
|
+
}
|
|
48
|
+
putLogsMaxTotalSizeMB(body) {
|
|
49
|
+
return this.requestJson('PUT', '/v0/management/logs-max-total-size-mb', body, undefined, 'management');
|
|
50
|
+
}
|
|
51
|
+
patchLogsMaxTotalSizeMB(body) {
|
|
52
|
+
return this.requestJson('PATCH', '/v0/management/logs-max-total-size-mb', body, undefined, 'management');
|
|
53
|
+
}
|
|
54
|
+
getErrorLogsMaxFiles() {
|
|
55
|
+
return this.requestJson('GET', '/v0/management/error-logs-max-files', undefined, undefined, 'management');
|
|
56
|
+
}
|
|
57
|
+
putErrorLogsMaxFiles(body) {
|
|
58
|
+
return this.requestJson('PUT', '/v0/management/error-logs-max-files', body, undefined, 'management');
|
|
59
|
+
}
|
|
60
|
+
patchErrorLogsMaxFiles(body) {
|
|
61
|
+
return this.requestJson('PATCH', '/v0/management/error-logs-max-files', body, undefined, 'management');
|
|
62
|
+
}
|
|
63
|
+
getUsageStatisticsEnabled() {
|
|
64
|
+
return this.requestJson('GET', '/v0/management/usage-statistics-enabled', undefined, undefined, 'management');
|
|
65
|
+
}
|
|
66
|
+
putUsageStatisticsEnabled(body) {
|
|
67
|
+
return this.requestJson('PUT', '/v0/management/usage-statistics-enabled', body, undefined, 'management');
|
|
68
|
+
}
|
|
69
|
+
patchUsageStatisticsEnabled(body) {
|
|
70
|
+
return this.requestJson('PATCH', '/v0/management/usage-statistics-enabled', body, undefined, 'management');
|
|
71
|
+
}
|
|
72
|
+
getProxyUrl() {
|
|
73
|
+
return this.requestJson('GET', '/v0/management/proxy-url', undefined, undefined, 'management');
|
|
74
|
+
}
|
|
75
|
+
putProxyUrl(body) {
|
|
76
|
+
return this.requestJson('PUT', '/v0/management/proxy-url', body, undefined, 'management');
|
|
77
|
+
}
|
|
78
|
+
patchProxyUrl(body) {
|
|
79
|
+
return this.requestJson('PATCH', '/v0/management/proxy-url', body, undefined, 'management');
|
|
80
|
+
}
|
|
81
|
+
deleteProxyUrl() {
|
|
82
|
+
return this.requestJson('DELETE', '/v0/management/proxy-url', undefined, undefined, 'management');
|
|
83
|
+
}
|
|
84
|
+
apiCall(body) {
|
|
85
|
+
return this.requestJson('POST', '/v0/management/api-call', body, undefined, 'management');
|
|
86
|
+
}
|
|
87
|
+
getSwitchProject() {
|
|
88
|
+
return this.requestJson('GET', '/v0/management/quota-exceeded/switch-project', undefined, undefined, 'management');
|
|
89
|
+
}
|
|
90
|
+
putSwitchProject(body) {
|
|
91
|
+
return this.requestJson('PUT', '/v0/management/quota-exceeded/switch-project', body, undefined, 'management');
|
|
92
|
+
}
|
|
93
|
+
patchSwitchProject(body) {
|
|
94
|
+
return this.requestJson('PATCH', '/v0/management/quota-exceeded/switch-project', body, undefined, 'management');
|
|
95
|
+
}
|
|
96
|
+
getSwitchPreviewModel() {
|
|
97
|
+
return this.requestJson('GET', '/v0/management/quota-exceeded/switch-preview-model', undefined, undefined, 'management');
|
|
98
|
+
}
|
|
99
|
+
putSwitchPreviewModel(body) {
|
|
100
|
+
return this.requestJson('PUT', '/v0/management/quota-exceeded/switch-preview-model', body, undefined, 'management');
|
|
101
|
+
}
|
|
102
|
+
patchSwitchPreviewModel(body) {
|
|
103
|
+
return this.requestJson('PATCH', '/v0/management/quota-exceeded/switch-preview-model', body, undefined, 'management');
|
|
104
|
+
}
|
|
105
|
+
getApiKeys() {
|
|
106
|
+
return this.requestJson('GET', '/v0/management/api-keys', undefined, undefined, 'management');
|
|
107
|
+
}
|
|
108
|
+
putApiKeys(body) {
|
|
109
|
+
return this.requestJson('PUT', '/v0/management/api-keys', body, undefined, 'management');
|
|
110
|
+
}
|
|
111
|
+
patchApiKeys(body) {
|
|
112
|
+
return this.requestJson('PATCH', '/v0/management/api-keys', body, undefined, 'management');
|
|
113
|
+
}
|
|
114
|
+
deleteApiKeys(query) {
|
|
115
|
+
return this.requestJson('DELETE', '/v0/management/api-keys', undefined, { query }, 'management');
|
|
116
|
+
}
|
|
117
|
+
getGeminiKeys() {
|
|
118
|
+
return this.requestJson('GET', '/v0/management/gemini-api-key', undefined, undefined, 'management');
|
|
119
|
+
}
|
|
120
|
+
putGeminiKeys(body) {
|
|
121
|
+
return this.requestJson('PUT', '/v0/management/gemini-api-key', body, undefined, 'management');
|
|
122
|
+
}
|
|
123
|
+
patchGeminiKey(body) {
|
|
124
|
+
return this.requestJson('PATCH', '/v0/management/gemini-api-key', body, undefined, 'management');
|
|
125
|
+
}
|
|
126
|
+
deleteGeminiKey(query) {
|
|
127
|
+
return this.requestJson('DELETE', '/v0/management/gemini-api-key', undefined, { query }, 'management');
|
|
128
|
+
}
|
|
129
|
+
getLogs(query) {
|
|
130
|
+
return this.requestJson('GET', '/v0/management/logs', undefined, { query }, 'management');
|
|
131
|
+
}
|
|
132
|
+
deleteLogs() {
|
|
133
|
+
return this.requestJson('DELETE', '/v0/management/logs', undefined, undefined, 'management');
|
|
134
|
+
}
|
|
135
|
+
getRequestErrorLogs() {
|
|
136
|
+
return this.requestJson('GET', '/v0/management/request-error-logs', undefined, undefined, 'management');
|
|
137
|
+
}
|
|
138
|
+
downloadRequestErrorLog(name) {
|
|
139
|
+
return this.requestRaw('GET', `/v0/management/request-error-logs/${encodeURIComponent(name)}`, undefined, undefined, 'management');
|
|
140
|
+
}
|
|
141
|
+
getRequestLogById(id) {
|
|
142
|
+
return this.requestRaw('GET', `/v0/management/request-log-by-id/${encodeURIComponent(id)}`, undefined, undefined, 'management');
|
|
143
|
+
}
|
|
144
|
+
getRequestLog() {
|
|
145
|
+
return this.requestJson('GET', '/v0/management/request-log', undefined, undefined, 'management');
|
|
146
|
+
}
|
|
147
|
+
putRequestLog(body) {
|
|
148
|
+
return this.requestJson('PUT', '/v0/management/request-log', body, undefined, 'management');
|
|
149
|
+
}
|
|
150
|
+
patchRequestLog(body) {
|
|
151
|
+
return this.requestJson('PATCH', '/v0/management/request-log', body, undefined, 'management');
|
|
152
|
+
}
|
|
153
|
+
getWebsocketAuth() {
|
|
154
|
+
return this.requestJson('GET', '/v0/management/ws-auth', undefined, undefined, 'management');
|
|
155
|
+
}
|
|
156
|
+
putWebsocketAuth(body) {
|
|
157
|
+
return this.requestJson('PUT', '/v0/management/ws-auth', body, undefined, 'management');
|
|
158
|
+
}
|
|
159
|
+
patchWebsocketAuth(body) {
|
|
160
|
+
return this.requestJson('PATCH', '/v0/management/ws-auth', body, undefined, 'management');
|
|
161
|
+
}
|
|
162
|
+
getAmpCode() {
|
|
163
|
+
return this.requestJson('GET', '/v0/management/ampcode', undefined, undefined, 'management');
|
|
164
|
+
}
|
|
165
|
+
getAmpUpstreamUrl() {
|
|
166
|
+
return this.requestJson('GET', '/v0/management/ampcode/upstream-url', undefined, undefined, 'management');
|
|
167
|
+
}
|
|
168
|
+
putAmpUpstreamUrl(body) {
|
|
169
|
+
return this.requestJson('PUT', '/v0/management/ampcode/upstream-url', body, undefined, 'management');
|
|
170
|
+
}
|
|
171
|
+
patchAmpUpstreamUrl(body) {
|
|
172
|
+
return this.requestJson('PATCH', '/v0/management/ampcode/upstream-url', body, undefined, 'management');
|
|
173
|
+
}
|
|
174
|
+
deleteAmpUpstreamUrl() {
|
|
175
|
+
return this.requestJson('DELETE', '/v0/management/ampcode/upstream-url', undefined, undefined, 'management');
|
|
176
|
+
}
|
|
177
|
+
getAmpUpstreamApiKey() {
|
|
178
|
+
return this.requestJson('GET', '/v0/management/ampcode/upstream-api-key', undefined, undefined, 'management');
|
|
179
|
+
}
|
|
180
|
+
putAmpUpstreamApiKey(body) {
|
|
181
|
+
return this.requestJson('PUT', '/v0/management/ampcode/upstream-api-key', body, undefined, 'management');
|
|
182
|
+
}
|
|
183
|
+
patchAmpUpstreamApiKey(body) {
|
|
184
|
+
return this.requestJson('PATCH', '/v0/management/ampcode/upstream-api-key', body, undefined, 'management');
|
|
185
|
+
}
|
|
186
|
+
deleteAmpUpstreamApiKey() {
|
|
187
|
+
return this.requestJson('DELETE', '/v0/management/ampcode/upstream-api-key', undefined, undefined, 'management');
|
|
188
|
+
}
|
|
189
|
+
getAmpRestrictManagementToLocalhost() {
|
|
190
|
+
return this.requestJson('GET', '/v0/management/ampcode/restrict-management-to-localhost', undefined, undefined, 'management');
|
|
191
|
+
}
|
|
192
|
+
putAmpRestrictManagementToLocalhost(body) {
|
|
193
|
+
return this.requestJson('PUT', '/v0/management/ampcode/restrict-management-to-localhost', body, undefined, 'management');
|
|
194
|
+
}
|
|
195
|
+
patchAmpRestrictManagementToLocalhost(body) {
|
|
196
|
+
return this.requestJson('PATCH', '/v0/management/ampcode/restrict-management-to-localhost', body, undefined, 'management');
|
|
197
|
+
}
|
|
198
|
+
getAmpModelMappings() {
|
|
199
|
+
return this.requestJson('GET', '/v0/management/ampcode/model-mappings', undefined, undefined, 'management');
|
|
200
|
+
}
|
|
201
|
+
putAmpModelMappings(body) {
|
|
202
|
+
return this.requestJson('PUT', '/v0/management/ampcode/model-mappings', body, undefined, 'management');
|
|
203
|
+
}
|
|
204
|
+
patchAmpModelMappings(body) {
|
|
205
|
+
return this.requestJson('PATCH', '/v0/management/ampcode/model-mappings', body, undefined, 'management');
|
|
206
|
+
}
|
|
207
|
+
deleteAmpModelMappings(query) {
|
|
208
|
+
return this.requestJson('DELETE', '/v0/management/ampcode/model-mappings', undefined, { query }, 'management');
|
|
209
|
+
}
|
|
210
|
+
getAmpForceModelMappings() {
|
|
211
|
+
return this.requestJson('GET', '/v0/management/ampcode/force-model-mappings', undefined, undefined, 'management');
|
|
212
|
+
}
|
|
213
|
+
putAmpForceModelMappings(body) {
|
|
214
|
+
return this.requestJson('PUT', '/v0/management/ampcode/force-model-mappings', body, undefined, 'management');
|
|
215
|
+
}
|
|
216
|
+
patchAmpForceModelMappings(body) {
|
|
217
|
+
return this.requestJson('PATCH', '/v0/management/ampcode/force-model-mappings', body, undefined, 'management');
|
|
218
|
+
}
|
|
219
|
+
getAmpUpstreamApiKeys() {
|
|
220
|
+
return this.requestJson('GET', '/v0/management/ampcode/upstream-api-keys', undefined, undefined, 'management');
|
|
221
|
+
}
|
|
222
|
+
putAmpUpstreamApiKeys(body) {
|
|
223
|
+
return this.requestJson('PUT', '/v0/management/ampcode/upstream-api-keys', body, undefined, 'management');
|
|
224
|
+
}
|
|
225
|
+
patchAmpUpstreamApiKeys(body) {
|
|
226
|
+
return this.requestJson('PATCH', '/v0/management/ampcode/upstream-api-keys', body, undefined, 'management');
|
|
227
|
+
}
|
|
228
|
+
deleteAmpUpstreamApiKeys(query) {
|
|
229
|
+
return this.requestJson('DELETE', '/v0/management/ampcode/upstream-api-keys', undefined, { query }, 'management');
|
|
230
|
+
}
|
|
231
|
+
getRequestRetry() {
|
|
232
|
+
return this.requestJson('GET', '/v0/management/request-retry', undefined, undefined, 'management');
|
|
233
|
+
}
|
|
234
|
+
putRequestRetry(body) {
|
|
235
|
+
return this.requestJson('PUT', '/v0/management/request-retry', body, undefined, 'management');
|
|
236
|
+
}
|
|
237
|
+
patchRequestRetry(body) {
|
|
238
|
+
return this.requestJson('PATCH', '/v0/management/request-retry', body, undefined, 'management');
|
|
239
|
+
}
|
|
240
|
+
getMaxRetryInterval() {
|
|
241
|
+
return this.requestJson('GET', '/v0/management/max-retry-interval', undefined, undefined, 'management');
|
|
242
|
+
}
|
|
243
|
+
putMaxRetryInterval(body) {
|
|
244
|
+
return this.requestJson('PUT', '/v0/management/max-retry-interval', body, undefined, 'management');
|
|
245
|
+
}
|
|
246
|
+
patchMaxRetryInterval(body) {
|
|
247
|
+
return this.requestJson('PATCH', '/v0/management/max-retry-interval', body, undefined, 'management');
|
|
248
|
+
}
|
|
249
|
+
getForceModelPrefix() {
|
|
250
|
+
return this.requestJson('GET', '/v0/management/force-model-prefix', undefined, undefined, 'management');
|
|
251
|
+
}
|
|
252
|
+
putForceModelPrefix(body) {
|
|
253
|
+
return this.requestJson('PUT', '/v0/management/force-model-prefix', body, undefined, 'management');
|
|
254
|
+
}
|
|
255
|
+
patchForceModelPrefix(body) {
|
|
256
|
+
return this.requestJson('PATCH', '/v0/management/force-model-prefix', body, undefined, 'management');
|
|
257
|
+
}
|
|
258
|
+
getRoutingStrategy() {
|
|
259
|
+
return this.requestJson('GET', '/v0/management/routing/strategy', undefined, undefined, 'management');
|
|
260
|
+
}
|
|
261
|
+
putRoutingStrategy(body) {
|
|
262
|
+
return this.requestJson('PUT', '/v0/management/routing/strategy', body, undefined, 'management');
|
|
263
|
+
}
|
|
264
|
+
patchRoutingStrategy(body) {
|
|
265
|
+
return this.requestJson('PATCH', '/v0/management/routing/strategy', body, undefined, 'management');
|
|
266
|
+
}
|
|
267
|
+
getClaudeKeys() {
|
|
268
|
+
return this.requestJson('GET', '/v0/management/claude-api-key', undefined, undefined, 'management');
|
|
269
|
+
}
|
|
270
|
+
putClaudeKeys(body) {
|
|
271
|
+
return this.requestJson('PUT', '/v0/management/claude-api-key', body, undefined, 'management');
|
|
272
|
+
}
|
|
273
|
+
patchClaudeKey(body) {
|
|
274
|
+
return this.requestJson('PATCH', '/v0/management/claude-api-key', body, undefined, 'management');
|
|
275
|
+
}
|
|
276
|
+
deleteClaudeKey(query) {
|
|
277
|
+
return this.requestJson('DELETE', '/v0/management/claude-api-key', undefined, { query }, 'management');
|
|
278
|
+
}
|
|
279
|
+
getCodexKeys() {
|
|
280
|
+
return this.requestJson('GET', '/v0/management/codex-api-key', undefined, undefined, 'management');
|
|
281
|
+
}
|
|
282
|
+
putCodexKeys(body) {
|
|
283
|
+
return this.requestJson('PUT', '/v0/management/codex-api-key', body, undefined, 'management');
|
|
284
|
+
}
|
|
285
|
+
patchCodexKey(body) {
|
|
286
|
+
return this.requestJson('PATCH', '/v0/management/codex-api-key', body, undefined, 'management');
|
|
287
|
+
}
|
|
288
|
+
deleteCodexKey(query) {
|
|
289
|
+
return this.requestJson('DELETE', '/v0/management/codex-api-key', undefined, { query }, 'management');
|
|
290
|
+
}
|
|
291
|
+
getOpenAICompatibility() {
|
|
292
|
+
return this.requestJson('GET', '/v0/management/openai-compatibility', undefined, undefined, 'management');
|
|
293
|
+
}
|
|
294
|
+
putOpenAICompatibility(body) {
|
|
295
|
+
return this.requestJson('PUT', '/v0/management/openai-compatibility', body, undefined, 'management');
|
|
296
|
+
}
|
|
297
|
+
patchOpenAICompatibility(body) {
|
|
298
|
+
return this.requestJson('PATCH', '/v0/management/openai-compatibility', body, undefined, 'management');
|
|
299
|
+
}
|
|
300
|
+
deleteOpenAICompatibility(query) {
|
|
301
|
+
return this.requestJson('DELETE', '/v0/management/openai-compatibility', undefined, { query }, 'management');
|
|
302
|
+
}
|
|
303
|
+
getVertexCompatKeys() {
|
|
304
|
+
return this.requestJson('GET', '/v0/management/vertex-api-key', undefined, undefined, 'management');
|
|
305
|
+
}
|
|
306
|
+
putVertexCompatKeys(body) {
|
|
307
|
+
return this.requestJson('PUT', '/v0/management/vertex-api-key', body, undefined, 'management');
|
|
308
|
+
}
|
|
309
|
+
patchVertexCompatKey(body) {
|
|
310
|
+
return this.requestJson('PATCH', '/v0/management/vertex-api-key', body, undefined, 'management');
|
|
311
|
+
}
|
|
312
|
+
deleteVertexCompatKey(query) {
|
|
313
|
+
return this.requestJson('DELETE', '/v0/management/vertex-api-key', undefined, { query }, 'management');
|
|
314
|
+
}
|
|
315
|
+
getOAuthExcludedModels() {
|
|
316
|
+
return this.requestJson('GET', '/v0/management/oauth-excluded-models', undefined, undefined, 'management');
|
|
317
|
+
}
|
|
318
|
+
putOAuthExcludedModels(body) {
|
|
319
|
+
return this.requestJson('PUT', '/v0/management/oauth-excluded-models', body, undefined, 'management');
|
|
320
|
+
}
|
|
321
|
+
patchOAuthExcludedModels(body) {
|
|
322
|
+
return this.requestJson('PATCH', '/v0/management/oauth-excluded-models', body, undefined, 'management');
|
|
323
|
+
}
|
|
324
|
+
deleteOAuthExcludedModels(query) {
|
|
325
|
+
return this.requestJson('DELETE', '/v0/management/oauth-excluded-models', undefined, { query }, 'management');
|
|
326
|
+
}
|
|
327
|
+
getOAuthModelAlias() {
|
|
328
|
+
return this.requestJson('GET', '/v0/management/oauth-model-alias', undefined, undefined, 'management');
|
|
329
|
+
}
|
|
330
|
+
putOAuthModelAlias(body) {
|
|
331
|
+
return this.requestJson('PUT', '/v0/management/oauth-model-alias', body, undefined, 'management');
|
|
332
|
+
}
|
|
333
|
+
patchOAuthModelAlias(body) {
|
|
334
|
+
return this.requestJson('PATCH', '/v0/management/oauth-model-alias', body, undefined, 'management');
|
|
335
|
+
}
|
|
336
|
+
deleteOAuthModelAlias(query) {
|
|
337
|
+
return this.requestJson('DELETE', '/v0/management/oauth-model-alias', undefined, { query }, 'management');
|
|
338
|
+
}
|
|
339
|
+
listAuthFiles(query) {
|
|
340
|
+
return this.requestJson('GET', '/v0/management/auth-files', undefined, { query: query }, 'management');
|
|
341
|
+
}
|
|
342
|
+
getAuthFileModels(query) {
|
|
343
|
+
return this.requestJson('GET', '/v0/management/auth-files/models', undefined, { query: query }, 'management');
|
|
344
|
+
}
|
|
345
|
+
getStaticModelDefinitions(channel) {
|
|
346
|
+
return this.requestRaw('GET', `/v0/management/model-definitions/${encodeURIComponent(channel)}`, undefined, undefined, 'management');
|
|
347
|
+
}
|
|
348
|
+
downloadAuthFile(query) {
|
|
349
|
+
return this.requestRaw('GET', '/v0/management/auth-files/download', undefined, { query }, 'management');
|
|
350
|
+
}
|
|
351
|
+
uploadAuthFile(file, name) {
|
|
352
|
+
const form = new FormData();
|
|
353
|
+
form.append('file', file);
|
|
354
|
+
if (name)
|
|
355
|
+
form.append('name', name);
|
|
356
|
+
return this.requestRaw('POST', '/v0/management/auth-files', form, undefined, 'management');
|
|
357
|
+
}
|
|
358
|
+
deleteAuthFile(query) {
|
|
359
|
+
return this.requestJson('DELETE', '/v0/management/auth-files', undefined, { query }, 'management');
|
|
360
|
+
}
|
|
361
|
+
patchAuthFileStatus(body) {
|
|
362
|
+
return this.requestJson('PATCH', '/v0/management/auth-files/status', body, undefined, 'management');
|
|
363
|
+
}
|
|
364
|
+
importVertexCredential(file) {
|
|
365
|
+
const form = new FormData();
|
|
366
|
+
form.append('file', file);
|
|
367
|
+
return this.requestRaw('POST', '/v0/management/vertex/import', form, undefined, 'management');
|
|
368
|
+
}
|
|
369
|
+
requestAnthropicAuthUrl() {
|
|
370
|
+
return this.requestJson('GET', '/v0/management/anthropic-auth-url', undefined, undefined, 'management');
|
|
371
|
+
}
|
|
372
|
+
requestCodexAuthUrl() {
|
|
373
|
+
return this.requestJson('GET', '/v0/management/codex-auth-url', undefined, undefined, 'management');
|
|
374
|
+
}
|
|
375
|
+
requestGeminiCliAuthUrl() {
|
|
376
|
+
return this.requestJson('GET', '/v0/management/gemini-cli-auth-url', undefined, undefined, 'management');
|
|
377
|
+
}
|
|
378
|
+
requestAntigravityAuthUrl() {
|
|
379
|
+
return this.requestJson('GET', '/v0/management/antigravity-auth-url', undefined, undefined, 'management');
|
|
380
|
+
}
|
|
381
|
+
requestQwenAuthUrl() {
|
|
382
|
+
return this.requestJson('GET', '/v0/management/qwen-auth-url', undefined, undefined, 'management');
|
|
383
|
+
}
|
|
384
|
+
requestKimiAuthUrl() {
|
|
385
|
+
return this.requestJson('GET', '/v0/management/kimi-auth-url', undefined, undefined, 'management');
|
|
386
|
+
}
|
|
387
|
+
requestIFlowAuthUrl() {
|
|
388
|
+
return this.requestJson('GET', '/v0/management/iflow-auth-url', undefined, undefined, 'management');
|
|
389
|
+
}
|
|
390
|
+
requestIFlowCookieToken(body) {
|
|
391
|
+
return this.requestJson('POST', '/v0/management/iflow-auth-url', body, undefined, 'management');
|
|
392
|
+
}
|
|
393
|
+
postOAuthCallback(body) {
|
|
394
|
+
return this.requestJson('POST', '/v0/management/oauth-callback', body, undefined, 'management');
|
|
395
|
+
}
|
|
396
|
+
getAuthStatus(query) {
|
|
397
|
+
return this.requestJson('GET', '/v0/management/get-auth-status', undefined, { query }, 'management');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ManagementClient } from './client.js';
|
|
2
|
+
export type { SDKConfig, StreamingConfig, AccessConfig, AccessProvider, TLSConfig, PprofConfig, RemoteManagementConfig, QuotaExceededConfig, RoutingConfig, OAuthModelAlias, AmpModelMapping, AmpUpstreamAPIKeyEntry, AmpCodeConfig, PayloadConfig, PayloadFilterRule, PayloadRule, PayloadModelRule, CloakConfig, ClaudeModel, ClaudeKey, CodexModel, CodexKey, GeminiModel, GeminiKey, OpenAICompatibilityAPIKey, OpenAICompatibilityModel, OpenAICompatibility, VertexCompatModel, VertexCompatKey, Config, UsageTokenStats, UsageRequestDetail, UsageModelSnapshot, UsageApiSnapshot, UsageStatisticsSnapshot, UsageGetResponse, UsageExportResponse, UsageImportRequest, UsageImportResponse, ApiCallRequest, ApiCallResponse, ErrorResponse, StatusResponse, LogLinesResponse, DeleteLogsResponse, ErrorLogFileInfo, ErrorLogFilesResponse, AuthFileEntry, AuthFileListResponse, AuthFileModelsResponse, AuthFileUploadResponse, AuthFileDeleteResponse, AuthFileStatusRequest, AuthFileStatusResponse, OAuthCallbackRequest, OAuthCallbackResponse, OAuthStartResponse, AuthStatusResponse, AuthFileDownloadRequest, AuthFileListQuery, AuthFileModelsQuery, PatchStringListRequest, PatchByIndexOrMatch, GeminiKeyPatch, ClaudeKeyPatch, CodexKeyPatch, OpenAICompatPatch, VertexCompatPatch, OAuthExcludedModelsPatch, OAuthModelAliasPatch, AmpModelMappingsPatch, AmpUpstreamAPIKeysPatch, AmpStringListPatch, AuthFileUploadRequest, VertexImportRequest, RootResponse, KeepAliveResponse, ModelThinkingSupport, ModelInfo, ModelListResponse } from '../shared/types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ManagementClient } from './client.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModelListResponse, OpenAIChatCompletionRequest, OpenAICompletionRequest, OpenAIResponsesRequest } from '../shared/types.js';
|
|
2
|
+
import type { RequestOptions } from '../shared/http.js';
|
|
3
|
+
import { BaseHttpClient } from '../shared/http.js';
|
|
4
|
+
export declare class OpenAIClient extends BaseHttpClient {
|
|
5
|
+
getModels(options?: RequestOptions): Promise<ModelListResponse>;
|
|
6
|
+
postChatCompletions(body: OpenAIChatCompletionRequest, options?: RequestOptions): Promise<Response>;
|
|
7
|
+
postCompletions(body: OpenAICompletionRequest, options?: RequestOptions): Promise<Response>;
|
|
8
|
+
postResponses(body: OpenAIResponsesRequest, options?: RequestOptions): Promise<Response>;
|
|
9
|
+
postResponsesCompact(body: OpenAIResponsesRequest, options?: RequestOptions): Promise<Response>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseHttpClient } from '../shared/http.js';
|
|
2
|
+
export class OpenAIClient extends BaseHttpClient {
|
|
3
|
+
// GET /v1/models (OpenAI or Claude depending on User-Agent)
|
|
4
|
+
getModels(options) {
|
|
5
|
+
return this.requestJson('GET', '/v1/models', undefined, options, 'access');
|
|
6
|
+
}
|
|
7
|
+
// POST /v1/chat/completions
|
|
8
|
+
postChatCompletions(body, options) {
|
|
9
|
+
return this.requestRaw('POST', '/v1/chat/completions', JSON.stringify(body), options, 'access');
|
|
10
|
+
}
|
|
11
|
+
// POST /v1/completions
|
|
12
|
+
postCompletions(body, options) {
|
|
13
|
+
return this.requestRaw('POST', '/v1/completions', JSON.stringify(body), options, 'access');
|
|
14
|
+
}
|
|
15
|
+
// POST /v1/responses
|
|
16
|
+
postResponses(body, options) {
|
|
17
|
+
return this.requestRaw('POST', '/v1/responses', JSON.stringify(body), options, 'access');
|
|
18
|
+
}
|
|
19
|
+
// POST /v1/responses/compact
|
|
20
|
+
postResponsesCompact(body, options) {
|
|
21
|
+
return this.requestRaw('POST', '/v1/responses/compact', JSON.stringify(body), options, 'access');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { OpenAIClient } from './client.js';
|
|
2
|
+
export type { OpenAIChatRole, OpenAIChatMessageContentText, OpenAIChatMessageContentImageUrl, OpenAIChatMessageContentPart, OpenAIChatMessage, OpenAIChatCompletionRequest, OpenAICompletionRequest, OpenAIResponsesInputText, OpenAIResponsesInputImage, OpenAIResponsesInputContent, OpenAIResponsesInputMessage, OpenAIResponsesRequest, OpenAIChatCompletionChoice, OpenAIChatCompletionResponse, OpenAIChatCompletionChunkChoice, OpenAIChatCompletionChunk, OpenAICompletionChoice, OpenAICompletionResponse, OpenAICompletionChunk, OpenAIResponsesOutput, OpenAIResponsesResponse, OpenAIResponsesChunk, OpenAICompatibleRequest, OpenAICompatibleResponse, OpenAIErrorDetail, OpenAIErrorResponse } from '../shared/types.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OpenAIClient } from './client.js';
|