@zorveus/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 +236 -0
- package/dist/index.d.mts +919 -0
- package/dist/index.d.ts +919 -0
- package/dist/index.js +1205 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1158 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +34 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,919 @@
|
|
|
1
|
+
interface ZorveusInferenceClientOptions {
|
|
2
|
+
/**
|
|
3
|
+
* API Key used for gateway inference.
|
|
4
|
+
* Accepts an Inference Key (`zrv_...`) or an API Key issued via OAuth code exchange (`access_token`).
|
|
5
|
+
*/
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/**
|
|
8
|
+
* Base URL for the Zorveus API Control Plane.
|
|
9
|
+
* @default "https://api.zorveus.com"
|
|
10
|
+
*/
|
|
11
|
+
baseURL?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Base URL for the Zorveus Inference Gateway (Data Plane).
|
|
14
|
+
* @default "https://api.zorveus.com/v1"
|
|
15
|
+
*/
|
|
16
|
+
gatewayBaseURL?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Request timeout in milliseconds.
|
|
19
|
+
* @default 60000 (60 seconds)
|
|
20
|
+
*/
|
|
21
|
+
timeout?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of request retries on rate limits (429) or transient 5xx errors for idempotent operations.
|
|
24
|
+
* @default 2
|
|
25
|
+
*/
|
|
26
|
+
maxRetries?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Default headers merged into every outgoing HTTP request.
|
|
29
|
+
*/
|
|
30
|
+
defaultHeaders?: Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional custom fetch implementation (defaults to globalThis.fetch).
|
|
33
|
+
*/
|
|
34
|
+
fetch?: typeof globalThis.fetch;
|
|
35
|
+
}
|
|
36
|
+
interface ZorveusServiceClientOptions {
|
|
37
|
+
/**
|
|
38
|
+
* Organization Service Key used for server-side management authentication (`zrv_service_...`).
|
|
39
|
+
* WARNING: Never expose this key in browser client applications.
|
|
40
|
+
*/
|
|
41
|
+
apiKey: string;
|
|
42
|
+
/**
|
|
43
|
+
* Base URL for the Zorveus Management Control Plane API.
|
|
44
|
+
* @default "https://api.zorveus.com"
|
|
45
|
+
*/
|
|
46
|
+
baseURL?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Request timeout in milliseconds.
|
|
49
|
+
* @default 60000 (60 seconds)
|
|
50
|
+
*/
|
|
51
|
+
timeout?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum number of request retries for idempotent operations.
|
|
54
|
+
* @default 2
|
|
55
|
+
*/
|
|
56
|
+
maxRetries?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Default headers merged into every outgoing HTTP request.
|
|
59
|
+
*/
|
|
60
|
+
defaultHeaders?: Record<string, string>;
|
|
61
|
+
/**
|
|
62
|
+
* Optional custom fetch implementation.
|
|
63
|
+
*/
|
|
64
|
+
fetch?: typeof globalThis.fetch;
|
|
65
|
+
}
|
|
66
|
+
type ZorveusClientOptions = ZorveusInferenceClientOptions;
|
|
67
|
+
interface RequestOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Request timeout in milliseconds.
|
|
70
|
+
*/
|
|
71
|
+
timeout?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Custom headers for this specific request.
|
|
74
|
+
*/
|
|
75
|
+
headers?: Record<string, string>;
|
|
76
|
+
/**
|
|
77
|
+
* Maximum retries for this specific request.
|
|
78
|
+
*/
|
|
79
|
+
maxRetries?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Explicitly mark non-GET request as idempotent to enable automatic retries.
|
|
82
|
+
*/
|
|
83
|
+
isIdempotent?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Optional Idempotency key header.
|
|
86
|
+
*/
|
|
87
|
+
idempotencyKey?: string;
|
|
88
|
+
/**
|
|
89
|
+
* AbortSignal for external request cancellation.
|
|
90
|
+
*/
|
|
91
|
+
signal?: AbortSignal;
|
|
92
|
+
}
|
|
93
|
+
interface InferenceKeyUsageResponse {
|
|
94
|
+
status: "active" | "inactive" | "suspended" | string;
|
|
95
|
+
app_id: string | null;
|
|
96
|
+
app_connection_id: string | null;
|
|
97
|
+
currency: string;
|
|
98
|
+
period: "daily" | "weekly" | "monthly" | "lifetime" | string;
|
|
99
|
+
spend_cap: string | null;
|
|
100
|
+
spent_this_period: string;
|
|
101
|
+
remaining_balance: string | null;
|
|
102
|
+
reset_at: string | null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface HttpRequestOptions extends RequestOptions {
|
|
106
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
|
|
107
|
+
body?: unknown;
|
|
108
|
+
query?: Record<string, unknown>;
|
|
109
|
+
isGateway?: boolean;
|
|
110
|
+
stream?: boolean;
|
|
111
|
+
}
|
|
112
|
+
declare class HTTPTransport {
|
|
113
|
+
readonly apiKey: string;
|
|
114
|
+
readonly baseURL: string;
|
|
115
|
+
readonly gatewayBaseURL: string;
|
|
116
|
+
readonly timeout: number;
|
|
117
|
+
readonly maxRetries: number;
|
|
118
|
+
readonly defaultHeaders: Record<string, string>;
|
|
119
|
+
readonly fetchFn: typeof globalThis.fetch;
|
|
120
|
+
constructor(options: {
|
|
121
|
+
apiKey: string;
|
|
122
|
+
baseURL?: string;
|
|
123
|
+
gatewayBaseURL?: string;
|
|
124
|
+
timeout?: number;
|
|
125
|
+
maxRetries?: number;
|
|
126
|
+
defaultHeaders?: Record<string, string>;
|
|
127
|
+
fetch?: typeof globalThis.fetch;
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* Executes an HTTP request with timeout, strict idempotency-aware retries, and error mapping.
|
|
131
|
+
*/
|
|
132
|
+
request<T>(path: string, options?: HttpRequestOptions): Promise<T>;
|
|
133
|
+
private buildUrl;
|
|
134
|
+
private parseResponseBody;
|
|
135
|
+
private extractHeaders;
|
|
136
|
+
private shouldRetryStatus;
|
|
137
|
+
private calculateRetryDelay;
|
|
138
|
+
private sleep;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
type ChatCompletionRole = "system" | "user" | "assistant" | "tool" | "function";
|
|
142
|
+
interface ChatMessageToolCall {
|
|
143
|
+
id: string;
|
|
144
|
+
type: "function";
|
|
145
|
+
function: {
|
|
146
|
+
name: string;
|
|
147
|
+
arguments: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
interface ChatMessage {
|
|
151
|
+
role: ChatCompletionRole;
|
|
152
|
+
content: string | null;
|
|
153
|
+
name?: string;
|
|
154
|
+
tool_call_id?: string;
|
|
155
|
+
tool_calls?: ChatMessageToolCall[];
|
|
156
|
+
}
|
|
157
|
+
interface ChatCompletionTool {
|
|
158
|
+
type: "function";
|
|
159
|
+
function: {
|
|
160
|
+
name: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
parameters?: Record<string, unknown>;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
interface ZorveusMetadata {
|
|
166
|
+
/**
|
|
167
|
+
* The startup's external customer ID (e.g. "usr_ext_8842").
|
|
168
|
+
*/
|
|
169
|
+
externalUserId?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Customer's display name.
|
|
172
|
+
*/
|
|
173
|
+
displayName?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Customer's email.
|
|
176
|
+
*/
|
|
177
|
+
userEmail?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Custom metadata key-value pairs (e.g. `{ plan: "pro", teamId: "team_402" }`).
|
|
180
|
+
*/
|
|
181
|
+
metadata?: Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
interface ZorveusGatewayProductUserMetadata {
|
|
184
|
+
display_name?: string | null;
|
|
185
|
+
email?: string | null;
|
|
186
|
+
metadata?: Record<string, unknown> | null;
|
|
187
|
+
}
|
|
188
|
+
interface ZorveusGatewayMetadata {
|
|
189
|
+
external_user_id?: string;
|
|
190
|
+
product_user?: ZorveusGatewayProductUserMetadata;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Formats SDK metadata into Gateway request body contract format.
|
|
194
|
+
*/
|
|
195
|
+
declare function formatGatewayMetadata(meta?: ZorveusMetadata): ZorveusGatewayMetadata | undefined;
|
|
196
|
+
interface ChatCompletionCreateParamsBase {
|
|
197
|
+
model: string;
|
|
198
|
+
messages: ChatMessage[];
|
|
199
|
+
temperature?: number;
|
|
200
|
+
top_p?: number;
|
|
201
|
+
n?: number;
|
|
202
|
+
max_tokens?: number;
|
|
203
|
+
max_completion_tokens?: number;
|
|
204
|
+
stop?: string | string[];
|
|
205
|
+
presence_penalty?: number;
|
|
206
|
+
frequency_penalty?: number;
|
|
207
|
+
logit_bias?: Record<string, number>;
|
|
208
|
+
user?: string;
|
|
209
|
+
tools?: ChatCompletionTool[];
|
|
210
|
+
tool_choice?: "none" | "auto" | "required" | {
|
|
211
|
+
type: "function";
|
|
212
|
+
function: {
|
|
213
|
+
name: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
response_format?: {
|
|
217
|
+
type: "text" | "json_object" | "json_schema";
|
|
218
|
+
json_schema?: Record<string, unknown>;
|
|
219
|
+
};
|
|
220
|
+
seed?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Inline Zorveus product-user metadata attribution.
|
|
223
|
+
*/
|
|
224
|
+
zorveusMetadata?: ZorveusMetadata;
|
|
225
|
+
/**
|
|
226
|
+
* Gateway request body metadata payload override.
|
|
227
|
+
*/
|
|
228
|
+
metadata?: Record<string, unknown>;
|
|
229
|
+
}
|
|
230
|
+
interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
|
|
231
|
+
stream?: false;
|
|
232
|
+
}
|
|
233
|
+
interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
|
|
234
|
+
stream: true;
|
|
235
|
+
}
|
|
236
|
+
type ChatCompletionCreateParams = ChatCompletionCreateParamsNonStreaming | ChatCompletionCreateParamsStreaming;
|
|
237
|
+
interface ChatCompletionChoice {
|
|
238
|
+
index: number;
|
|
239
|
+
message: ChatMessage;
|
|
240
|
+
finish_reason: "stop" | "length" | "tool_calls" | "content_filter" | "function_call" | null;
|
|
241
|
+
logprobs?: unknown;
|
|
242
|
+
}
|
|
243
|
+
interface ChatCompletionChunkChoiceDelta {
|
|
244
|
+
role?: ChatCompletionRole;
|
|
245
|
+
content?: string | null;
|
|
246
|
+
tool_calls?: Array<{
|
|
247
|
+
index: number;
|
|
248
|
+
id?: string;
|
|
249
|
+
type?: "function";
|
|
250
|
+
function?: {
|
|
251
|
+
name?: string;
|
|
252
|
+
arguments?: string;
|
|
253
|
+
};
|
|
254
|
+
}>;
|
|
255
|
+
}
|
|
256
|
+
interface ChatCompletionChunkChoice {
|
|
257
|
+
index: number;
|
|
258
|
+
delta: ChatCompletionChunkChoiceDelta;
|
|
259
|
+
finish_reason: "stop" | "length" | "tool_calls" | "content_filter" | "function_call" | null;
|
|
260
|
+
logprobs?: unknown;
|
|
261
|
+
}
|
|
262
|
+
interface ChatCompletionUsage {
|
|
263
|
+
prompt_tokens: number;
|
|
264
|
+
completion_tokens: number;
|
|
265
|
+
total_tokens: number;
|
|
266
|
+
prompt_tokens_details?: {
|
|
267
|
+
cached_tokens?: number;
|
|
268
|
+
};
|
|
269
|
+
completion_tokens_details?: {
|
|
270
|
+
reasoning_tokens?: number;
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
interface ChatCompletion {
|
|
274
|
+
id: string;
|
|
275
|
+
object: "chat.completion";
|
|
276
|
+
created: number;
|
|
277
|
+
model: string;
|
|
278
|
+
choices: ChatCompletionChoice[];
|
|
279
|
+
usage?: ChatCompletionUsage;
|
|
280
|
+
system_fingerprint?: string;
|
|
281
|
+
}
|
|
282
|
+
interface ChatCompletionChunk {
|
|
283
|
+
id: string;
|
|
284
|
+
object: "chat.completion.chunk";
|
|
285
|
+
created: number;
|
|
286
|
+
model: string;
|
|
287
|
+
choices: ChatCompletionChunkChoice[];
|
|
288
|
+
usage?: ChatCompletionUsage;
|
|
289
|
+
system_fingerprint?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
declare class Completions {
|
|
293
|
+
private readonly transport;
|
|
294
|
+
constructor(transport: HTTPTransport);
|
|
295
|
+
/**
|
|
296
|
+
* Creates a model response for the given chat conversation.
|
|
297
|
+
* Supports standard single-response and Server-Sent Events (SSE) streaming modes.
|
|
298
|
+
*/
|
|
299
|
+
create(params: ChatCompletionCreateParamsStreaming, options?: RequestOptions): Promise<AsyncIterableIterator<ChatCompletionChunk>>;
|
|
300
|
+
create(params: ChatCompletionCreateParamsNonStreaming, options?: RequestOptions): Promise<ChatCompletion>;
|
|
301
|
+
create(params: ChatCompletionCreateParams, options?: RequestOptions): Promise<ChatCompletion | AsyncIterableIterator<ChatCompletionChunk>>;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare class Chat {
|
|
305
|
+
readonly completions: Completions;
|
|
306
|
+
constructor(transport: HTTPTransport);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
interface EmbeddingCreateParams {
|
|
310
|
+
model: string;
|
|
311
|
+
input: string | string[] | number[] | number[][];
|
|
312
|
+
encoding_format?: "float" | "base64";
|
|
313
|
+
dimensions?: number;
|
|
314
|
+
user?: string;
|
|
315
|
+
/**
|
|
316
|
+
* Inline Zorveus product-user metadata attribution.
|
|
317
|
+
*/
|
|
318
|
+
zorveusMetadata?: ZorveusMetadata;
|
|
319
|
+
}
|
|
320
|
+
interface EmbeddingData {
|
|
321
|
+
index: number;
|
|
322
|
+
object: "embedding";
|
|
323
|
+
embedding: number[];
|
|
324
|
+
}
|
|
325
|
+
interface EmbeddingUsage {
|
|
326
|
+
prompt_tokens: number;
|
|
327
|
+
total_tokens: number;
|
|
328
|
+
}
|
|
329
|
+
interface EmbeddingCreateResponse {
|
|
330
|
+
object: "list";
|
|
331
|
+
data: EmbeddingData[];
|
|
332
|
+
model: string;
|
|
333
|
+
usage: EmbeddingUsage;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
interface Model {
|
|
337
|
+
id: string;
|
|
338
|
+
object: "model";
|
|
339
|
+
created: number;
|
|
340
|
+
owned_by: string;
|
|
341
|
+
provider?: string;
|
|
342
|
+
mode?: string;
|
|
343
|
+
max_input_tokens?: number;
|
|
344
|
+
max_output_tokens?: number;
|
|
345
|
+
route_status?: "available" | "degraded" | "unavailable";
|
|
346
|
+
}
|
|
347
|
+
interface ModelListParams {
|
|
348
|
+
routeStatus?: "available" | "degraded" | "unavailable";
|
|
349
|
+
}
|
|
350
|
+
interface ModelListResponse {
|
|
351
|
+
object: "list";
|
|
352
|
+
data: Model[];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
type ProductUserStatus = "active" | "suspended";
|
|
356
|
+
interface ProductUserCapResponse {
|
|
357
|
+
source: string;
|
|
358
|
+
cap_rule_id: string;
|
|
359
|
+
amount: string;
|
|
360
|
+
currency: string;
|
|
361
|
+
period: "daily" | "weekly" | "monthly" | "lifetime" | string;
|
|
362
|
+
spent_this_period: string;
|
|
363
|
+
reset_at: string | null;
|
|
364
|
+
status: string;
|
|
365
|
+
updated_at: string;
|
|
366
|
+
}
|
|
367
|
+
interface ProductUserUsageMetrics {
|
|
368
|
+
sell_cost: string;
|
|
369
|
+
input_tokens: number;
|
|
370
|
+
output_tokens: number;
|
|
371
|
+
total_tokens: number;
|
|
372
|
+
request_count: number;
|
|
373
|
+
}
|
|
374
|
+
interface ProductUserUsageSummary {
|
|
375
|
+
this_month: ProductUserUsageMetrics;
|
|
376
|
+
total: ProductUserUsageMetrics;
|
|
377
|
+
}
|
|
378
|
+
interface ProductUserCreditSummaryResponse {
|
|
379
|
+
currency: string;
|
|
380
|
+
available_credits: string;
|
|
381
|
+
active_grant_count: number;
|
|
382
|
+
expiring_soon_amount: string;
|
|
383
|
+
spent_this_month: string;
|
|
384
|
+
spent_total: string;
|
|
385
|
+
last_grant_at?: string | null;
|
|
386
|
+
last_used_at?: string | null;
|
|
387
|
+
product_end_user_id?: string;
|
|
388
|
+
total_granted?: string;
|
|
389
|
+
total_remaining?: string;
|
|
390
|
+
active_grants_count?: number;
|
|
391
|
+
}
|
|
392
|
+
interface ProductUserResponse {
|
|
393
|
+
product_end_user_id: string;
|
|
394
|
+
org_id: string;
|
|
395
|
+
app_id: string;
|
|
396
|
+
external_user_id: string;
|
|
397
|
+
display_name: string | null;
|
|
398
|
+
email_hash: string | null;
|
|
399
|
+
status: ProductUserStatus;
|
|
400
|
+
metadata: Record<string, unknown> | null;
|
|
401
|
+
usage?: ProductUserUsageSummary | Record<string, unknown>;
|
|
402
|
+
cap?: ProductUserCapResponse | null;
|
|
403
|
+
credits?: ProductUserCreditSummaryResponse | null;
|
|
404
|
+
}
|
|
405
|
+
type ProductUser = ProductUserResponse;
|
|
406
|
+
interface UpsertProductUserResponse {
|
|
407
|
+
product_user: ProductUserResponse;
|
|
408
|
+
created: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface ProductUserListResponse {
|
|
411
|
+
product_users: ProductUserResponse[];
|
|
412
|
+
}
|
|
413
|
+
interface UpsertProductUserParams {
|
|
414
|
+
orgId?: string;
|
|
415
|
+
appId?: string;
|
|
416
|
+
externalUserId: string;
|
|
417
|
+
displayName?: string | null;
|
|
418
|
+
email?: string | null;
|
|
419
|
+
metadata?: Record<string, unknown> | null;
|
|
420
|
+
}
|
|
421
|
+
interface GetProductUserByExternalIdParams {
|
|
422
|
+
appId: string;
|
|
423
|
+
externalUserId: string;
|
|
424
|
+
orgId?: string;
|
|
425
|
+
}
|
|
426
|
+
interface GetProductUserCreditSummaryByExternalIdParams {
|
|
427
|
+
appId: string;
|
|
428
|
+
externalUserId: string;
|
|
429
|
+
currency?: string;
|
|
430
|
+
orgId?: string;
|
|
431
|
+
}
|
|
432
|
+
type CreditGrantStatus = "active" | "exhausted" | "expired" | "revoked";
|
|
433
|
+
type CreditGrantSource = "admin_adjustment" | "service_key" | "purchase" | "promotion" | "monthly_allowance" | "support_credit" | "import" | (string & {});
|
|
434
|
+
interface ProductUserCreditGrantResponse {
|
|
435
|
+
credit_grant_id: string;
|
|
436
|
+
org_id: string;
|
|
437
|
+
app_id: string;
|
|
438
|
+
product_end_user_id: string;
|
|
439
|
+
amount: string;
|
|
440
|
+
remaining_amount: string;
|
|
441
|
+
currency: string;
|
|
442
|
+
source: string;
|
|
443
|
+
reason: string | null;
|
|
444
|
+
status: CreditGrantStatus;
|
|
445
|
+
expires_at: string | null;
|
|
446
|
+
metadata: Record<string, unknown> | null;
|
|
447
|
+
created_at: string;
|
|
448
|
+
updated_at: string;
|
|
449
|
+
}
|
|
450
|
+
type CreditGrant = ProductUserCreditGrantResponse;
|
|
451
|
+
interface GrantProductUserCreditsResponse {
|
|
452
|
+
product_user: ProductUserResponse;
|
|
453
|
+
credit_grant: ProductUserCreditGrantResponse;
|
|
454
|
+
credit_summary: ProductUserCreditSummaryResponse;
|
|
455
|
+
}
|
|
456
|
+
interface ProductUserCreditGrantListResponse {
|
|
457
|
+
credit_grants: ProductUserCreditGrantResponse[];
|
|
458
|
+
}
|
|
459
|
+
interface RevokeProductUserCreditGrantResponse {
|
|
460
|
+
credit_grant: ProductUserCreditGrantResponse;
|
|
461
|
+
credit_summary: ProductUserCreditSummaryResponse;
|
|
462
|
+
revoked: boolean;
|
|
463
|
+
}
|
|
464
|
+
interface GrantCreditParams {
|
|
465
|
+
orgId?: string;
|
|
466
|
+
appId?: string;
|
|
467
|
+
amount: string;
|
|
468
|
+
currency?: string;
|
|
469
|
+
reason?: string | null;
|
|
470
|
+
expiresAt?: string | null;
|
|
471
|
+
metadata?: Record<string, unknown> | null;
|
|
472
|
+
}
|
|
473
|
+
interface GrantCreditByExternalIdParams {
|
|
474
|
+
appId: string;
|
|
475
|
+
externalUserId: string;
|
|
476
|
+
amount: string;
|
|
477
|
+
displayName?: string | null;
|
|
478
|
+
email?: string | null;
|
|
479
|
+
currency?: string;
|
|
480
|
+
source?: CreditGrantSource;
|
|
481
|
+
reason?: string | null;
|
|
482
|
+
expiresAt?: string | null;
|
|
483
|
+
metadata?: Record<string, unknown> | null;
|
|
484
|
+
orgId?: string;
|
|
485
|
+
}
|
|
486
|
+
interface ListCreditGrantsParams {
|
|
487
|
+
appId?: string;
|
|
488
|
+
orgId?: string;
|
|
489
|
+
limit?: number;
|
|
490
|
+
offset?: number;
|
|
491
|
+
}
|
|
492
|
+
interface ListCreditGrantsByExternalIdParams {
|
|
493
|
+
appId: string;
|
|
494
|
+
externalUserId: string;
|
|
495
|
+
status?: CreditGrantStatus;
|
|
496
|
+
source?: CreditGrantSource;
|
|
497
|
+
limit?: number;
|
|
498
|
+
orgId?: string;
|
|
499
|
+
}
|
|
500
|
+
interface ProductUserListParams {
|
|
501
|
+
orgId?: string;
|
|
502
|
+
limit?: number;
|
|
503
|
+
offset?: number;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
type ProviderCredentialStatus = "active" | "disabled" | "invalid";
|
|
507
|
+
type ProviderCredentialRoutingMode = "auto_resolve" | "manual";
|
|
508
|
+
type ProviderCredentialSecretKind = "api_key" | "service_account" | "oauth_token";
|
|
509
|
+
interface ProviderCredentialResponse {
|
|
510
|
+
provider_credential_id: string;
|
|
511
|
+
org_id: string;
|
|
512
|
+
provider: string;
|
|
513
|
+
credential_name: string;
|
|
514
|
+
status: ProviderCredentialStatus;
|
|
515
|
+
routing_mode: ProviderCredentialRoutingMode;
|
|
516
|
+
routing_priority: number;
|
|
517
|
+
default_model_policy: string[];
|
|
518
|
+
provider_config: Record<string, unknown> | null;
|
|
519
|
+
active_secret_version_id: string | null;
|
|
520
|
+
secret_fingerprint: string | null;
|
|
521
|
+
last_validated_at: string | null;
|
|
522
|
+
last_used_at: string | null;
|
|
523
|
+
}
|
|
524
|
+
type ProviderCredential = ProviderCredentialResponse;
|
|
525
|
+
interface ProviderCredentialListResponse {
|
|
526
|
+
provider_credentials: ProviderCredentialResponse[];
|
|
527
|
+
}
|
|
528
|
+
interface RotateProviderCredentialResponse {
|
|
529
|
+
provider_credential: ProviderCredentialResponse;
|
|
530
|
+
rotated: boolean;
|
|
531
|
+
}
|
|
532
|
+
interface ProviderCredentialProviderInfo {
|
|
533
|
+
provider: string;
|
|
534
|
+
display_name: string;
|
|
535
|
+
supported_auth_types: string[];
|
|
536
|
+
docs_url?: string;
|
|
537
|
+
}
|
|
538
|
+
interface ProviderCredentialProviderCatalogResponse {
|
|
539
|
+
providers: ProviderCredentialProviderInfo[];
|
|
540
|
+
}
|
|
541
|
+
interface CreateProviderCredentialParams {
|
|
542
|
+
orgId?: string;
|
|
543
|
+
provider: string;
|
|
544
|
+
credentialName: string;
|
|
545
|
+
apiKey: string;
|
|
546
|
+
secretKind?: ProviderCredentialSecretKind;
|
|
547
|
+
modelPolicies?: string[];
|
|
548
|
+
providerConfig?: Record<string, unknown> | null;
|
|
549
|
+
routingMode?: ProviderCredentialRoutingMode;
|
|
550
|
+
routingPriority?: number;
|
|
551
|
+
}
|
|
552
|
+
interface RotateProviderCredentialParams {
|
|
553
|
+
orgId?: string;
|
|
554
|
+
apiKey: string;
|
|
555
|
+
secretKind?: ProviderCredentialSecretKind;
|
|
556
|
+
}
|
|
557
|
+
interface ListProviderCredentialsParams {
|
|
558
|
+
orgId?: string;
|
|
559
|
+
status?: string;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
interface PKCEData {
|
|
563
|
+
/**
|
|
564
|
+
* High-entropy cryptographic random string (43-128 chars).
|
|
565
|
+
*/
|
|
566
|
+
codeVerifier: string;
|
|
567
|
+
/**
|
|
568
|
+
* Base64URL-encoded SHA-256 hash of the code_verifier.
|
|
569
|
+
*/
|
|
570
|
+
codeChallenge: string;
|
|
571
|
+
/**
|
|
572
|
+
* Cryptographically secure random state parameter for CSRF protection.
|
|
573
|
+
*/
|
|
574
|
+
state: string;
|
|
575
|
+
}
|
|
576
|
+
interface AuthorizationUrlParams {
|
|
577
|
+
clientId: string;
|
|
578
|
+
redirectUri: string;
|
|
579
|
+
state: string;
|
|
580
|
+
codeChallenge: string;
|
|
581
|
+
scopes?: string[] | string;
|
|
582
|
+
baseURL?: string;
|
|
583
|
+
}
|
|
584
|
+
interface TokenExchangeParams {
|
|
585
|
+
clientId: string;
|
|
586
|
+
clientSecret?: string;
|
|
587
|
+
code: string;
|
|
588
|
+
codeVerifier: string;
|
|
589
|
+
redirectUri: string;
|
|
590
|
+
baseURL?: string;
|
|
591
|
+
}
|
|
592
|
+
interface TokenRevocationParams {
|
|
593
|
+
token: string;
|
|
594
|
+
clientId?: string;
|
|
595
|
+
clientSecret?: string;
|
|
596
|
+
baseURL?: string;
|
|
597
|
+
}
|
|
598
|
+
interface OAuthTokenResponse {
|
|
599
|
+
access_token: string;
|
|
600
|
+
token_type: string;
|
|
601
|
+
expires_in: number | null;
|
|
602
|
+
scope: string;
|
|
603
|
+
app_connection_id: string;
|
|
604
|
+
api_base: string;
|
|
605
|
+
}
|
|
606
|
+
interface CallbackValidationOptions {
|
|
607
|
+
urlOrParams: string | URLSearchParams | Record<string, string>;
|
|
608
|
+
expectedState?: string;
|
|
609
|
+
}
|
|
610
|
+
interface CallbackValidationResult {
|
|
611
|
+
valid: boolean;
|
|
612
|
+
code?: string;
|
|
613
|
+
state?: string;
|
|
614
|
+
error?: string;
|
|
615
|
+
errorDescription?: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
declare class Embeddings {
|
|
619
|
+
private readonly transport;
|
|
620
|
+
constructor(transport: HTTPTransport);
|
|
621
|
+
/**
|
|
622
|
+
* Creates an embedding vector representing the input text.
|
|
623
|
+
*/
|
|
624
|
+
create(params: EmbeddingCreateParams, options?: RequestOptions): Promise<EmbeddingCreateResponse>;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
declare class Models {
|
|
628
|
+
private readonly transport;
|
|
629
|
+
constructor(transport: HTTPTransport);
|
|
630
|
+
/**
|
|
631
|
+
* Lists available models on the Zorveus gateway.
|
|
632
|
+
*/
|
|
633
|
+
list(params?: ModelListParams, options?: RequestOptions): Promise<ModelListResponse>;
|
|
634
|
+
/**
|
|
635
|
+
* Retrieves information about a specific model.
|
|
636
|
+
*/
|
|
637
|
+
retrieve(modelId: string, options?: RequestOptions): Promise<Model>;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Zorveus Inference Client (Gateway Data Plane).
|
|
642
|
+
* Authenticated via Inference Key (`zrv_...`) or API Key issued via OAuth (`access_token`).
|
|
643
|
+
*/
|
|
644
|
+
declare class ZorveusInferenceClient {
|
|
645
|
+
readonly chat: Chat;
|
|
646
|
+
readonly embeddings: Embeddings;
|
|
647
|
+
readonly models: Models;
|
|
648
|
+
protected readonly transport: HTTPTransport;
|
|
649
|
+
constructor(options: ZorveusInferenceClientOptions);
|
|
650
|
+
/**
|
|
651
|
+
* Retrieves live spend, budget cap, and balance for the active inference key (`GET /inference-keys/usage`).
|
|
652
|
+
*/
|
|
653
|
+
getUsage(options?: RequestOptions): Promise<InferenceKeyUsageResponse>;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Primary Zorveus client class for gateway inference.
|
|
657
|
+
*/
|
|
658
|
+
declare class Zorveus extends ZorveusInferenceClient {
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
declare class ProductUsers {
|
|
662
|
+
private readonly transport;
|
|
663
|
+
constructor(transport: HTTPTransport);
|
|
664
|
+
/**
|
|
665
|
+
* Upserts a product user by external user ID (`PUT /product-users/by-external-id`).
|
|
666
|
+
* Creates the user if they do not exist, or updates their profile if they do.
|
|
667
|
+
*/
|
|
668
|
+
createOrUpdate(params: UpsertProductUserParams, options?: RequestOptions): Promise<UpsertProductUserResponse>;
|
|
669
|
+
/**
|
|
670
|
+
* Alias for `createOrUpdate` (`PUT /product-users/by-external-id`).
|
|
671
|
+
*/
|
|
672
|
+
upsert(params: UpsertProductUserParams, options?: RequestOptions): Promise<UpsertProductUserResponse>;
|
|
673
|
+
/**
|
|
674
|
+
* Retrieves a single product end-user by ID (`GET /product-users/{product_end_user_id}`).
|
|
675
|
+
*/
|
|
676
|
+
get(productEndUserId: string, options?: RequestOptions): Promise<ProductUserResponse>;
|
|
677
|
+
/**
|
|
678
|
+
* Retrieves a product user profile by external ID (`GET /product-users/by-external-id`).
|
|
679
|
+
* Returns complete profile with usage, active cap, and live credits.
|
|
680
|
+
*/
|
|
681
|
+
getByExternalId(params: GetProductUserByExternalIdParams, options?: RequestOptions): Promise<ProductUserResponse>;
|
|
682
|
+
/**
|
|
683
|
+
* Retrieves a product user's live credit summary by external ID (`GET /product-users/by-external-id/credit-summary`).
|
|
684
|
+
*/
|
|
685
|
+
getCreditSummaryByExternalId(params: GetProductUserCreditSummaryByExternalIdParams, options?: RequestOptions): Promise<ProductUserCreditSummaryResponse>;
|
|
686
|
+
/**
|
|
687
|
+
* Lists product end-users for an organization (`GET /product-users`).
|
|
688
|
+
*/
|
|
689
|
+
list(params?: ProductUserListParams, options?: RequestOptions): Promise<ProductUserListResponse>;
|
|
690
|
+
/**
|
|
691
|
+
* Grants startup-funded AI credits to a product user (`POST /product-users/{id}/credit-grants`).
|
|
692
|
+
* Validates amount as a strict financial decimal string.
|
|
693
|
+
*/
|
|
694
|
+
grantCredit(productEndUserId: string, params: GrantCreditParams, options?: RequestOptions): Promise<GrantProductUserCreditsResponse>;
|
|
695
|
+
/**
|
|
696
|
+
* Grants credits to an end user by external ID (`POST /product-users/by-external-id/credit-grants`).
|
|
697
|
+
* Automatically provisions the product user if they do not exist yet.
|
|
698
|
+
*/
|
|
699
|
+
grantCreditByExternalId(params: GrantCreditByExternalIdParams, options?: RequestOptions): Promise<GrantProductUserCreditsResponse>;
|
|
700
|
+
/**
|
|
701
|
+
* Lists credit grants for a product user (`GET /product-users/{id}/credit-grants`).
|
|
702
|
+
* Accepts either an external user ID or a Zorveus product user ID.
|
|
703
|
+
*/
|
|
704
|
+
listCreditGrants(userIdentifier: string, params?: ListCreditGrantsParams, options?: RequestOptions): Promise<ProductUserCreditGrantListResponse>;
|
|
705
|
+
/**
|
|
706
|
+
* Lists credit grants for a product user by external ID (`GET /product-users/by-external-id/credit-grants`).
|
|
707
|
+
*/
|
|
708
|
+
listCreditGrantsByExternalId(params: ListCreditGrantsByExternalIdParams, options?: RequestOptions): Promise<ProductUserCreditGrantListResponse>;
|
|
709
|
+
/**
|
|
710
|
+
* Revokes an active credit grant (`POST /product-users/{id}/credit-grants/{grantId}/revoke`).
|
|
711
|
+
*/
|
|
712
|
+
revokeCredit(productEndUserId: string, creditGrantId: string, options?: RequestOptions): Promise<RevokeProductUserCreditGrantResponse>;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
declare class ProviderCredentials {
|
|
716
|
+
private readonly transport;
|
|
717
|
+
constructor(transport: HTTPTransport);
|
|
718
|
+
/**
|
|
719
|
+
* Registers an organization BYOK provider credential via Service Key (`POST /provider-credentials/org-programmatic`).
|
|
720
|
+
*/
|
|
721
|
+
create(params: CreateProviderCredentialParams, options?: RequestOptions): Promise<ProviderCredentialResponse>;
|
|
722
|
+
/**
|
|
723
|
+
* Lists BYOK provider credentials for an organization (`GET /provider-credentials/org-programmatic`).
|
|
724
|
+
*/
|
|
725
|
+
list(params?: ListProviderCredentialsParams, options?: RequestOptions): Promise<ProviderCredentialListResponse>;
|
|
726
|
+
/**
|
|
727
|
+
* Rotates a provider credential secret (`POST /provider-credentials/org-programmatic/{id}/rotate`).
|
|
728
|
+
*/
|
|
729
|
+
rotate(providerCredentialId: string, params: RotateProviderCredentialParams, options?: RequestOptions): Promise<RotateProviderCredentialResponse>;
|
|
730
|
+
/**
|
|
731
|
+
* Deletes a provider credential (`DELETE /provider-credentials/org-programmatic/{id}`).
|
|
732
|
+
*/
|
|
733
|
+
delete(providerCredentialId: string, options?: RequestOptions): Promise<void>;
|
|
734
|
+
/**
|
|
735
|
+
* Lists supported AI provider catalog (`GET /provider-credentials/providers`).
|
|
736
|
+
*/
|
|
737
|
+
listProviders(options?: RequestOptions): Promise<ProviderCredentialProviderCatalogResponse>;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Zorveus Service Client (Server-to-Server Management Control Plane).
|
|
742
|
+
* Authenticated via Organization Service Key (`zrv_service_...`).
|
|
743
|
+
* WARNING: Never export or use this client in browser applications.
|
|
744
|
+
*/
|
|
745
|
+
declare class ZorveusServiceClient {
|
|
746
|
+
readonly productUsers: ProductUsers;
|
|
747
|
+
readonly providerCredentials: ProviderCredentials;
|
|
748
|
+
protected readonly transport: HTTPTransport;
|
|
749
|
+
constructor(options: ZorveusServiceClientOptions);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Isomorphic OAuth PKCE and token management utilities for Zorveus.
|
|
754
|
+
*/
|
|
755
|
+
declare class ZorveusOAuth {
|
|
756
|
+
/**
|
|
757
|
+
* Generates an RFC 7636 PKCE code_verifier, code_challenge (S256), and CSRF state parameter.
|
|
758
|
+
*/
|
|
759
|
+
static generatePKCE(byteLength?: number): Promise<PKCEData>;
|
|
760
|
+
/**
|
|
761
|
+
* Constructs the Zorveus OAuth PKCE consent URL.
|
|
762
|
+
*/
|
|
763
|
+
static getAuthorizationUrl(params: AuthorizationUrlParams): string;
|
|
764
|
+
/**
|
|
765
|
+
* Validates OAuth redirect parameters against expected CSRF state.
|
|
766
|
+
*/
|
|
767
|
+
static validateCallback(options: CallbackValidationOptions): CallbackValidationResult;
|
|
768
|
+
/**
|
|
769
|
+
* Exchanges an OAuth authorization code for a Zorveus inference key using application/x-www-form-urlencoded.
|
|
770
|
+
*/
|
|
771
|
+
static exchangeToken(params: TokenExchangeParams): Promise<OAuthTokenResponse>;
|
|
772
|
+
/**
|
|
773
|
+
* Revokes an existing OAuth token or app connection using application/x-www-form-urlencoded.
|
|
774
|
+
*/
|
|
775
|
+
static revokeToken(params: TokenRevocationParams): Promise<void>;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Base class for all Zorveus SDK errors.
|
|
780
|
+
*/
|
|
781
|
+
declare class ZorveusError extends Error {
|
|
782
|
+
readonly status?: number;
|
|
783
|
+
readonly code?: string;
|
|
784
|
+
readonly param?: string;
|
|
785
|
+
readonly type?: string;
|
|
786
|
+
readonly headers?: Record<string, string>;
|
|
787
|
+
readonly rawBody?: unknown;
|
|
788
|
+
constructor(message: string, options?: {
|
|
789
|
+
status?: number;
|
|
790
|
+
code?: string;
|
|
791
|
+
param?: string;
|
|
792
|
+
type?: string;
|
|
793
|
+
headers?: Record<string, string>;
|
|
794
|
+
rawBody?: unknown;
|
|
795
|
+
cause?: unknown;
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Thrown when an HTTP request fails before receiving a response (network drops, DNS failures, aborts/timeouts).
|
|
800
|
+
*/
|
|
801
|
+
declare class APIConnectionError extends ZorveusError {
|
|
802
|
+
constructor(message?: string, options?: {
|
|
803
|
+
cause?: unknown;
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Base class for all HTTP 4xx and 5xx responses from the Zorveus API.
|
|
808
|
+
*/
|
|
809
|
+
declare class APIStatusError extends ZorveusError {
|
|
810
|
+
constructor(message: string, options: {
|
|
811
|
+
status: number;
|
|
812
|
+
code?: string;
|
|
813
|
+
param?: string;
|
|
814
|
+
type?: string;
|
|
815
|
+
headers?: Record<string, string>;
|
|
816
|
+
rawBody?: unknown;
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* HTTP 401: Invalid or expired API key, Service key, or OAuth access token.
|
|
821
|
+
*/
|
|
822
|
+
declare class AuthenticationError extends APIStatusError {
|
|
823
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof APIStatusError>[1], "status"> & {
|
|
824
|
+
status?: number;
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* HTTP 403: Forbidden access, insufficient scope, or model not permitted.
|
|
829
|
+
*/
|
|
830
|
+
declare class PermissionDeniedError extends APIStatusError {
|
|
831
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof APIStatusError>[1], "status"> & {
|
|
832
|
+
status?: number;
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* HTTP 404: Requested resource (app, user, credential, model) was not found.
|
|
837
|
+
*/
|
|
838
|
+
declare class NotFoundError extends APIStatusError {
|
|
839
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof APIStatusError>[1], "status"> & {
|
|
840
|
+
status?: number;
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* HTTP 422: Request schema validation failure.
|
|
845
|
+
*/
|
|
846
|
+
declare class UnprocessableEntityError extends APIStatusError {
|
|
847
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof APIStatusError>[1], "status"> & {
|
|
848
|
+
status?: number;
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* HTTP 429: Rate limit exceeded or quota exhausted.
|
|
853
|
+
*/
|
|
854
|
+
declare class RateLimitError extends APIStatusError {
|
|
855
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof APIStatusError>[1], "status"> & {
|
|
856
|
+
status?: number;
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* HTTP 500, 502, 503, 504: Zorveus internal server or upstream gateway error.
|
|
861
|
+
*/
|
|
862
|
+
declare class InternalServerError extends APIStatusError {
|
|
863
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof APIStatusError>[1], "status"> & {
|
|
864
|
+
status?: number;
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Base class for Zorveus financial and business constraint errors.
|
|
869
|
+
*/
|
|
870
|
+
declare class ZorveusBusinessError extends APIStatusError {
|
|
871
|
+
constructor(message: string, options: {
|
|
872
|
+
status: number;
|
|
873
|
+
code?: string;
|
|
874
|
+
param?: string;
|
|
875
|
+
type?: string;
|
|
876
|
+
headers?: Record<string, string>;
|
|
877
|
+
rawBody?: unknown;
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* HTTP 402: Organization or product-user wallet balance is exhausted.
|
|
882
|
+
*/
|
|
883
|
+
declare class InsufficientFundsError extends ZorveusBusinessError {
|
|
884
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof ZorveusBusinessError>[1], "status"> & {
|
|
885
|
+
status?: number;
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* HTTP 402/403: Monthly or daily spending cap reached for organization, app connection, or product user.
|
|
890
|
+
*/
|
|
891
|
+
declare class CapExceededError extends ZorveusBusinessError {
|
|
892
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof ZorveusBusinessError>[1], "status"> & {
|
|
893
|
+
status?: number;
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* HTTP 403: Product user credit grant has expired.
|
|
898
|
+
*/
|
|
899
|
+
declare class CreditGrantExpiredError extends ZorveusBusinessError {
|
|
900
|
+
constructor(message?: string, options?: Omit<ConstructorParameters<typeof ZorveusBusinessError>[1], "status"> & {
|
|
901
|
+
status?: number;
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Factory that parses HTTP status code and response payload into the most specific ZorveusError subclass.
|
|
906
|
+
*/
|
|
907
|
+
declare function createAPIError(status: number, body: unknown, headers?: Record<string, string>): APIStatusError;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Validates that a monetary value is a valid decimal string (e.g., "15.0000").
|
|
911
|
+
* Financial safety rule: floating-point arithmetic is avoided for monetary amounts.
|
|
912
|
+
*/
|
|
913
|
+
declare function isValidDecimalString(value: unknown): value is string;
|
|
914
|
+
/**
|
|
915
|
+
* Asserts that a given balance or monetary parameter is a valid decimal string.
|
|
916
|
+
*/
|
|
917
|
+
declare function assertDecimalString(value: unknown, fieldName: string): string;
|
|
918
|
+
|
|
919
|
+
export { APIConnectionError, APIStatusError, AuthenticationError, type AuthorizationUrlParams, type CallbackValidationOptions, type CallbackValidationResult, CapExceededError, type ChatCompletion, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionChunkChoice, type ChatCompletionChunkChoiceDelta, type ChatCompletionCreateParams, type ChatCompletionCreateParamsBase, type ChatCompletionCreateParamsNonStreaming, type ChatCompletionCreateParamsStreaming, type ChatCompletionRole, type ChatCompletionTool, type ChatCompletionUsage, type ChatMessage, type ChatMessageToolCall, type CreateProviderCredentialParams, type CreditGrant, CreditGrantExpiredError, type CreditGrantSource, type CreditGrantStatus, type EmbeddingCreateParams, type EmbeddingCreateResponse, type EmbeddingData, type EmbeddingUsage, type GetProductUserByExternalIdParams, type GetProductUserCreditSummaryByExternalIdParams, type GrantCreditByExternalIdParams, type GrantCreditParams, type GrantProductUserCreditsResponse, type InferenceKeyUsageResponse, InsufficientFundsError, InternalServerError, type ListCreditGrantsByExternalIdParams, type ListCreditGrantsParams, type ListProviderCredentialsParams, type Model, type ModelListParams, type ModelListResponse, NotFoundError, type OAuthTokenResponse, type PKCEData, PermissionDeniedError, type ProductUser, type ProductUserCapResponse, type ProductUserCreditGrantListResponse, type ProductUserCreditGrantResponse, type ProductUserCreditSummaryResponse, type ProductUserListParams, type ProductUserListResponse, type ProductUserResponse, type ProductUserStatus, type ProductUserUsageMetrics, type ProductUserUsageSummary, type ProviderCredential, type ProviderCredentialListResponse, type ProviderCredentialProviderCatalogResponse, type ProviderCredentialProviderInfo, type ProviderCredentialResponse, type ProviderCredentialRoutingMode, type ProviderCredentialSecretKind, type ProviderCredentialStatus, RateLimitError, type RequestOptions, type RevokeProductUserCreditGrantResponse, type RotateProviderCredentialParams, type RotateProviderCredentialResponse, type TokenExchangeParams, type TokenRevocationParams, UnprocessableEntityError, type UpsertProductUserParams, type UpsertProductUserResponse, Zorveus, ZorveusBusinessError, type ZorveusClientOptions, ZorveusError, type ZorveusGatewayMetadata, type ZorveusGatewayProductUserMetadata, ZorveusInferenceClient, type ZorveusInferenceClientOptions, type ZorveusMetadata, ZorveusOAuth, ZorveusServiceClient, type ZorveusServiceClientOptions, assertDecimalString, createAPIError, formatGatewayMetadata, isValidDecimalString };
|