@bodhiapp/ts-client 0.1.4 → 0.1.6

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.
@@ -1,13 +1,45 @@
1
- export type AliasResponse = {
2
- alias: string;
3
- chat_template: string;
4
- context_params: GptContextParams;
5
- filename: string;
6
- model_params: {};
7
- repo: string;
8
- request_params: OaiRequestParams;
9
- snapshot: string;
10
- source: string;
1
+ /**
2
+ * Flat enum representing all types of model aliases
3
+ * Each variant is identified by the source field
4
+ */
5
+ export type Alias = (UserAlias & {
6
+ source: 'user';
7
+ }) | (ModelAlias & {
8
+ source: 'model';
9
+ }) | (ApiAlias & {
10
+ source: 'api';
11
+ });
12
+ export type ApiAlias = {
13
+ api_format: ApiFormat;
14
+ base_url: string;
15
+ created_at: string;
16
+ id: string;
17
+ models: Array<string>;
18
+ prefix?: string | null;
19
+ updated_at: string;
20
+ };
21
+ /**
22
+ * API format/protocol specification
23
+ */
24
+ export type ApiFormat = 'openai' | 'placeholder';
25
+ /**
26
+ * Response containing available API formats
27
+ */
28
+ export type ApiFormatsResponse = {
29
+ data: Array<ApiFormat>;
30
+ };
31
+ /**
32
+ * Response containing API model configuration
33
+ */
34
+ export type ApiModelResponse = {
35
+ api_format: ApiFormat;
36
+ api_key_masked: string;
37
+ base_url: string;
38
+ created_at: string;
39
+ id: string;
40
+ models: Array<string>;
41
+ prefix?: string | null;
42
+ updated_at: string;
11
43
  };
12
44
  export type ApiToken = {
13
45
  created_at: string;
@@ -21,28 +53,68 @@ export type ApiToken = {
21
53
  };
22
54
  export type ApiTokenResponse = {
23
55
  /**
24
- * Offline token that can be used as API Token
56
+ * API token with bapp_ prefix for programmatic access
25
57
  */
26
58
  offline_token: string;
27
59
  };
60
+ export type AppAccessRequest = {
61
+ app_client_id: string;
62
+ };
63
+ export type AppAccessResponse = {
64
+ scope: string;
65
+ };
28
66
  /**
29
67
  * Application information and status
30
68
  */
31
69
  export type AppInfo = {
32
70
  /**
33
- * Whether authentication is enabled
34
- */
35
- authz: boolean;
36
- /**
37
- * Current application status
71
+ * Current application setup and operational status
38
72
  */
39
73
  status: AppStatus;
40
74
  /**
41
- * Application version
75
+ * Application version number (semantic versioning)
42
76
  */
43
77
  version: string;
44
78
  };
79
+ export type AppRole = Role | TokenScope | UserScope;
45
80
  export type AppStatus = 'setup' | 'ready' | 'resource-admin';
81
+ /**
82
+ * Request body for approving access with role assignment
83
+ */
84
+ export type ApproveUserAccessRequest = {
85
+ /**
86
+ * Role to assign to the user
87
+ */
88
+ role: Role;
89
+ };
90
+ export type AuthCallbackRequest = {
91
+ /**
92
+ * OAuth authorization code from successful authentication (required for success flow)
93
+ */
94
+ code?: string | null;
95
+ /**
96
+ * OAuth error code if authentication failed (e.g., "access_denied")
97
+ */
98
+ error?: string | null;
99
+ /**
100
+ * Human-readable OAuth error description if authentication failed
101
+ */
102
+ error_description?: string | null;
103
+ /**
104
+ * OAuth state parameter for CSRF protection (must match initiated request)
105
+ */
106
+ state?: string | null;
107
+ [key: string]: string | (string | null) | (string | null) | (string | null) | (string | null) | undefined;
108
+ };
109
+ /**
110
+ * Change user role request
111
+ */
112
+ export type ChangeRoleRequest = {
113
+ /**
114
+ * Role to assign to the user
115
+ */
116
+ role: string;
117
+ };
46
118
  export type ChatRequest = {
47
119
  format?: string | null;
48
120
  keep_alive?: null | Duration;
@@ -51,59 +123,107 @@ export type ChatRequest = {
51
123
  options?: null | Options;
52
124
  stream?: boolean | null;
53
125
  };
126
+ export type CreateAliasRequest = {
127
+ alias: string;
128
+ context_params?: Array<string> | null;
129
+ filename: string;
130
+ repo: string;
131
+ request_params?: null | OaiRequestParams;
132
+ snapshot?: string | null;
133
+ };
54
134
  /**
55
- * Chat template identifier for built-in templates
56
- */
57
- export type ChatTemplateId = 'llama3' | 'llama2' | 'llama2-legacy' | 'phi3' | 'gemma' | 'deepseek' | 'command-r' | 'openchat' | 'tinyllama';
58
- /**
59
- * Chat template type that can be either built-in or from a repository
135
+ * Request to create a new API model configuration
60
136
  */
61
- export type ChatTemplateType = 'Embedded' | {
137
+ export type CreateApiModelRequest = {
62
138
  /**
63
- * Built-in chat template using Id
139
+ * API format/protocol (e.g., "openai")
64
140
  */
65
- Id: ChatTemplateId;
66
- } | {
141
+ api_format: ApiFormat;
67
142
  /**
68
- * Custom chat template from a repository
143
+ * API key for authentication
69
144
  */
70
- Repo: Repo;
145
+ api_key: string;
146
+ /**
147
+ * API base URL
148
+ */
149
+ base_url: string;
150
+ /**
151
+ * List of available models
152
+ */
153
+ models: Array<string>;
154
+ /**
155
+ * Optional prefix for model namespacing (e.g., "azure/" for "azure/gpt-4", "openai:" for "openai:gpt-4")
156
+ */
157
+ prefix?: string | null;
71
158
  };
72
159
  /**
73
160
  * Request to create a new API token
74
161
  */
75
162
  export type CreateApiTokenRequest = {
76
163
  /**
77
- * Optional name for the API token
164
+ * Descriptive name for the API token (minimum 3 characters)
78
165
  */
79
166
  name?: string | null;
80
167
  };
81
168
  export type DownloadRequest = {
82
169
  created_at: string;
170
+ downloaded_bytes?: number;
83
171
  error?: string | null;
84
172
  filename: string;
85
173
  id: string;
86
174
  repo: string;
175
+ started_at: string;
87
176
  status: DownloadStatus;
177
+ total_bytes?: number | null;
88
178
  updated_at: string;
89
179
  };
90
180
  export type DownloadStatus = 'pending' | 'completed' | 'error';
91
181
  export type Duration = string;
182
+ export type EmptyResponse = {
183
+ [key: string]: unknown;
184
+ };
92
185
  export type ErrorBody = {
186
+ /**
187
+ * Specific error code for programmatic error handling
188
+ */
93
189
  code?: string | null;
190
+ /**
191
+ * Human-readable error message describing what went wrong
192
+ */
94
193
  message: string;
194
+ /**
195
+ * Parameter name that caused the error (for validation errors)
196
+ */
95
197
  param?: string | null;
198
+ /**
199
+ * Error type categorizing the kind of error that occurred
200
+ */
96
201
  type: string;
97
202
  };
98
- export type GptContextParams = {
99
- n_ctx?: number | null;
100
- n_keep?: number | null;
101
- n_parallel?: number | null;
102
- n_predict?: number | null;
103
- n_seed?: number | null;
104
- n_threads?: number | null;
203
+ /**
204
+ * Request to fetch available models from provider
205
+ */
206
+ export type FetchModelsRequest = {
207
+ /**
208
+ * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
209
+ */
210
+ api_key?: string;
211
+ /**
212
+ * API base URL (optional when using id)
213
+ */
214
+ base_url: string;
215
+ /**
216
+ * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
217
+ */
218
+ id?: string;
219
+ };
220
+ /**
221
+ * Response containing available models from provider
222
+ */
223
+ export type FetchModelsResponse = {
224
+ models: Array<string>;
105
225
  };
106
- export type ListModelResponseWrapper = {
226
+ export type ListModelResponse = {
107
227
  data: Array<{
108
228
  /**
109
229
  * The Unix timestamp (in seconds) when the model was created.
@@ -124,6 +244,13 @@ export type ListModelResponseWrapper = {
124
244
  }>;
125
245
  object: string;
126
246
  };
247
+ /**
248
+ * List users query parameters
249
+ */
250
+ export type ListUsersParams = {
251
+ page?: number | null;
252
+ page_size?: number | null;
253
+ };
127
254
  export type LocalModelResponse = {
128
255
  filename: string;
129
256
  model_params: {};
@@ -143,6 +270,12 @@ export type Model = {
143
270
  modified_at: number;
144
271
  size: number;
145
272
  };
273
+ export type ModelAlias = {
274
+ alias: string;
275
+ filename: string;
276
+ repo: string;
277
+ snapshot: string;
278
+ };
146
279
  export type ModelDetails = {
147
280
  families?: Array<string> | null;
148
281
  family: string;
@@ -151,6 +284,27 @@ export type ModelDetails = {
151
284
  parent_model?: string | null;
152
285
  quantization_level: string;
153
286
  };
287
+ /**
288
+ * Describes an OpenAI model offering that can be used with the API.
289
+ */
290
+ export type ModelResponse = {
291
+ /**
292
+ * The Unix timestamp (in seconds) when the model was created.
293
+ */
294
+ created: number;
295
+ /**
296
+ * The model identifier, which can be referenced in the API endpoints.
297
+ */
298
+ id: string;
299
+ /**
300
+ * The object type, which is always "model".
301
+ */
302
+ object: string;
303
+ /**
304
+ * The organization that owns the model.
305
+ */
306
+ owned_by: string;
307
+ };
154
308
  export type ModelsResponse = {
155
309
  models: Array<Model>;
156
310
  };
@@ -159,11 +313,11 @@ export type ModelsResponse = {
159
313
  */
160
314
  export type NewDownloadRequest = {
161
315
  /**
162
- * Model file name to pull
316
+ * Model file name to download (typically .gguf format)
163
317
  */
164
318
  filename: string;
165
319
  /**
166
- * HuggingFace repository name
320
+ * HuggingFace repository name in format 'username/repository-name'
167
321
  */
168
322
  repo: string;
169
323
  };
@@ -181,6 +335,9 @@ export type OllamaError = {
181
335
  error: string;
182
336
  };
183
337
  export type OpenAiApiError = {
338
+ /**
339
+ * Error details following OpenAI API error format
340
+ */
184
341
  error: ErrorBody;
185
342
  };
186
343
  export type Options = {
@@ -214,76 +371,103 @@ export type Options = {
214
371
  use_mmap?: boolean | null;
215
372
  vocab_only?: boolean | null;
216
373
  };
217
- export type PaginatedResponseAliasResponse = {
218
- data: Array<{
219
- alias: string;
220
- chat_template: string;
221
- context_params: GptContextParams;
222
- filename: string;
223
- model_params: {};
224
- repo: string;
225
- request_params: OaiRequestParams;
226
- snapshot: string;
227
- source: string;
228
- }>;
374
+ export type PaginatedAliasResponse = {
375
+ data: Array<Alias>;
229
376
  page: number;
230
377
  page_size: number;
231
378
  total: number;
232
379
  };
233
- export type PaginatedResponseApiToken = {
234
- data: Array<{
235
- created_at: string;
236
- id: string;
237
- name: string;
238
- status: TokenStatus;
239
- token_hash: string;
240
- token_id: string;
241
- updated_at: string;
242
- user_id: string;
243
- }>;
380
+ /**
381
+ * Paginated response for API model listings
382
+ */
383
+ export type PaginatedApiModelResponse = {
384
+ data: Array<ApiModelResponse>;
244
385
  page: number;
245
386
  page_size: number;
246
387
  total: number;
247
388
  };
248
- export type PaginatedResponseDownloadRequest = {
249
- data: Array<{
250
- created_at: string;
251
- error?: string | null;
252
- filename: string;
253
- id: string;
254
- repo: string;
255
- status: DownloadStatus;
256
- updated_at: string;
257
- }>;
389
+ export type PaginatedApiTokenResponse = {
390
+ data: Array<ApiToken>;
258
391
  page: number;
259
392
  page_size: number;
260
393
  total: number;
261
394
  };
262
- export type PaginatedResponseLocalModelResponse = {
263
- data: Array<{
264
- filename: string;
265
- model_params: {};
266
- repo: string;
267
- size?: number | null;
268
- snapshot: string;
269
- }>;
395
+ export type PaginatedDownloadResponse = {
396
+ data: Array<DownloadRequest>;
397
+ page: number;
398
+ page_size: number;
399
+ total: number;
400
+ };
401
+ export type PaginatedLocalModelResponse = {
402
+ data: Array<LocalModelResponse>;
403
+ page: number;
404
+ page_size: number;
405
+ total: number;
406
+ };
407
+ /**
408
+ * Paginated response for access requests
409
+ */
410
+ export type PaginatedUserAccessResponse = {
411
+ /**
412
+ * Current page number
413
+ */
414
+ page: number;
415
+ /**
416
+ * Number of items per page
417
+ */
418
+ page_size: number;
419
+ /**
420
+ * List of access requests
421
+ */
422
+ requests: Array<UserAccessRequest>;
423
+ /**
424
+ * Total number of requests
425
+ */
426
+ total: number;
427
+ };
428
+ export type PaginatedUserAliasResponse = {
429
+ data: Array<UserAliasResponse>;
270
430
  page: number;
271
431
  page_size: number;
272
432
  total: number;
273
433
  };
434
+ /**
435
+ * Query parameters for pagination and sorting
436
+ */
437
+ export type PaginationSortParams = {
438
+ /**
439
+ * Page number (1-based indexing)
440
+ */
441
+ page?: number;
442
+ /**
443
+ * Number of items to return per page (maximum 100)
444
+ */
445
+ page_size?: number;
446
+ /**
447
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
448
+ */
449
+ sort?: string | null;
450
+ /**
451
+ * Sort order: 'asc' for ascending, 'desc' for descending
452
+ */
453
+ sort_order?: string;
454
+ };
274
455
  /**
275
456
  * Response to the ping endpoint
276
457
  */
277
458
  export type PingResponse = {
278
459
  /**
279
- * always returns "pong"
460
+ * Simple ping response message
280
461
  */
281
462
  message: string;
282
463
  };
283
- export type Repo = {
284
- name: string;
285
- user: string;
464
+ export type RedirectResponse = {
465
+ /**
466
+ * The URL to redirect to (OAuth authorization URL or application home page)
467
+ */
468
+ location: string;
286
469
  };
470
+ export type Role = 'resource_user' | 'resource_power_user' | 'resource_manager' | 'resource_admin';
287
471
  export type SettingInfo = {
288
472
  current_value: unknown;
289
473
  default_value: unknown;
@@ -305,24 +489,24 @@ export type SettingMetadata = {
305
489
  };
306
490
  export type SettingSource = 'system' | 'command_line' | 'environment' | 'settings_file' | 'default';
307
491
  /**
308
- * Request to setup the application in authenticated or non-authenticated mode
492
+ * Request to setup the application in authenticated mode
309
493
  */
310
494
  export type SetupRequest = {
311
495
  /**
312
- * Whether to enable authentication
313
- * - true: Setup app in authenticated mode with role-based access
314
- * - false: Setup app in non-authenticated mode for open access
496
+ * Optional description of the server's purpose
315
497
  */
316
- authz: boolean;
498
+ description?: string | null;
499
+ /**
500
+ * Server name for identification (minimum 10 characters)
501
+ */
502
+ name: string;
317
503
  };
318
504
  /**
319
505
  * Response containing the updated application status after setup
320
506
  */
321
507
  export type SetupResponse = {
322
508
  /**
323
- * New application status after setup
324
- * - resource-admin: When setup in authenticated mode
325
- * - ready: When setup in non-authenticated mode
509
+ * New application status after successful setup
326
510
  */
327
511
  status: AppStatus;
328
512
  };
@@ -338,13 +522,79 @@ export type ShowResponse = {
338
522
  parameters: string;
339
523
  template: string;
340
524
  };
525
+ /**
526
+ * Request to test API connectivity with a prompt
527
+ */
528
+ export type TestPromptRequest = {
529
+ /**
530
+ * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
531
+ */
532
+ api_key?: string;
533
+ /**
534
+ * API base URL (optional when using id)
535
+ */
536
+ base_url: string;
537
+ /**
538
+ * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
539
+ */
540
+ id?: string;
541
+ /**
542
+ * Model to use for testing
543
+ */
544
+ model: string;
545
+ /**
546
+ * Test prompt (max 30 characters for cost control)
547
+ */
548
+ prompt: string;
549
+ };
550
+ /**
551
+ * Response from testing API connectivity
552
+ */
553
+ export type TestPromptResponse = {
554
+ error?: string | null;
555
+ response?: string | null;
556
+ success: boolean;
557
+ };
558
+ export type TokenScope = 'scope_token_user' | 'scope_token_power_user' | 'scope_token_manager' | 'scope_token_admin';
341
559
  export type TokenStatus = 'active' | 'inactive';
560
+ export type UpdateAliasRequest = {
561
+ context_params?: Array<string> | null;
562
+ filename: string;
563
+ repo: string;
564
+ request_params?: null | OaiRequestParams;
565
+ snapshot?: string | null;
566
+ };
567
+ /**
568
+ * Request to update an existing API model configuration
569
+ */
570
+ export type UpdateApiModelRequest = {
571
+ /**
572
+ * API format/protocol (required)
573
+ */
574
+ api_format: ApiFormat;
575
+ /**
576
+ * API key for authentication (optional, only update if provided for security)
577
+ */
578
+ api_key?: string | null;
579
+ /**
580
+ * API base URL (required)
581
+ */
582
+ base_url: string;
583
+ /**
584
+ * List of available models (required)
585
+ */
586
+ models: Array<string>;
587
+ /**
588
+ * Optional prefix for model namespacing
589
+ */
590
+ prefix?: string | null;
591
+ };
342
592
  /**
343
593
  * Request to update an existing API token
344
594
  */
345
595
  export type UpdateApiTokenRequest = {
346
596
  /**
347
- * New name for the token
597
+ * New descriptive name for the token (minimum 3 characters)
348
598
  */
349
599
  name: string;
350
600
  /**
@@ -356,25 +606,104 @@ export type UpdateApiTokenRequest = {
356
606
  * Request to update a setting value
357
607
  */
358
608
  export type UpdateSettingRequest = {
609
+ /**
610
+ * New value for the setting (type depends on setting metadata)
611
+ */
359
612
  value: unknown;
360
613
  };
614
+ export type UserAccessRequest = {
615
+ /**
616
+ * Creation timestamp
617
+ */
618
+ created_at: string;
619
+ /**
620
+ * Unique identifier for the request
621
+ */
622
+ id: number;
623
+ reviewer?: string | null;
624
+ /**
625
+ * Current status of the request
626
+ */
627
+ status: UserAccessRequestStatus;
628
+ /**
629
+ * Last update timestamp
630
+ */
631
+ updated_at: string;
632
+ /**
633
+ * User ID (UUID) of the requesting user
634
+ */
635
+ user_id: string;
636
+ /**
637
+ * Username of the requesting user
638
+ */
639
+ username: string;
640
+ };
641
+ export type UserAccessRequestStatus = 'pending' | 'approved' | 'rejected';
361
642
  /**
362
- * Information about the currently logged in user
643
+ * Response for checking access request status
363
644
  */
364
- export type UserInfo = {
645
+ export type UserAccessStatusResponse = {
365
646
  /**
366
- * User's email address
647
+ * Creation timestamp
367
648
  */
368
- email?: string | null;
649
+ created_at: string;
650
+ /**
651
+ * Current status of the request (pending, approved, rejected)
652
+ */
653
+ status: UserAccessRequestStatus;
369
654
  /**
370
- * If user is logged in
655
+ * Last update timestamp
371
656
  */
372
- logged_in: boolean;
657
+ updated_at: string;
373
658
  /**
374
- * List of roles assigned to the user
659
+ * Username of the requesting user
375
660
  */
376
- roles: Array<string>;
661
+ username: string;
662
+ };
663
+ export type UserAlias = {
664
+ alias: string;
665
+ context_params?: Array<string>;
666
+ filename: string;
667
+ repo: string;
668
+ request_params?: OaiRequestParams;
669
+ snapshot: string;
670
+ };
671
+ export type UserAliasResponse = {
672
+ alias: string;
673
+ context_params: Array<string>;
674
+ filename: string;
675
+ model_params: {};
676
+ repo: string;
677
+ request_params: OaiRequestParams;
678
+ snapshot: string;
679
+ source: string;
680
+ };
681
+ export type UserInfo = {
682
+ first_name?: string | null;
683
+ last_name?: string | null;
684
+ role?: null | AppRole;
685
+ user_id: string;
686
+ username: string;
377
687
  };
688
+ export type UserListResponse = {
689
+ client_id: string;
690
+ has_next: boolean;
691
+ has_previous: boolean;
692
+ page: number;
693
+ page_size: number;
694
+ total_pages: number;
695
+ total_users: number;
696
+ users: Array<UserInfo>;
697
+ };
698
+ /**
699
+ * User authentication response with discriminated union
700
+ */
701
+ export type UserResponse = {
702
+ auth_status: 'logged_out';
703
+ } | (UserInfo & {
704
+ auth_status: 'logged_in';
705
+ });
706
+ export type UserScope = 'scope_user_user' | 'scope_user_power_user' | 'scope_user_manager' | 'scope_user_admin';
378
707
  export type ChatOllamaModelData = {
379
708
  /**
380
709
  * Chat request in Ollama format
@@ -382,96 +711,527 @@ export type ChatOllamaModelData = {
382
711
  body: ChatRequest;
383
712
  path?: never;
384
713
  query?: never;
385
- url: '/api/chat';
714
+ url: '/api/chat';
715
+ };
716
+ export type ChatOllamaModelErrors = {
717
+ /**
718
+ * Invalid request
719
+ */
720
+ 400: OllamaError;
721
+ /**
722
+ * Model not found
723
+ */
724
+ 404: OllamaError;
725
+ /**
726
+ * Internal server error
727
+ */
728
+ 500: OllamaError;
729
+ };
730
+ export type ChatOllamaModelError = ChatOllamaModelErrors[keyof ChatOllamaModelErrors];
731
+ export type ChatOllamaModelResponses = {
732
+ /**
733
+ * Chat response
734
+ */
735
+ 200: unknown;
736
+ };
737
+ export type ShowOllamaModelData = {
738
+ /**
739
+ * Model name to get details for
740
+ */
741
+ body: ShowRequest;
742
+ path?: never;
743
+ query?: never;
744
+ url: '/api/show';
745
+ };
746
+ export type ShowOllamaModelErrors = {
747
+ /**
748
+ * Model not found
749
+ */
750
+ 404: OllamaError;
751
+ /**
752
+ * Internal server error
753
+ */
754
+ 500: OllamaError;
755
+ };
756
+ export type ShowOllamaModelError = ShowOllamaModelErrors[keyof ShowOllamaModelErrors];
757
+ export type ShowOllamaModelResponses = {
758
+ /**
759
+ * Model details
760
+ */
761
+ 200: ShowResponse;
762
+ };
763
+ export type ShowOllamaModelResponse = ShowOllamaModelResponses[keyof ShowOllamaModelResponses];
764
+ export type ListOllamaModelsData = {
765
+ body?: never;
766
+ path?: never;
767
+ query?: never;
768
+ url: '/api/tags';
769
+ };
770
+ export type ListOllamaModelsErrors = {
771
+ /**
772
+ * Internal server error
773
+ */
774
+ 500: OllamaError;
775
+ };
776
+ export type ListOllamaModelsError = ListOllamaModelsErrors[keyof ListOllamaModelsErrors];
777
+ export type ListOllamaModelsResponses = {
778
+ /**
779
+ * List of available models
780
+ */
781
+ 200: ModelsResponse;
782
+ };
783
+ export type ListOllamaModelsResponse = ListOllamaModelsResponses[keyof ListOllamaModelsResponses];
784
+ export type ListAllAccessRequestsData = {
785
+ body?: never;
786
+ path?: never;
787
+ query?: {
788
+ /**
789
+ * Page number (1-based indexing)
790
+ */
791
+ page?: number;
792
+ /**
793
+ * Number of items to return per page (maximum 100)
794
+ */
795
+ page_size?: number;
796
+ /**
797
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
798
+ */
799
+ sort?: string;
800
+ /**
801
+ * Sort order: 'asc' for ascending, 'desc' for descending
802
+ */
803
+ sort_order?: string;
804
+ };
805
+ url: '/bodhi/v1/access-requests';
806
+ };
807
+ export type ListAllAccessRequestsErrors = {
808
+ /**
809
+ * Not authenticated
810
+ */
811
+ 401: OpenAiApiError;
812
+ /**
813
+ * Insufficient permissions
814
+ */
815
+ 403: OpenAiApiError;
816
+ };
817
+ export type ListAllAccessRequestsError = ListAllAccessRequestsErrors[keyof ListAllAccessRequestsErrors];
818
+ export type ListAllAccessRequestsResponses = {
819
+ /**
820
+ * All requests retrieved
821
+ */
822
+ 200: PaginatedUserAccessResponse;
823
+ };
824
+ export type ListAllAccessRequestsResponse = ListAllAccessRequestsResponses[keyof ListAllAccessRequestsResponses];
825
+ export type ListPendingAccessRequestsData = {
826
+ body?: never;
827
+ path?: never;
828
+ query?: {
829
+ /**
830
+ * Page number (1-based indexing)
831
+ */
832
+ page?: number;
833
+ /**
834
+ * Number of items to return per page (maximum 100)
835
+ */
836
+ page_size?: number;
837
+ /**
838
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
839
+ */
840
+ sort?: string;
841
+ /**
842
+ * Sort order: 'asc' for ascending, 'desc' for descending
843
+ */
844
+ sort_order?: string;
845
+ };
846
+ url: '/bodhi/v1/access-requests/pending';
847
+ };
848
+ export type ListPendingAccessRequestsErrors = {
849
+ /**
850
+ * Not authenticated
851
+ */
852
+ 401: OpenAiApiError;
853
+ /**
854
+ * Insufficient permissions
855
+ */
856
+ 403: OpenAiApiError;
857
+ };
858
+ export type ListPendingAccessRequestsError = ListPendingAccessRequestsErrors[keyof ListPendingAccessRequestsErrors];
859
+ export type ListPendingAccessRequestsResponses = {
860
+ /**
861
+ * Pending requests retrieved
862
+ */
863
+ 200: PaginatedUserAccessResponse;
864
+ };
865
+ export type ListPendingAccessRequestsResponse = ListPendingAccessRequestsResponses[keyof ListPendingAccessRequestsResponses];
866
+ export type ApproveAccessRequestData = {
867
+ /**
868
+ * Role to assign to the user
869
+ */
870
+ body: ApproveUserAccessRequest;
871
+ path: {
872
+ /**
873
+ * Access request ID
874
+ */
875
+ id: number;
876
+ };
877
+ query?: never;
878
+ url: '/bodhi/v1/access-requests/{id}/approve';
879
+ };
880
+ export type ApproveAccessRequestErrors = {
881
+ /**
882
+ * Not authenticated
883
+ */
884
+ 401: OpenAiApiError;
885
+ /**
886
+ * Insufficient permissions
887
+ */
888
+ 403: OpenAiApiError;
889
+ /**
890
+ * Request not found
891
+ */
892
+ 404: OpenAiApiError;
893
+ };
894
+ export type ApproveAccessRequestError = ApproveAccessRequestErrors[keyof ApproveAccessRequestErrors];
895
+ export type ApproveAccessRequestResponses = {
896
+ /**
897
+ * Request approved successfully
898
+ */
899
+ 200: unknown;
900
+ };
901
+ export type RejectAccessRequestData = {
902
+ body?: never;
903
+ path: {
904
+ /**
905
+ * Access request ID
906
+ */
907
+ id: number;
908
+ };
909
+ query?: never;
910
+ url: '/bodhi/v1/access-requests/{id}/reject';
911
+ };
912
+ export type RejectAccessRequestErrors = {
913
+ /**
914
+ * Not authenticated
915
+ */
916
+ 401: OpenAiApiError;
917
+ /**
918
+ * Insufficient permissions
919
+ */
920
+ 403: OpenAiApiError;
921
+ /**
922
+ * Request not found
923
+ */
924
+ 404: OpenAiApiError;
925
+ };
926
+ export type RejectAccessRequestError = RejectAccessRequestErrors[keyof RejectAccessRequestErrors];
927
+ export type RejectAccessRequestResponses = {
928
+ /**
929
+ * Request rejected successfully
930
+ */
931
+ 200: unknown;
932
+ };
933
+ export type ListApiModelsData = {
934
+ body?: never;
935
+ path?: never;
936
+ query?: {
937
+ /**
938
+ * Page number (1-based indexing)
939
+ */
940
+ page?: number;
941
+ /**
942
+ * Number of items to return per page (maximum 100)
943
+ */
944
+ page_size?: number;
945
+ /**
946
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
947
+ */
948
+ sort?: string;
949
+ /**
950
+ * Sort order: 'asc' for ascending, 'desc' for descending
951
+ */
952
+ sort_order?: string;
953
+ };
954
+ url: '/bodhi/v1/api-models';
955
+ };
956
+ export type ListApiModelsErrors = {
957
+ /**
958
+ * Internal server error during API model retrieval
959
+ */
960
+ 500: OpenAiApiError;
961
+ };
962
+ export type ListApiModelsError = ListApiModelsErrors[keyof ListApiModelsErrors];
963
+ export type ListApiModelsResponses = {
964
+ /**
965
+ * API model configurations retrieved successfully
966
+ */
967
+ 200: PaginatedApiModelResponse;
968
+ };
969
+ export type ListApiModelsResponse = ListApiModelsResponses[keyof ListApiModelsResponses];
970
+ export type CreateApiModelData = {
971
+ body: CreateApiModelRequest;
972
+ path?: never;
973
+ query?: never;
974
+ url: '/bodhi/v1/api-models';
975
+ };
976
+ export type CreateApiModelErrors = {
977
+ /**
978
+ * Invalid request
979
+ */
980
+ 400: OpenAiApiError;
981
+ /**
982
+ * Alias already exists
983
+ */
984
+ 409: OpenAiApiError;
985
+ /**
986
+ * Internal server error
987
+ */
988
+ 500: OpenAiApiError;
989
+ };
990
+ export type CreateApiModelError = CreateApiModelErrors[keyof CreateApiModelErrors];
991
+ export type CreateApiModelResponses = {
992
+ /**
993
+ * API model created
994
+ */
995
+ 201: ApiModelResponse;
996
+ };
997
+ export type CreateApiModelResponse = CreateApiModelResponses[keyof CreateApiModelResponses];
998
+ export type GetApiFormatsData = {
999
+ body?: never;
1000
+ path?: never;
1001
+ query?: never;
1002
+ url: '/bodhi/v1/api-models/api-formats';
1003
+ };
1004
+ export type GetApiFormatsErrors = {
1005
+ /**
1006
+ * Internal server error during API format retrieval
1007
+ */
1008
+ 500: OpenAiApiError;
1009
+ };
1010
+ export type GetApiFormatsError = GetApiFormatsErrors[keyof GetApiFormatsErrors];
1011
+ export type GetApiFormatsResponses = {
1012
+ /**
1013
+ * API formats retrieved successfully
1014
+ */
1015
+ 200: ApiFormatsResponse;
1016
+ };
1017
+ export type GetApiFormatsResponse = GetApiFormatsResponses[keyof GetApiFormatsResponses];
1018
+ export type FetchApiModelsData = {
1019
+ body: FetchModelsRequest;
1020
+ path?: never;
1021
+ query?: never;
1022
+ url: '/bodhi/v1/api-models/fetch-models';
1023
+ };
1024
+ export type FetchApiModelsErrors = {
1025
+ /**
1026
+ * Invalid request
1027
+ */
1028
+ 400: OpenAiApiError;
1029
+ /**
1030
+ * Internal server error
1031
+ */
1032
+ 500: OpenAiApiError;
1033
+ };
1034
+ export type FetchApiModelsError = FetchApiModelsErrors[keyof FetchApiModelsErrors];
1035
+ export type FetchApiModelsResponses = {
1036
+ /**
1037
+ * Available models
1038
+ */
1039
+ 200: FetchModelsResponse;
1040
+ };
1041
+ export type FetchApiModelsResponse = FetchApiModelsResponses[keyof FetchApiModelsResponses];
1042
+ export type TestApiModelData = {
1043
+ body: TestPromptRequest;
1044
+ path?: never;
1045
+ query?: never;
1046
+ url: '/bodhi/v1/api-models/test';
1047
+ };
1048
+ export type TestApiModelErrors = {
1049
+ /**
1050
+ * Invalid request
1051
+ */
1052
+ 400: OpenAiApiError;
1053
+ /**
1054
+ * Internal server error
1055
+ */
1056
+ 500: OpenAiApiError;
1057
+ };
1058
+ export type TestApiModelError = TestApiModelErrors[keyof TestApiModelErrors];
1059
+ export type TestApiModelResponses = {
1060
+ /**
1061
+ * Test result
1062
+ */
1063
+ 200: TestPromptResponse;
1064
+ };
1065
+ export type TestApiModelResponse = TestApiModelResponses[keyof TestApiModelResponses];
1066
+ export type DeleteApiModelData = {
1067
+ body?: never;
1068
+ path: {
1069
+ /**
1070
+ * API model alias
1071
+ */
1072
+ alias: string;
1073
+ };
1074
+ query?: never;
1075
+ url: '/bodhi/v1/api-models/{alias}';
1076
+ };
1077
+ export type DeleteApiModelErrors = {
1078
+ /**
1079
+ * API model not found
1080
+ */
1081
+ 404: OpenAiApiError;
1082
+ /**
1083
+ * Internal server error
1084
+ */
1085
+ 500: OpenAiApiError;
1086
+ };
1087
+ export type DeleteApiModelError = DeleteApiModelErrors[keyof DeleteApiModelErrors];
1088
+ export type DeleteApiModelResponses = {
1089
+ /**
1090
+ * API model deleted
1091
+ */
1092
+ 204: void;
1093
+ };
1094
+ export type DeleteApiModelResponse = DeleteApiModelResponses[keyof DeleteApiModelResponses];
1095
+ export type UpdateApiModelData = {
1096
+ body: UpdateApiModelRequest;
1097
+ path: {
1098
+ /**
1099
+ * API model alias
1100
+ */
1101
+ alias: string;
1102
+ };
1103
+ query?: never;
1104
+ url: '/bodhi/v1/api-models/{alias}';
1105
+ };
1106
+ export type UpdateApiModelErrors = {
1107
+ /**
1108
+ * Invalid request
1109
+ */
1110
+ 400: OpenAiApiError;
1111
+ /**
1112
+ * API model not found
1113
+ */
1114
+ 404: OpenAiApiError;
1115
+ /**
1116
+ * Internal server error
1117
+ */
1118
+ 500: OpenAiApiError;
1119
+ };
1120
+ export type UpdateApiModelError = UpdateApiModelErrors[keyof UpdateApiModelErrors];
1121
+ export type UpdateApiModelResponses = {
1122
+ /**
1123
+ * API model updated
1124
+ */
1125
+ 200: ApiModelResponse;
1126
+ };
1127
+ export type UpdateApiModelResponse = UpdateApiModelResponses[keyof UpdateApiModelResponses];
1128
+ export type GetApiModelData = {
1129
+ body?: never;
1130
+ path: {
1131
+ /**
1132
+ * Unique identifier for the API model alias
1133
+ */
1134
+ id: string;
1135
+ };
1136
+ query?: never;
1137
+ url: '/bodhi/v1/api-models/{id}';
386
1138
  };
387
- export type ChatOllamaModelErrors = {
388
- /**
389
- * Invalid request
390
- */
391
- 400: OllamaError;
1139
+ export type GetApiModelErrors = {
392
1140
  /**
393
- * Model not found
1141
+ * API model with specified ID not found
394
1142
  */
395
- 404: OllamaError;
1143
+ 404: OpenAiApiError;
396
1144
  /**
397
- * Internal server error
1145
+ * Internal server error during model retrieval
398
1146
  */
399
- 500: OllamaError;
1147
+ 500: OpenAiApiError;
400
1148
  };
401
- export type ChatOllamaModelError = ChatOllamaModelErrors[keyof ChatOllamaModelErrors];
402
- export type ChatOllamaModelResponses = {
1149
+ export type GetApiModelError = GetApiModelErrors[keyof GetApiModelErrors];
1150
+ export type GetApiModelResponses = {
403
1151
  /**
404
- * Chat response
1152
+ * API model configuration retrieved successfully
405
1153
  */
406
- 200: unknown;
1154
+ 200: ApiModelResponse;
407
1155
  };
408
- export type ShowOllamaModelData = {
1156
+ export type GetApiModelResponse = GetApiModelResponses[keyof GetApiModelResponses];
1157
+ export type RequestAccessData = {
409
1158
  /**
410
- * Model name to get details for
1159
+ * Application client requesting access
411
1160
  */
412
- body: ShowRequest;
1161
+ body: AppAccessRequest;
413
1162
  path?: never;
414
1163
  query?: never;
415
- url: '/api/show';
1164
+ url: '/bodhi/v1/apps/request-access';
416
1165
  };
417
- export type ShowOllamaModelErrors = {
1166
+ export type RequestAccessErrors = {
418
1167
  /**
419
- * Model not found
1168
+ * Invalid request, application not registered, or incorrect app status
420
1169
  */
421
- 404: OllamaError;
1170
+ 400: OpenAiApiError;
422
1171
  /**
423
- * Internal server error
1172
+ * Internal server error during access request
424
1173
  */
425
- 500: OllamaError;
1174
+ 500: OpenAiApiError;
426
1175
  };
427
- export type ShowOllamaModelError = ShowOllamaModelErrors[keyof ShowOllamaModelErrors];
428
- export type ShowOllamaModelResponses = {
1176
+ export type RequestAccessError = RequestAccessErrors[keyof RequestAccessErrors];
1177
+ export type RequestAccessResponses = {
429
1178
  /**
430
- * Model details
1179
+ * Access granted successfully
431
1180
  */
432
- 200: ShowResponse;
1181
+ 200: AppAccessResponse;
433
1182
  };
434
- export type ShowOllamaModelResponse = ShowOllamaModelResponses[keyof ShowOllamaModelResponses];
435
- export type ListOllamaModelsData = {
436
- body?: never;
1183
+ export type RequestAccessResponse = RequestAccessResponses[keyof RequestAccessResponses];
1184
+ export type CompleteOAuthFlowData = {
1185
+ /**
1186
+ * OAuth callback parameters from authorization server
1187
+ */
1188
+ body: AuthCallbackRequest;
437
1189
  path?: never;
438
1190
  query?: never;
439
- url: '/api/tags';
1191
+ url: '/bodhi/v1/auth/callback';
440
1192
  };
441
- export type ListOllamaModelsErrors = {
1193
+ export type CompleteOAuthFlowErrors = {
442
1194
  /**
443
- * Internal server error
1195
+ * OAuth error, invalid request parameters, or state mismatch
444
1196
  */
445
- 500: OllamaError;
1197
+ 422: OpenAiApiError;
1198
+ /**
1199
+ * Internal server error during token exchange
1200
+ */
1201
+ 500: OpenAiApiError;
446
1202
  };
447
- export type ListOllamaModelsError = ListOllamaModelsErrors[keyof ListOllamaModelsErrors];
448
- export type ListOllamaModelsResponses = {
1203
+ export type CompleteOAuthFlowError = CompleteOAuthFlowErrors[keyof CompleteOAuthFlowErrors];
1204
+ export type CompleteOAuthFlowResponses = {
449
1205
  /**
450
- * List of available models
1206
+ * OAuth flow completed successfully, user authenticated
451
1207
  */
452
- 200: ModelsResponse;
1208
+ 200: RedirectResponse;
453
1209
  };
454
- export type ListOllamaModelsResponse = ListOllamaModelsResponses[keyof ListOllamaModelsResponses];
455
- export type ListChatTemplatesData = {
456
- body?: never;
1210
+ export type CompleteOAuthFlowResponse = CompleteOAuthFlowResponses[keyof CompleteOAuthFlowResponses];
1211
+ export type InitiateOAuthFlowData = {
1212
+ body: unknown;
457
1213
  path?: never;
458
1214
  query?: never;
459
- url: '/bodhi/v1/chat_templates';
1215
+ url: '/bodhi/v1/auth/initiate';
460
1216
  };
461
- export type ListChatTemplatesErrors = {
1217
+ export type InitiateOAuthFlowErrors = {
462
1218
  /**
463
- * Internal server error
1219
+ * Internal server error during OAuth initialization
464
1220
  */
465
1221
  500: OpenAiApiError;
466
1222
  };
467
- export type ListChatTemplatesError = ListChatTemplatesErrors[keyof ListChatTemplatesErrors];
468
- export type ListChatTemplatesResponses = {
1223
+ export type InitiateOAuthFlowError = InitiateOAuthFlowErrors[keyof InitiateOAuthFlowErrors];
1224
+ export type InitiateOAuthFlowResponses = {
1225
+ /**
1226
+ * User already authenticated, home page URL provided
1227
+ */
1228
+ 200: RedirectResponse;
469
1229
  /**
470
- * List of available chat templates
1230
+ * User not authenticated, OAuth authorization URL provided
471
1231
  */
472
- 200: Array<ChatTemplateType>;
1232
+ 201: RedirectResponse;
473
1233
  };
474
- export type ListChatTemplatesResponse = ListChatTemplatesResponses[keyof ListChatTemplatesResponses];
1234
+ export type InitiateOAuthFlowResponse = InitiateOAuthFlowResponses[keyof InitiateOAuthFlowResponses];
475
1235
  export type GetAppInfoData = {
476
1236
  body?: never;
477
1237
  path?: never;
@@ -487,7 +1247,7 @@ export type GetAppInfoErrors = {
487
1247
  export type GetAppInfoError = GetAppInfoErrors[keyof GetAppInfoErrors];
488
1248
  export type GetAppInfoResponses = {
489
1249
  /**
490
- * Returns the status information about the Application
1250
+ * Application information retrieved successfully
491
1251
  */
492
1252
  200: AppInfo;
493
1253
  };
@@ -507,28 +1267,29 @@ export type LogoutUserErrors = {
507
1267
  export type LogoutUserError = LogoutUserErrors[keyof LogoutUserErrors];
508
1268
  export type LogoutUserResponses = {
509
1269
  /**
510
- * Logout successful, redirects to login page
1270
+ * User logged out successfully
511
1271
  */
512
- 200: unknown;
1272
+ 200: RedirectResponse;
513
1273
  };
1274
+ export type LogoutUserResponse = LogoutUserResponses[keyof LogoutUserResponses];
514
1275
  export type ListModelFilesData = {
515
1276
  body?: never;
516
1277
  path?: never;
517
1278
  query?: {
518
1279
  /**
519
- * Page number (1-based)
1280
+ * Page number (1-based indexing)
520
1281
  */
521
1282
  page?: number;
522
1283
  /**
523
- * Number of items per page (max 100)
1284
+ * Number of items to return per page (maximum 100)
524
1285
  */
525
1286
  page_size?: number;
526
1287
  /**
527
- * Field to sort by (repo, filename, size, updated_at, snapshot)
1288
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
528
1289
  */
529
- sort?: string | null;
1290
+ sort?: string;
530
1291
  /**
531
- * Sort order (asc or desc)
1292
+ * Sort order: 'asc' for ascending, 'desc' for descending
532
1293
  */
533
1294
  sort_order?: string;
534
1295
  };
@@ -543,9 +1304,9 @@ export type ListModelFilesErrors = {
543
1304
  export type ListModelFilesError = ListModelFilesErrors[keyof ListModelFilesErrors];
544
1305
  export type ListModelFilesResponses = {
545
1306
  /**
546
- * List of supported model files from local HuggingFace cache folder
1307
+ * Local model files retrieved successfully from cache
547
1308
  */
548
- 200: PaginatedResponseLocalModelResponse;
1309
+ 200: PaginatedLocalModelResponse;
549
1310
  };
550
1311
  export type ListModelFilesResponse = ListModelFilesResponses[keyof ListModelFilesResponses];
551
1312
  export type ListDownloadsData = {
@@ -553,19 +1314,19 @@ export type ListDownloadsData = {
553
1314
  path?: never;
554
1315
  query?: {
555
1316
  /**
556
- * Page number (1-based)
1317
+ * Page number (1-based indexing)
557
1318
  */
558
1319
  page?: number;
559
1320
  /**
560
- * Number of items per page (max 100)
1321
+ * Number of items to return per page (maximum 100)
561
1322
  */
562
1323
  page_size?: number;
563
1324
  /**
564
- * Field to sort by (repo, filename, size, updated_at, snapshot)
1325
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
565
1326
  */
566
- sort?: string | null;
1327
+ sort?: string;
567
1328
  /**
568
- * Sort order (asc or desc)
1329
+ * Sort order: 'asc' for ascending, 'desc' for descending
569
1330
  */
570
1331
  sort_order?: string;
571
1332
  };
@@ -573,21 +1334,21 @@ export type ListDownloadsData = {
573
1334
  };
574
1335
  export type ListDownloadsErrors = {
575
1336
  /**
576
- * Internal server error
1337
+ * Internal server error during download list retrieval
577
1338
  */
578
1339
  500: OpenAiApiError;
579
1340
  };
580
1341
  export type ListDownloadsError = ListDownloadsErrors[keyof ListDownloadsErrors];
581
1342
  export type ListDownloadsResponses = {
582
1343
  /**
583
- * List of download requests
1344
+ * Model download requests retrieved successfully
584
1345
  */
585
- 200: PaginatedResponseDownloadRequest;
1346
+ 200: PaginatedDownloadResponse;
586
1347
  };
587
1348
  export type ListDownloadsResponse = ListDownloadsResponses[keyof ListDownloadsResponses];
588
1349
  export type PullModelFileData = {
589
1350
  /**
590
- * Model file download request
1351
+ * Model file download specification with repository and filename
591
1352
  */
592
1353
  body: NewDownloadRequest;
593
1354
  path?: never;
@@ -620,17 +1381,7 @@ export type PullModelByAliasData = {
620
1381
  body?: never;
621
1382
  path: {
622
1383
  /**
623
- * Available model aliases:
624
- * - llama3:instruct - Meta Llama 3 8B Instruct
625
- * - llama3:70b-instruct - Meta Llama 3 70B Instruct
626
- * - llama2:chat - Llama 2 7B Chat
627
- * - llama2:13b-chat - Llama 2 13B Chat
628
- * - llama2:70b-chat - Llama 2 70B Chat
629
- * - phi3:mini - Phi 3 Mini
630
- * - mistral:instruct - Mistral 7B Instruct
631
- * - mixtral:instruct - Mixtral 8x7B Instruct
632
- * - gemma:instruct - Gemma 7B Instruct
633
- * - gemma:7b-instruct-v1.1-q8_0 - Gemma 1.1 7B Instruct
1384
+ * Predefined model alias. Available aliases include popular models like llama2:chat, mistral:instruct, phi3:mini, etc. Use the /models endpoint to see all available aliases.
634
1385
  */
635
1386
  alias: string;
636
1387
  };
@@ -667,7 +1418,7 @@ export type GetDownloadStatusData = {
667
1418
  body?: never;
668
1419
  path: {
669
1420
  /**
670
- * Download request identifier
1421
+ * Unique identifier of the download request (UUID format)
671
1422
  */
672
1423
  id: string;
673
1424
  };
@@ -692,43 +1443,67 @@ export type GetDownloadStatusResponses = {
692
1443
  200: DownloadRequest;
693
1444
  };
694
1445
  export type GetDownloadStatusResponse = GetDownloadStatusResponses[keyof GetDownloadStatusResponses];
695
- export type ListModelAliasesData = {
1446
+ export type ListAllModelsData = {
696
1447
  body?: never;
697
1448
  path?: never;
698
1449
  query?: {
699
1450
  /**
700
- * Page number (1-based)
1451
+ * Page number (1-based indexing)
701
1452
  */
702
1453
  page?: number;
703
1454
  /**
704
- * Number of items per page (max 100)
1455
+ * Number of items to return per page (maximum 100)
705
1456
  */
706
1457
  page_size?: number;
707
1458
  /**
708
- * Field to sort by (repo, filename, size, updated_at, snapshot)
1459
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
709
1460
  */
710
- sort?: string | null;
1461
+ sort?: string;
711
1462
  /**
712
- * Sort order (asc or desc)
1463
+ * Sort order: 'asc' for ascending, 'desc' for descending
713
1464
  */
714
1465
  sort_order?: string;
715
1466
  };
716
1467
  url: '/bodhi/v1/models';
717
1468
  };
718
- export type ListModelAliasesErrors = {
1469
+ export type ListAllModelsErrors = {
1470
+ /**
1471
+ * Internal server error
1472
+ */
1473
+ 500: OpenAiApiError;
1474
+ };
1475
+ export type ListAllModelsError = ListAllModelsErrors[keyof ListAllModelsErrors];
1476
+ export type ListAllModelsResponses = {
1477
+ /**
1478
+ * Paginated list of model aliases retrieved successfully
1479
+ */
1480
+ 200: PaginatedAliasResponse;
1481
+ };
1482
+ export type ListAllModelsResponse = ListAllModelsResponses[keyof ListAllModelsResponses];
1483
+ export type CreateAliasData = {
1484
+ body: CreateAliasRequest;
1485
+ path?: never;
1486
+ query?: never;
1487
+ url: '/bodhi/v1/models';
1488
+ };
1489
+ export type CreateAliasErrors = {
1490
+ /**
1491
+ * Invalid request
1492
+ */
1493
+ 400: OpenAiApiError;
719
1494
  /**
720
1495
  * Internal server error
721
1496
  */
722
1497
  500: OpenAiApiError;
723
1498
  };
724
- export type ListModelAliasesError = ListModelAliasesErrors[keyof ListModelAliasesErrors];
725
- export type ListModelAliasesResponses = {
1499
+ export type CreateAliasError = CreateAliasErrors[keyof CreateAliasErrors];
1500
+ export type CreateAliasResponses = {
726
1501
  /**
727
- * List of configured model aliases
1502
+ * Alias created succesfully
728
1503
  */
729
- 200: PaginatedResponseAliasResponse;
1504
+ 201: UserAliasResponse;
730
1505
  };
731
- export type ListModelAliasesResponse = ListModelAliasesResponses[keyof ListModelAliasesResponses];
1506
+ export type CreateAliasResponse = CreateAliasResponses[keyof CreateAliasResponses];
732
1507
  export type GetAliasData = {
733
1508
  body?: never;
734
1509
  path: {
@@ -755,9 +1530,38 @@ export type GetAliasResponses = {
755
1530
  /**
756
1531
  * Model alias details
757
1532
  */
758
- 200: AliasResponse;
1533
+ 200: UserAliasResponse;
759
1534
  };
760
1535
  export type GetAliasResponse = GetAliasResponses[keyof GetAliasResponses];
1536
+ export type UpdateAliasData = {
1537
+ body: UpdateAliasRequest;
1538
+ path: {
1539
+ /**
1540
+ * Alias identifier
1541
+ */
1542
+ id: string;
1543
+ };
1544
+ query?: never;
1545
+ url: '/bodhi/v1/models/{id}';
1546
+ };
1547
+ export type UpdateAliasErrors = {
1548
+ /**
1549
+ * Invalid request
1550
+ */
1551
+ 400: OpenAiApiError;
1552
+ /**
1553
+ * Internal server error
1554
+ */
1555
+ 500: OpenAiApiError;
1556
+ };
1557
+ export type UpdateAliasError = UpdateAliasErrors[keyof UpdateAliasErrors];
1558
+ export type UpdateAliasResponses = {
1559
+ /**
1560
+ * Alias created succesfully
1561
+ */
1562
+ 201: UserAliasResponse;
1563
+ };
1564
+ export type UpdateAliasResponse = UpdateAliasResponses[keyof UpdateAliasResponses];
761
1565
  export type ListSettingsData = {
762
1566
  body?: never;
763
1567
  path?: never;
@@ -777,7 +1581,7 @@ export type ListSettingsErrors = {
777
1581
  export type ListSettingsError = ListSettingsErrors[keyof ListSettingsErrors];
778
1582
  export type ListSettingsResponses = {
779
1583
  /**
780
- * List of application settings
1584
+ * Application settings retrieved successfully
781
1585
  */
782
1586
  200: Array<SettingInfo>;
783
1587
  };
@@ -786,7 +1590,7 @@ export type DeleteSettingData = {
786
1590
  body?: never;
787
1591
  path: {
788
1592
  /**
789
- * Setting key to reset
1593
+ * Setting key identifier to reset to default value
790
1594
  */
791
1595
  key: string;
792
1596
  };
@@ -812,11 +1616,14 @@ export type UpdateSettingData = {
812
1616
  * Request to update a setting value
813
1617
  */
814
1618
  body: {
1619
+ /**
1620
+ * New value for the setting (type depends on setting metadata)
1621
+ */
815
1622
  value: unknown;
816
1623
  };
817
1624
  path: {
818
1625
  /**
819
- * Setting key to update
1626
+ * Setting key identifier (e.g., BODHI_LOG_LEVEL, BODHI_PORT)
820
1627
  */
821
1628
  key: string;
822
1629
  };
@@ -842,6 +1649,9 @@ export type UpdateSettingResponses = {
842
1649
  };
843
1650
  export type UpdateSettingResponse = UpdateSettingResponses[keyof UpdateSettingResponses];
844
1651
  export type SetupAppData = {
1652
+ /**
1653
+ * Application setup configuration
1654
+ */
845
1655
  body: SetupRequest;
846
1656
  path?: never;
847
1657
  query?: never;
@@ -849,18 +1659,18 @@ export type SetupAppData = {
849
1659
  };
850
1660
  export type SetupAppErrors = {
851
1661
  /**
852
- * Application is already setup
1662
+ * Invalid request or application already setup
853
1663
  */
854
1664
  400: OpenAiApiError;
855
1665
  /**
856
- * Internal server error
1666
+ * Internal server error during setup
857
1667
  */
858
1668
  500: OpenAiApiError;
859
1669
  };
860
1670
  export type SetupAppError = SetupAppErrors[keyof SetupAppErrors];
861
1671
  export type SetupAppResponses = {
862
1672
  /**
863
- * Application setup successful
1673
+ * Application setup completed successfully
864
1674
  */
865
1675
  200: SetupResponse;
866
1676
  };
@@ -870,19 +1680,19 @@ export type ListApiTokensData = {
870
1680
  path?: never;
871
1681
  query?: {
872
1682
  /**
873
- * Page number (1-based)
1683
+ * Page number (1-based indexing)
874
1684
  */
875
1685
  page?: number;
876
1686
  /**
877
- * Number of items per page (max 100)
1687
+ * Number of items to return per page (maximum 100)
878
1688
  */
879
1689
  page_size?: number;
880
1690
  /**
881
- * Field to sort by (repo, filename, size, updated_at, snapshot)
1691
+ * Field to sort by. Common values: repo, filename, size, updated_at, snapshot, created_at
882
1692
  */
883
- sort?: string | null;
1693
+ sort?: string;
884
1694
  /**
885
- * Sort order (asc or desc)
1695
+ * Sort order: 'asc' for ascending, 'desc' for descending
886
1696
  */
887
1697
  sort_order?: string;
888
1698
  };
@@ -903,10 +1713,13 @@ export type ListApiTokensResponses = {
903
1713
  /**
904
1714
  * List of API tokens
905
1715
  */
906
- 200: PaginatedResponseApiToken;
1716
+ 200: PaginatedApiTokenResponse;
907
1717
  };
908
1718
  export type ListApiTokensResponse = ListApiTokensResponses[keyof ListApiTokensResponses];
909
1719
  export type CreateApiTokenData = {
1720
+ /**
1721
+ * API token creation parameters
1722
+ */
910
1723
  body: CreateApiTokenRequest;
911
1724
  path?: never;
912
1725
  query?: never;
@@ -914,11 +1727,11 @@ export type CreateApiTokenData = {
914
1727
  };
915
1728
  export type CreateApiTokenErrors = {
916
1729
  /**
917
- * Invalid request
1730
+ * Invalid request parameters or token name already exists
918
1731
  */
919
1732
  400: OpenAiApiError;
920
1733
  /**
921
- * Internal server error
1734
+ * Internal server error during token creation
922
1735
  */
923
1736
  500: OpenAiApiError;
924
1737
  };
@@ -937,7 +1750,7 @@ export type UpdateApiTokenData = {
937
1750
  body: UpdateApiTokenRequest;
938
1751
  path: {
939
1752
  /**
940
- * Token identifier
1753
+ * Unique identifier of the API token to update
941
1754
  */
942
1755
  id: string;
943
1756
  };
@@ -974,18 +1787,208 @@ export type GetCurrentUserData = {
974
1787
  };
975
1788
  export type GetCurrentUserErrors = {
976
1789
  /**
977
- * Error in extracting user info from token
1790
+ * Authentication error or invalid token
978
1791
  */
979
1792
  500: OpenAiApiError;
980
1793
  };
981
1794
  export type GetCurrentUserError = GetCurrentUserErrors[keyof GetCurrentUserErrors];
982
1795
  export type GetCurrentUserResponses = {
983
1796
  /**
984
- * Returns current user information
1797
+ * Current user information retrieved successfully
985
1798
  */
986
- 200: UserInfo;
1799
+ 200: UserResponse;
987
1800
  };
988
1801
  export type GetCurrentUserResponse = GetCurrentUserResponses[keyof GetCurrentUserResponses];
1802
+ export type RequestUserAccessData = {
1803
+ body?: never;
1804
+ path?: never;
1805
+ query?: never;
1806
+ url: '/bodhi/v1/user/request-access';
1807
+ };
1808
+ export type RequestUserAccessErrors = {
1809
+ /**
1810
+ * Not authenticated
1811
+ */
1812
+ 401: OpenAiApiError;
1813
+ /**
1814
+ * Pending request already exists
1815
+ */
1816
+ 409: OpenAiApiError;
1817
+ /**
1818
+ * User already has role
1819
+ */
1820
+ 422: OpenAiApiError;
1821
+ };
1822
+ export type RequestUserAccessError = RequestUserAccessErrors[keyof RequestUserAccessErrors];
1823
+ export type RequestUserAccessResponses = {
1824
+ /**
1825
+ * Access request created successfully
1826
+ */
1827
+ 201: EmptyResponse;
1828
+ };
1829
+ export type RequestUserAccessResponse = RequestUserAccessResponses[keyof RequestUserAccessResponses];
1830
+ export type GetUserAccessStatusData = {
1831
+ body?: never;
1832
+ path?: never;
1833
+ query?: never;
1834
+ url: '/bodhi/v1/user/request-status';
1835
+ };
1836
+ export type GetUserAccessStatusErrors = {
1837
+ /**
1838
+ * Bad Request
1839
+ */
1840
+ 400: OpenAiApiError;
1841
+ /**
1842
+ * Not authenticated
1843
+ */
1844
+ 401: OpenAiApiError;
1845
+ /**
1846
+ * Request not found
1847
+ */
1848
+ 404: OpenAiApiError;
1849
+ };
1850
+ export type GetUserAccessStatusError = GetUserAccessStatusErrors[keyof GetUserAccessStatusErrors];
1851
+ export type GetUserAccessStatusResponses = {
1852
+ /**
1853
+ * Request status retrieved
1854
+ */
1855
+ 200: UserAccessStatusResponse;
1856
+ };
1857
+ export type GetUserAccessStatusResponse = GetUserAccessStatusResponses[keyof GetUserAccessStatusResponses];
1858
+ export type ListUsersData = {
1859
+ body?: never;
1860
+ path?: never;
1861
+ query?: {
1862
+ /**
1863
+ * Page number (1-based)
1864
+ */
1865
+ page?: number;
1866
+ /**
1867
+ * Number of users per page
1868
+ */
1869
+ page_size?: number;
1870
+ };
1871
+ url: '/bodhi/v1/users';
1872
+ };
1873
+ export type ListUsersErrors = {
1874
+ /**
1875
+ * Invalid request parameters
1876
+ */
1877
+ 400: OpenAiApiError;
1878
+ /**
1879
+ * Not authenticated
1880
+ */
1881
+ 401: OpenAiApiError;
1882
+ /**
1883
+ * Insufficient permissions
1884
+ */
1885
+ 403: OpenAiApiError;
1886
+ /**
1887
+ * Internal server error
1888
+ */
1889
+ 500: OpenAiApiError;
1890
+ };
1891
+ export type ListUsersError = ListUsersErrors[keyof ListUsersErrors];
1892
+ export type ListUsersResponses = {
1893
+ /**
1894
+ * Users retrieved successfully
1895
+ */
1896
+ 200: UserListResponse;
1897
+ };
1898
+ export type ListUsersResponse = ListUsersResponses[keyof ListUsersResponses];
1899
+ export type RemoveUserData = {
1900
+ body?: never;
1901
+ path: {
1902
+ /**
1903
+ * User ID to remove
1904
+ */
1905
+ user_id: string;
1906
+ };
1907
+ query?: never;
1908
+ url: '/bodhi/v1/users/{user_id}';
1909
+ };
1910
+ export type RemoveUserErrors = {
1911
+ /**
1912
+ * Invalid request
1913
+ */
1914
+ 400: OpenAiApiError;
1915
+ /**
1916
+ * Not authenticated
1917
+ */
1918
+ 401: OpenAiApiError;
1919
+ /**
1920
+ * Insufficient permissions
1921
+ */
1922
+ 403: OpenAiApiError;
1923
+ /**
1924
+ * User not found
1925
+ */
1926
+ 404: OpenAiApiError;
1927
+ /**
1928
+ * Internal server error
1929
+ */
1930
+ 500: OpenAiApiError;
1931
+ };
1932
+ export type RemoveUserError = RemoveUserErrors[keyof RemoveUserErrors];
1933
+ export type RemoveUserResponses = {
1934
+ /**
1935
+ * User removed successfully
1936
+ */
1937
+ 200: unknown;
1938
+ };
1939
+ export type ChangeUserRoleData = {
1940
+ body: ChangeRoleRequest;
1941
+ path: {
1942
+ /**
1943
+ * User ID to change role for
1944
+ */
1945
+ user_id: string;
1946
+ };
1947
+ query?: never;
1948
+ url: '/bodhi/v1/users/{user_id}/role';
1949
+ };
1950
+ export type ChangeUserRoleErrors = {
1951
+ /**
1952
+ * Invalid request
1953
+ */
1954
+ 400: OpenAiApiError;
1955
+ /**
1956
+ * Not authenticated
1957
+ */
1958
+ 401: OpenAiApiError;
1959
+ /**
1960
+ * Insufficient permissions
1961
+ */
1962
+ 403: OpenAiApiError;
1963
+ /**
1964
+ * User not found
1965
+ */
1966
+ 404: OpenAiApiError;
1967
+ /**
1968
+ * Internal server error
1969
+ */
1970
+ 500: OpenAiApiError;
1971
+ };
1972
+ export type ChangeUserRoleError = ChangeUserRoleErrors[keyof ChangeUserRoleErrors];
1973
+ export type ChangeUserRoleResponses = {
1974
+ /**
1975
+ * Role changed successfully
1976
+ */
1977
+ 200: unknown;
1978
+ };
1979
+ export type HealthCheckData = {
1980
+ body?: never;
1981
+ path?: never;
1982
+ query?: never;
1983
+ url: '/health';
1984
+ };
1985
+ export type HealthCheckResponses = {
1986
+ /**
1987
+ * Application is healthy and fully operational
1988
+ */
1989
+ 200: PingResponse;
1990
+ };
1991
+ export type HealthCheckResponse = HealthCheckResponses[keyof HealthCheckResponses];
989
1992
  export type PingServerData = {
990
1993
  body?: never;
991
1994
  path?: never;
@@ -994,7 +1997,7 @@ export type PingServerData = {
994
1997
  };
995
1998
  export type PingServerResponses = {
996
1999
  /**
997
- * Server is healthy
2000
+ * Server is responding normally
998
2001
  */
999
2002
  200: PingResponse;
1000
2003
  };
@@ -1051,9 +2054,42 @@ export type ListModelsResponses = {
1051
2054
  /**
1052
2055
  * List of available models
1053
2056
  */
1054
- 200: ListModelResponseWrapper;
2057
+ 200: ListModelResponse;
1055
2058
  };
1056
2059
  export type ListModelsResponse = ListModelsResponses[keyof ListModelsResponses];
2060
+ export type GetModelData = {
2061
+ body?: never;
2062
+ path: {
2063
+ /**
2064
+ * Model identifier - can be user alias (e.g., 'llama2:chat'), model alias, or API provider alias
2065
+ */
2066
+ id: string;
2067
+ };
2068
+ query?: never;
2069
+ url: '/v1/models/{id}';
2070
+ };
2071
+ export type GetModelErrors = {
2072
+ /**
2073
+ * Invalid authentication
2074
+ */
2075
+ 401: OpenAiApiError;
2076
+ /**
2077
+ * Model not found
2078
+ */
2079
+ 404: OpenAiApiError;
2080
+ /**
2081
+ * Internal server error
2082
+ */
2083
+ 500: OpenAiApiError;
2084
+ };
2085
+ export type GetModelError = GetModelErrors[keyof GetModelErrors];
2086
+ export type GetModelResponses = {
2087
+ /**
2088
+ * Model details
2089
+ */
2090
+ 200: ModelResponse;
2091
+ };
2092
+ export type GetModelResponse = GetModelResponses[keyof GetModelResponses];
1057
2093
  export type ClientOptions = {
1058
2094
  baseUrl: 'http://localhost:1135' | (string & {});
1059
2095
  };