@bodhiapp/ts-client 0.1.6 → 0.1.7

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.
@@ -10,12 +10,12 @@ export type Alias = (UserAlias & {
10
10
  source: 'api';
11
11
  });
12
12
  export type ApiAlias = {
13
+ id: string;
13
14
  api_format: ApiFormat;
14
15
  base_url: string;
15
- created_at: string;
16
- id: string;
17
16
  models: Array<string>;
18
17
  prefix?: string | null;
18
+ created_at: string;
19
19
  updated_at: string;
20
20
  };
21
21
  /**
@@ -32,30 +32,31 @@ export type ApiFormatsResponse = {
32
32
  * Response containing API model configuration
33
33
  */
34
34
  export type ApiModelResponse = {
35
+ id: string;
35
36
  api_format: ApiFormat;
36
- api_key_masked: string;
37
37
  base_url: string;
38
- created_at: string;
39
- id: string;
38
+ api_key_masked: string;
40
39
  models: Array<string>;
41
40
  prefix?: string | null;
41
+ created_at: string;
42
42
  updated_at: string;
43
43
  };
44
44
  export type ApiToken = {
45
- created_at: string;
46
45
  id: string;
46
+ user_id: string;
47
47
  name: string;
48
- status: TokenStatus;
48
+ token_prefix: string;
49
49
  token_hash: string;
50
- token_id: string;
50
+ scopes: string;
51
+ status: TokenStatus;
52
+ created_at: string;
51
53
  updated_at: string;
52
- user_id: string;
53
54
  };
54
55
  export type ApiTokenResponse = {
55
56
  /**
56
- * API token with bapp_ prefix for programmatic access
57
+ * API token with bodhiapp_ prefix for programmatic access
57
58
  */
58
- offline_token: string;
59
+ token: string;
59
60
  };
60
61
  export type AppAccessRequest = {
61
62
  app_client_id: string;
@@ -67,16 +68,16 @@ export type AppAccessResponse = {
67
68
  * Application information and status
68
69
  */
69
70
  export type AppInfo = {
70
- /**
71
- * Current application setup and operational status
72
- */
73
- status: AppStatus;
74
71
  /**
75
72
  * Application version number (semantic versioning)
76
73
  */
77
74
  version: string;
75
+ /**
76
+ * Current application setup and operational status
77
+ */
78
+ status: AppStatus;
78
79
  };
79
- export type AppRole = Role | TokenScope | UserScope;
80
+ export type AppRole = ResourceRole | TokenScope | UserScope;
80
81
  export type AppStatus = 'setup' | 'ready' | 'resource-admin';
81
82
  /**
82
83
  * Request body for approving access with role assignment
@@ -85,13 +86,17 @@ export type ApproveUserAccessRequest = {
85
86
  /**
86
87
  * Role to assign to the user
87
88
  */
88
- role: Role;
89
+ role: ResourceRole;
89
90
  };
90
91
  export type AuthCallbackRequest = {
91
92
  /**
92
93
  * OAuth authorization code from successful authentication (required for success flow)
93
94
  */
94
95
  code?: string | null;
96
+ /**
97
+ * OAuth state parameter for CSRF protection (must match initiated request)
98
+ */
99
+ state?: string | null;
95
100
  /**
96
101
  * OAuth error code if authentication failed (e.g., "access_denied")
97
102
  */
@@ -100,10 +105,6 @@ export type AuthCallbackRequest = {
100
105
  * Human-readable OAuth error description if authentication failed
101
106
  */
102
107
  error_description?: string | null;
103
- /**
104
- * OAuth state parameter for CSRF protection (must match initiated request)
105
- */
106
- state?: string | null;
107
108
  [key: string]: string | (string | null) | (string | null) | (string | null) | (string | null) | undefined;
108
109
  };
109
110
  /**
@@ -115,21 +116,393 @@ export type ChangeRoleRequest = {
115
116
  */
116
117
  role: string;
117
118
  };
119
+ export type ChatChoice = {
120
+ /**
121
+ * The index of the choice in the list of choices.
122
+ */
123
+ index: number;
124
+ message: ChatCompletionResponseMessage;
125
+ finish_reason?: null | FinishReason;
126
+ logprobs?: null | ChatChoiceLogprobs;
127
+ };
128
+ export type ChatChoiceLogprobs = {
129
+ /**
130
+ * A list of message content tokens with log probability information.
131
+ */
132
+ content?: Array<ChatCompletionTokenLogprob> | null;
133
+ refusal?: Array<ChatCompletionTokenLogprob> | null;
134
+ };
135
+ export type ChatChoiceStream = {
136
+ /**
137
+ * The index of the choice in the list of choices.
138
+ */
139
+ index: number;
140
+ delta: ChatCompletionStreamResponseDelta;
141
+ finish_reason?: null | FinishReason;
142
+ logprobs?: null | ChatChoiceLogprobs;
143
+ };
144
+ export type ChatCompletionAudio = {
145
+ /**
146
+ * The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these voices are less expressive).
147
+ */
148
+ voice: ChatCompletionAudioVoice;
149
+ /**
150
+ * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`.
151
+ */
152
+ format: ChatCompletionAudioFormat;
153
+ };
154
+ export type ChatCompletionAudioFormat = 'wav' | 'mp3' | 'flac' | 'opus' | 'pcm16';
155
+ export type ChatCompletionAudioVoice = 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
156
+ export type ChatCompletionFunctionCall = 'none' | 'auto' | {
157
+ /**
158
+ * Forces the model to call the specified function.
159
+ */
160
+ Function: {
161
+ name: string;
162
+ };
163
+ };
164
+ /**
165
+ * @deprecated
166
+ */
167
+ export type ChatCompletionFunctions = {
168
+ /**
169
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
170
+ */
171
+ name: string;
172
+ /**
173
+ * A description of what the function does, used by the model to choose when and how to call the function.
174
+ */
175
+ description?: string | null;
176
+ /**
177
+ * The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
178
+ *
179
+ * Omitting `parameters` defines a function with an empty parameter list.
180
+ */
181
+ parameters: unknown;
182
+ };
183
+ export type ChatCompletionMessageToolCall = {
184
+ /**
185
+ * The ID of the tool call.
186
+ */
187
+ id: string;
188
+ /**
189
+ * The type of the tool. Currently, only `function` is supported.
190
+ */
191
+ type: ChatCompletionToolType;
192
+ /**
193
+ * The function that the model called.
194
+ */
195
+ function: FunctionCall;
196
+ };
197
+ export type ChatCompletionMessageToolCallChunk = {
198
+ index: number;
199
+ /**
200
+ * The ID of the tool call.
201
+ */
202
+ id?: string | null;
203
+ type?: null | ChatCompletionToolType;
204
+ function?: null | FunctionCallStream;
205
+ };
206
+ /**
207
+ * Output types that you would like the model to generate for this request.
208
+ *
209
+ * Most models are capable of generating text, which is the default: `["text"]`
210
+ *
211
+ * The `gpt-4o-audio-preview` model can also be used to [generate
212
+ * audio](https://platform.openai.com/docs/guides/audio). To request that this model generate both text and audio responses, you can use: `["text", "audio"]`
213
+ */
214
+ export type ChatCompletionModalities = 'text' | 'audio';
215
+ /**
216
+ * Specifies a tool the model should use. Use to force the model to call a specific function.
217
+ */
218
+ export type ChatCompletionNamedToolChoice = {
219
+ /**
220
+ * The type of the tool. Currently, only `function` is supported.
221
+ */
222
+ type: ChatCompletionToolType;
223
+ function: FunctionName;
224
+ };
225
+ export type ChatCompletionRequestAssistantMessage = {
226
+ content?: null | ChatCompletionRequestAssistantMessageContent;
227
+ /**
228
+ * The refusal message by the assistant.
229
+ */
230
+ refusal?: string | null;
231
+ /**
232
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
233
+ */
234
+ name?: string | null;
235
+ audio?: null | ChatCompletionRequestAssistantMessageAudio;
236
+ tool_calls?: Array<ChatCompletionMessageToolCall> | null;
237
+ function_call?: null | FunctionCall;
238
+ };
239
+ export type ChatCompletionRequestAssistantMessageAudio = {
240
+ /**
241
+ * Unique identifier for a previous audio response from the model.
242
+ */
243
+ id: string;
244
+ };
245
+ export type ChatCompletionRequestAssistantMessageContent = string | Array<ChatCompletionRequestAssistantMessageContentPart>;
246
+ export type ChatCompletionRequestAssistantMessageContentPart = (ChatCompletionRequestMessageContentPartText & {
247
+ type: 'text';
248
+ }) | (ChatCompletionRequestMessageContentPartRefusal & {
249
+ type: 'refusal';
250
+ });
251
+ export type ChatCompletionRequestDeveloperMessage = {
252
+ /**
253
+ * The contents of the developer message.
254
+ */
255
+ content: ChatCompletionRequestDeveloperMessageContent;
256
+ /**
257
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
258
+ */
259
+ name?: string | null;
260
+ };
261
+ export type ChatCompletionRequestDeveloperMessageContent = string | Array<ChatCompletionRequestMessageContentPartText>;
262
+ export type ChatCompletionRequestFunctionMessage = {
263
+ /**
264
+ * The return value from the function call, to return to the model.
265
+ */
266
+ content?: string | null;
267
+ /**
268
+ * The name of the function to call.
269
+ */
270
+ name: string;
271
+ };
272
+ export type ChatCompletionRequestMessage = (ChatCompletionRequestDeveloperMessage & {
273
+ role: 'developer';
274
+ }) | (ChatCompletionRequestSystemMessage & {
275
+ role: 'system';
276
+ }) | (ChatCompletionRequestUserMessage & {
277
+ role: 'user';
278
+ }) | (ChatCompletionRequestAssistantMessage & {
279
+ role: 'assistant';
280
+ }) | (ChatCompletionRequestToolMessage & {
281
+ role: 'tool';
282
+ }) | (ChatCompletionRequestFunctionMessage & {
283
+ role: 'function';
284
+ });
285
+ /**
286
+ * Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).
287
+ */
288
+ export type ChatCompletionRequestMessageContentPartAudio = {
289
+ input_audio: InputAudio;
290
+ };
291
+ export type ChatCompletionRequestMessageContentPartImage = {
292
+ image_url: ImageUrl;
293
+ };
294
+ export type ChatCompletionRequestMessageContentPartRefusal = {
295
+ /**
296
+ * The refusal message generated by the model.
297
+ */
298
+ refusal: string;
299
+ };
300
+ export type ChatCompletionRequestMessageContentPartText = {
301
+ text: string;
302
+ };
303
+ export type ChatCompletionRequestSystemMessage = {
304
+ /**
305
+ * The contents of the system message.
306
+ */
307
+ content: ChatCompletionRequestSystemMessageContent;
308
+ /**
309
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
310
+ */
311
+ name?: string | null;
312
+ };
313
+ export type ChatCompletionRequestSystemMessageContent = string | Array<ChatCompletionRequestSystemMessageContentPart>;
314
+ export type ChatCompletionRequestSystemMessageContentPart = ChatCompletionRequestMessageContentPartText & {
315
+ type: 'text';
316
+ };
317
+ /**
318
+ * Tool message
319
+ */
320
+ export type ChatCompletionRequestToolMessage = {
321
+ /**
322
+ * The contents of the tool message.
323
+ */
324
+ content: ChatCompletionRequestToolMessageContent;
325
+ tool_call_id: string;
326
+ };
327
+ export type ChatCompletionRequestToolMessageContent = string | Array<ChatCompletionRequestToolMessageContentPart>;
328
+ export type ChatCompletionRequestToolMessageContentPart = ChatCompletionRequestMessageContentPartText & {
329
+ type: 'text';
330
+ };
331
+ export type ChatCompletionRequestUserMessage = {
332
+ /**
333
+ * The contents of the user message.
334
+ */
335
+ content: ChatCompletionRequestUserMessageContent;
336
+ /**
337
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
338
+ */
339
+ name?: string | null;
340
+ };
341
+ export type ChatCompletionRequestUserMessageContent = string | Array<ChatCompletionRequestUserMessageContentPart>;
342
+ export type ChatCompletionRequestUserMessageContentPart = (ChatCompletionRequestMessageContentPartText & {
343
+ type: 'text';
344
+ }) | (ChatCompletionRequestMessageContentPartImage & {
345
+ type: 'image_url';
346
+ }) | (ChatCompletionRequestMessageContentPartAudio & {
347
+ type: 'input_audio';
348
+ });
349
+ /**
350
+ * A chat completion message generated by the model.
351
+ */
352
+ export type ChatCompletionResponseMessage = {
353
+ /**
354
+ * The contents of the message.
355
+ */
356
+ content?: string | null;
357
+ /**
358
+ * The refusal message generated by the model.
359
+ */
360
+ refusal?: string | null;
361
+ /**
362
+ * The tool calls generated by the model, such as function calls.
363
+ */
364
+ tool_calls?: Array<ChatCompletionMessageToolCall> | null;
365
+ /**
366
+ * The role of the author of this message.
367
+ */
368
+ role: Role;
369
+ function_call?: null | FunctionCall;
370
+ audio?: null | ChatCompletionResponseMessageAudio;
371
+ };
372
+ export type ChatCompletionResponseMessageAudio = {
373
+ /**
374
+ * Unique identifier for this audio response.
375
+ */
376
+ id: string;
377
+ /**
378
+ * The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations.
379
+ */
380
+ expires_at: number;
381
+ /**
382
+ * Base64 encoded audio bytes generated by the model, in the format specified in the request.
383
+ */
384
+ data: string;
385
+ /**
386
+ * Transcript of the audio generated by the model.
387
+ */
388
+ transcript: string;
389
+ };
390
+ /**
391
+ * Options for streaming response. Only set this when you set `stream: true`.
392
+ */
393
+ export type ChatCompletionStreamOptions = {
394
+ /**
395
+ * If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value.
396
+ */
397
+ include_usage: boolean;
398
+ };
399
+ /**
400
+ * A chat completion delta generated by streamed model responses.
401
+ */
402
+ export type ChatCompletionStreamResponseDelta = {
403
+ /**
404
+ * The contents of the chunk message.
405
+ */
406
+ content?: string | null;
407
+ function_call?: null | FunctionCallStream;
408
+ tool_calls?: Array<ChatCompletionMessageToolCallChunk> | null;
409
+ role?: null | Role;
410
+ /**
411
+ * The refusal message generated by the model.
412
+ */
413
+ refusal?: string | null;
414
+ };
415
+ export type ChatCompletionTokenLogprob = {
416
+ /**
417
+ * The token.
418
+ */
419
+ token: string;
420
+ /**
421
+ * The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely.
422
+ */
423
+ logprob: number;
424
+ /**
425
+ * A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
426
+ */
427
+ bytes?: Array<number> | null;
428
+ /**
429
+ * List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
430
+ */
431
+ top_logprobs: Array<TopLogprobs>;
432
+ };
433
+ export type ChatCompletionTool = {
434
+ type: ChatCompletionToolType;
435
+ function: FunctionObject;
436
+ };
437
+ /**
438
+ * Controls which (if any) tool is called by the model.
439
+ * `none` means the model will not call any tool and instead generates a message.
440
+ * `auto` means the model can pick between generating a message or calling one or more tools.
441
+ * `required` means the model must call one or more tools.
442
+ * Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool.
443
+ *
444
+ * `none` is the default when no tools are present. `auto` is the default if tools are present.
445
+ */
446
+ export type ChatCompletionToolChoiceOption = 'none' | 'auto' | 'required' | {
447
+ named: ChatCompletionNamedToolChoice;
448
+ };
449
+ export type ChatCompletionToolType = 'function';
118
450
  export type ChatRequest = {
451
+ model: string;
452
+ messages: Array<Message>;
453
+ stream?: boolean | null;
119
454
  format?: string | null;
120
455
  keep_alive?: null | Duration;
121
- messages: Array<Message>;
122
- model: string;
123
456
  options?: null | Options;
124
- stream?: boolean | null;
457
+ };
458
+ /**
459
+ * Breakdown of tokens used in a completion.
460
+ */
461
+ export type CompletionTokensDetails = {
462
+ accepted_prediction_tokens?: number | null;
463
+ /**
464
+ * Audio input tokens generated by the model.
465
+ */
466
+ audio_tokens?: number | null;
467
+ /**
468
+ * Tokens generated by the model for reasoning.
469
+ */
470
+ reasoning_tokens?: number | null;
471
+ /**
472
+ * When using Predicted Outputs, the number of tokens in the
473
+ * prediction that did not appear in the completion. However, like
474
+ * reasoning tokens, these tokens are still counted in the total
475
+ * completion tokens for purposes of billing, output, and context
476
+ * window limits.
477
+ */
478
+ rejected_prediction_tokens?: number | null;
479
+ };
480
+ /**
481
+ * Usage statistics for the completion request.
482
+ */
483
+ export type CompletionUsage = {
484
+ /**
485
+ * Number of tokens in the prompt.
486
+ */
487
+ prompt_tokens: number;
488
+ /**
489
+ * Number of tokens in the generated completion.
490
+ */
491
+ completion_tokens: number;
492
+ /**
493
+ * Total number of tokens used in the request (prompt + completion).
494
+ */
495
+ total_tokens: number;
496
+ prompt_tokens_details?: null | PromptTokensDetails;
497
+ completion_tokens_details?: null | CompletionTokensDetails;
125
498
  };
126
499
  export type CreateAliasRequest = {
127
500
  alias: string;
128
- context_params?: Array<string> | null;
129
- filename: string;
130
501
  repo: string;
131
- request_params?: null | OaiRequestParams;
502
+ filename: string;
132
503
  snapshot?: string | null;
504
+ request_params?: null | OaiRequestParams;
505
+ context_params?: Array<string> | null;
133
506
  };
134
507
  /**
135
508
  * Request to create a new API model configuration
@@ -139,14 +512,14 @@ export type CreateApiModelRequest = {
139
512
  * API format/protocol (e.g., "openai")
140
513
  */
141
514
  api_format: ApiFormat;
142
- /**
143
- * API key for authentication
144
- */
145
- api_key: string;
146
515
  /**
147
516
  * API base URL
148
517
  */
149
518
  base_url: string;
519
+ /**
520
+ * API key for authentication
521
+ */
522
+ api_key: string;
150
523
  /**
151
524
  * List of available models
152
525
  */
@@ -164,41 +537,298 @@ export type CreateApiTokenRequest = {
164
537
  * Descriptive name for the API token (minimum 3 characters)
165
538
  */
166
539
  name?: string | null;
540
+ /**
541
+ * Token scope defining access level
542
+ */
543
+ scope: TokenScope;
544
+ };
545
+ export type CreateChatCompletionRequest = {
546
+ /**
547
+ * A list of messages comprising the conversation so far. Depending on the [model](https://platform.openai.com/docs/models) you use, different message types (modalities) are supported, like [text](https://platform.openai.com/docs/guides/text-generation), [images](https://platform.openai.com/docs/guides/vision), and [audio](https://platform.openai.com/docs/guides/audio).
548
+ */
549
+ messages: Array<ChatCompletionRequestMessage>;
550
+ /**
551
+ * ID of the model to use.
552
+ * See the [model endpoint compatibility](https://platform.openai.com/docs/models#model-endpoint-compatibility) table for details on which models work with the Chat API.
553
+ */
554
+ model: string;
555
+ /**
556
+ * Whether or not to store the output of this chat completion request
557
+ *
558
+ * for use in our [model distillation](https://platform.openai.com/docs/guides/distillation) or [evals](https://platform.openai.com/docs/guides/evals) products.
559
+ */
560
+ store?: boolean | null;
561
+ reasoning_effort?: null | ReasoningEffort;
562
+ /**
563
+ * Developer-defined tags and values used for filtering completions in the [dashboard](https://platform.openai.com/chat-completions).
564
+ */
565
+ metadata?: unknown;
566
+ /**
567
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
568
+ */
569
+ frequency_penalty?: number | null;
570
+ /**
571
+ * Modify the likelihood of specified tokens appearing in the completion.
572
+ *
573
+ * Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100.
574
+ * Mathematically, the bias is added to the logits generated by the model prior to sampling.
575
+ * The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection;
576
+ * values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
577
+ */
578
+ logit_bias?: {} | null;
579
+ /**
580
+ * Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the `content` of `message`.
581
+ */
582
+ logprobs?: boolean | null;
583
+ /**
584
+ * An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. `logprobs` must be set to `true` if this parameter is used.
585
+ */
586
+ top_logprobs?: number | null;
587
+ /**
588
+ * The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the chat completion.
589
+ *
590
+ * This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.
591
+ * This value is now deprecated in favor of `max_completion_tokens`, and is
592
+ * not compatible with [o1 series models](https://platform.openai.com/docs/guides/reasoning).
593
+ * @deprecated
594
+ */
595
+ max_tokens?: number | null;
596
+ /**
597
+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
598
+ */
599
+ max_completion_tokens?: number | null;
600
+ /**
601
+ * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.
602
+ */
603
+ n?: number | null;
604
+ modalities?: Array<ChatCompletionModalities> | null;
605
+ prediction?: null | PredictionContent;
606
+ audio?: null | ChatCompletionAudio;
607
+ /**
608
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
609
+ */
610
+ presence_penalty?: number | null;
611
+ response_format?: null | ResponseFormat;
612
+ /**
613
+ * This feature is in Beta.
614
+ * If specified, our system will make a best effort to sample deterministically, such that repeated requests
615
+ * with the same `seed` and parameters should return the same result.
616
+ * Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
617
+ */
618
+ seed?: number | null;
619
+ service_tier?: null | ServiceTier;
620
+ stop?: null | Stop;
621
+ /**
622
+ * If set, partial message deltas will be sent, like in ChatGPT.
623
+ * Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
624
+ * as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
625
+ */
626
+ stream?: boolean | null;
627
+ stream_options?: null | ChatCompletionStreamOptions;
628
+ /**
629
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,
630
+ * while lower values like 0.2 will make it more focused and deterministic.
631
+ *
632
+ * We generally recommend altering this or `top_p` but not both.
633
+ */
634
+ temperature?: number | null;
635
+ /**
636
+ * An alternative to sampling with temperature, called nucleus sampling,
637
+ * where the model considers the results of the tokens with top_p probability mass.
638
+ * So 0.1 means only the tokens comprising the top 10% probability mass are considered.
639
+ *
640
+ * We generally recommend altering this or `temperature` but not both.
641
+ */
642
+ top_p?: number | null;
643
+ /**
644
+ * A list of tools the model may call. Currently, only functions are supported as a tool.
645
+ * Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
646
+ */
647
+ tools?: Array<ChatCompletionTool> | null;
648
+ tool_choice?: null | ChatCompletionToolChoiceOption;
649
+ /**
650
+ * Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling/parallel-function-calling) during tool use.
651
+ */
652
+ parallel_tool_calls?: boolean | null;
653
+ /**
654
+ * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
655
+ */
656
+ user?: string | null;
657
+ web_search_options?: null | WebSearchOptions;
658
+ function_call?: null | ChatCompletionFunctionCall;
659
+ /**
660
+ * Deprecated in favor of `tools`.
661
+ *
662
+ * A list of functions the model may generate JSON inputs for.
663
+ * @deprecated
664
+ */
665
+ functions?: Array<ChatCompletionFunctions> | null;
666
+ };
667
+ /**
668
+ * Represents a chat completion response returned by model, based on the provided input.
669
+ */
670
+ export type CreateChatCompletionResponse = {
671
+ /**
672
+ * A unique identifier for the chat completion.
673
+ */
674
+ id: string;
675
+ /**
676
+ * A list of chat completion choices. Can be more than one if `n` is greater than 1.
677
+ */
678
+ choices: Array<ChatChoice>;
679
+ /**
680
+ * The Unix timestamp (in seconds) of when the chat completion was created.
681
+ */
682
+ created: number;
683
+ /**
684
+ * The model used for the chat completion.
685
+ */
686
+ model: string;
687
+ service_tier?: null | ServiceTierResponse;
688
+ /**
689
+ * This fingerprint represents the backend configuration that the model runs with.
690
+ *
691
+ * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
692
+ */
693
+ system_fingerprint?: string | null;
694
+ /**
695
+ * The object type, which is always `chat.completion`.
696
+ */
697
+ object: string;
698
+ usage?: null | CompletionUsage;
699
+ };
700
+ /**
701
+ * Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
702
+ */
703
+ export type CreateChatCompletionStreamResponse = {
704
+ /**
705
+ * A unique identifier for the chat completion. Each chunk has the same ID.
706
+ */
707
+ id: string;
708
+ /**
709
+ * A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the last chunk if you set `stream_options: {"include_usage": true}`.
710
+ */
711
+ choices: Array<ChatChoiceStream>;
712
+ /**
713
+ * The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
714
+ */
715
+ created: number;
716
+ /**
717
+ * The model to generate the completion.
718
+ */
719
+ model: string;
720
+ service_tier?: null | ServiceTierResponse;
721
+ /**
722
+ * This fingerprint represents the backend configuration that the model runs with.
723
+ * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
724
+ */
725
+ system_fingerprint?: string | null;
726
+ /**
727
+ * The object type, which is always `chat.completion.chunk`.
728
+ */
729
+ object: string;
730
+ usage?: null | CompletionUsage;
731
+ };
732
+ export type CreateEmbeddingRequest = {
733
+ /**
734
+ * ID of the model to use. You can use the
735
+ * [List models](https://platform.openai.com/docs/api-reference/models/list)
736
+ * API to see all of your available models, or see our
737
+ * [Model overview](https://platform.openai.com/docs/models/overview)
738
+ * for descriptions of them.
739
+ */
740
+ model: string;
741
+ /**
742
+ * Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.
743
+ */
744
+ input: EmbeddingInput;
745
+ encoding_format?: null | EncodingFormat;
746
+ /**
747
+ * A unique identifier representing your end-user, which will help OpenAI
748
+ * to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/usage-policies/end-user-ids).
749
+ */
750
+ user?: string | null;
751
+ /**
752
+ * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models.
753
+ */
754
+ dimensions?: number | null;
755
+ };
756
+ export type CreateEmbeddingResponse = {
757
+ object: string;
758
+ /**
759
+ * The name of the model used to generate the embedding.
760
+ */
761
+ model: string;
762
+ /**
763
+ * The list of embeddings generated by the model.
764
+ */
765
+ data: Array<Embedding>;
766
+ /**
767
+ * The usage information for the request.
768
+ */
769
+ usage: EmbeddingUsage;
167
770
  };
168
771
  export type DownloadRequest = {
169
- created_at: string;
170
- downloaded_bytes?: number;
171
- error?: string | null;
172
- filename: string;
173
772
  id: string;
174
773
  repo: string;
175
- started_at: string;
774
+ filename: string;
176
775
  status: DownloadStatus;
177
- total_bytes?: number | null;
776
+ error?: string | null;
777
+ created_at: string;
178
778
  updated_at: string;
779
+ total_bytes?: number | null;
780
+ downloaded_bytes?: number;
781
+ started_at: string;
179
782
  };
180
783
  export type DownloadStatus = 'pending' | 'completed' | 'error';
181
784
  export type Duration = string;
182
- export type EmptyResponse = {
183
- [key: string]: unknown;
785
+ /**
786
+ * Represents an embedding vector returned by embedding endpoint.
787
+ */
788
+ export type Embedding = {
789
+ /**
790
+ * The index of the embedding in the list of embeddings.
791
+ */
792
+ index: number;
793
+ /**
794
+ * The object type, which is always "embedding".
795
+ */
796
+ object: string;
797
+ /**
798
+ * The embedding vector, which is a list of floats. The length of vector
799
+ * depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings).
800
+ */
801
+ embedding: Array<number>;
184
802
  };
185
- export type ErrorBody = {
803
+ export type EmbeddingInput = string | Array<string> | Array<number> | Array<Array<number>>;
804
+ export type EmbeddingUsage = {
186
805
  /**
187
- * Specific error code for programmatic error handling
806
+ * The number of tokens used by the prompt.
188
807
  */
189
- code?: string | null;
808
+ prompt_tokens: number;
190
809
  /**
191
- * Human-readable error message describing what went wrong
810
+ * The total number of tokens used by the request.
192
811
  */
193
- message: string;
812
+ total_tokens: number;
813
+ };
814
+ export type EncodingFormat = 'float' | 'base64';
815
+ export type ErrorBody = {
194
816
  /**
195
- * Parameter name that caused the error (for validation errors)
817
+ * Human-readable error message describing what went wrong
196
818
  */
197
- param?: string | null;
819
+ message: string;
198
820
  /**
199
821
  * Error type categorizing the kind of error that occurred
200
822
  */
201
823
  type: string;
824
+ /**
825
+ * Specific error code for programmatic error handling
826
+ */
827
+ code?: string | null;
828
+ /**
829
+ * Parameter name that caused the error (for validation errors)
830
+ */
831
+ param?: string | null;
202
832
  };
203
833
  /**
204
834
  * Request to fetch available models from provider
@@ -208,14 +838,14 @@ export type FetchModelsRequest = {
208
838
  * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
209
839
  */
210
840
  api_key?: string;
211
- /**
212
- * API base URL (optional when using id)
213
- */
214
- base_url: string;
215
841
  /**
216
842
  * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
217
843
  */
218
844
  id?: string;
845
+ /**
846
+ * API base URL (optional when using id)
847
+ */
848
+ base_url: string;
219
849
  };
220
850
  /**
221
851
  * Response containing available models from provider
@@ -223,12 +853,81 @@ export type FetchModelsRequest = {
223
853
  export type FetchModelsResponse = {
224
854
  models: Array<string>;
225
855
  };
856
+ export type FinishReason = 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
857
+ /**
858
+ * The name and arguments of a function that should be called, as generated by the model.
859
+ */
860
+ export type FunctionCall = {
861
+ /**
862
+ * The name of the function to call.
863
+ */
864
+ name: string;
865
+ /**
866
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
867
+ */
868
+ arguments: string;
869
+ };
870
+ export type FunctionCallStream = {
871
+ /**
872
+ * The name of the function to call.
873
+ */
874
+ name?: string | null;
875
+ /**
876
+ * The arguments to call the function with, as generated by the model in JSON format.
877
+ * Note that the model does not always generate valid JSON, and may hallucinate
878
+ * parameters not defined by your function schema. Validate the arguments in your
879
+ * code before calling your function.
880
+ */
881
+ arguments?: string | null;
882
+ };
883
+ export type FunctionName = {
884
+ /**
885
+ * The name of the function to call.
886
+ */
887
+ name: string;
888
+ };
889
+ export type FunctionObject = {
890
+ /**
891
+ * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
892
+ */
893
+ name: string;
894
+ /**
895
+ * A description of what the function does, used by the model to choose when and how to call the function.
896
+ */
897
+ description?: string | null;
898
+ /**
899
+ * The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/text-generation/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.
900
+ *
901
+ * Omitting `parameters` defines a function with an empty parameter list.
902
+ */
903
+ parameters?: unknown;
904
+ /**
905
+ * Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling).
906
+ */
907
+ strict?: boolean | null;
908
+ };
909
+ export type ImageDetail = 'auto' | 'low' | 'high';
910
+ export type ImageUrl = {
911
+ /**
912
+ * Either a URL of the image or the base64 encoded image data.
913
+ */
914
+ url: string;
915
+ detail?: null | ImageDetail;
916
+ };
917
+ export type InputAudio = {
918
+ /**
919
+ * Base64 encoded audio data.
920
+ */
921
+ data: string;
922
+ /**
923
+ * The format of the encoded audio data. Currently supports "wav" and "mp3".
924
+ */
925
+ format: InputAudioFormat;
926
+ };
927
+ export type InputAudioFormat = 'wav' | 'mp3';
226
928
  export type ListModelResponse = {
929
+ object: string;
227
930
  data: Array<{
228
- /**
229
- * The Unix timestamp (in seconds) when the model was created.
230
- */
231
- created: number;
232
931
  /**
233
932
  * The model identifier, which can be referenced in the API endpoints.
234
933
  */
@@ -237,12 +936,15 @@ export type ListModelResponse = {
237
936
  * The object type, which is always "model".
238
937
  */
239
938
  object: string;
939
+ /**
940
+ * The Unix timestamp (in seconds) when the model was created.
941
+ */
942
+ created: number;
240
943
  /**
241
944
  * The organization that owns the model.
242
945
  */
243
946
  owned_by: string;
244
947
  }>;
245
- object: string;
246
948
  };
247
949
  /**
248
950
  * List users query parameters
@@ -252,46 +954,42 @@ export type ListUsersParams = {
252
954
  page_size?: number | null;
253
955
  };
254
956
  export type LocalModelResponse = {
255
- filename: string;
256
- model_params: {};
257
957
  repo: string;
258
- size?: number | null;
958
+ filename: string;
259
959
  snapshot: string;
960
+ size?: number | null;
961
+ model_params: {};
260
962
  };
261
963
  export type Message = {
964
+ role: string;
262
965
  content: string;
263
966
  images?: Array<string> | null;
264
- role: string;
265
967
  };
266
968
  export type Model = {
267
- details: ModelDetails;
268
- digest: string;
269
969
  model: string;
270
970
  modified_at: number;
271
971
  size: number;
972
+ digest: string;
973
+ details: ModelDetails;
272
974
  };
273
975
  export type ModelAlias = {
274
976
  alias: string;
275
- filename: string;
276
977
  repo: string;
978
+ filename: string;
277
979
  snapshot: string;
278
980
  };
279
981
  export type ModelDetails = {
280
- families?: Array<string> | null;
281
- family: string;
982
+ parent_model?: string | null;
282
983
  format: string;
984
+ family: string;
985
+ families?: Array<string> | null;
283
986
  parameter_size: string;
284
- parent_model?: string | null;
285
987
  quantization_level: string;
286
988
  };
287
989
  /**
288
990
  * Describes an OpenAI model offering that can be used with the API.
289
991
  */
290
992
  export type ModelResponse = {
291
- /**
292
- * The Unix timestamp (in seconds) when the model was created.
293
- */
294
- created: number;
295
993
  /**
296
994
  * The model identifier, which can be referenced in the API endpoints.
297
995
  */
@@ -300,6 +998,10 @@ export type ModelResponse = {
300
998
  * The object type, which is always "model".
301
999
  */
302
1000
  object: string;
1001
+ /**
1002
+ * The Unix timestamp (in seconds) when the model was created.
1003
+ */
1004
+ created: number;
303
1005
  /**
304
1006
  * The organization that owns the model.
305
1007
  */
@@ -312,14 +1014,14 @@ export type ModelsResponse = {
312
1014
  * Request to pull a model file from HuggingFace
313
1015
  */
314
1016
  export type NewDownloadRequest = {
315
- /**
316
- * Model file name to download (typically .gguf format)
317
- */
318
- filename: string;
319
1017
  /**
320
1018
  * HuggingFace repository name in format 'username/repository-name'
321
1019
  */
322
1020
  repo: string;
1021
+ /**
1022
+ * Model file name to download (typically .gguf format)
1023
+ */
1024
+ filename: string;
323
1025
  };
324
1026
  export type OaiRequestParams = {
325
1027
  frequency_penalty?: number | null;
@@ -341,81 +1043,73 @@ export type OpenAiApiError = {
341
1043
  error: ErrorBody;
342
1044
  };
343
1045
  export type Options = {
344
- f16_kv?: boolean | null;
345
- frequency_penalty?: number | null;
346
- logits_all?: boolean | null;
347
- low_vram?: boolean | null;
348
- main_gpu?: number | null;
349
- mirostat?: number | null;
350
- mirostat_eta?: number | null;
351
- mirostat_tau?: number | null;
352
- num_batch?: number | null;
353
- num_ctx?: number | null;
354
- num_gpu?: number | null;
355
1046
  num_keep?: number | null;
356
- num_predict?: number | null;
357
- num_thread?: number | null;
358
- numa?: boolean | null;
359
- penalize_newline?: boolean | null;
360
- presence_penalty?: number | null;
361
- repeat_last_n?: number | null;
362
- repeat_penalty?: number | null;
363
1047
  seed?: number | null;
364
- stop?: Array<string> | null;
365
- temperature?: number | null;
366
- tfs_z?: number | null;
1048
+ num_predict?: number | null;
367
1049
  top_k?: number | null;
368
1050
  top_p?: number | null;
1051
+ tfs_z?: number | null;
369
1052
  typical_p?: number | null;
370
- use_mlock?: boolean | null;
371
- use_mmap?: boolean | null;
1053
+ repeat_last_n?: number | null;
1054
+ temperature?: number | null;
1055
+ repeat_penalty?: number | null;
1056
+ presence_penalty?: number | null;
1057
+ frequency_penalty?: number | null;
1058
+ mirostat?: number | null;
1059
+ mirostat_tau?: number | null;
1060
+ mirostat_eta?: number | null;
1061
+ penalize_newline?: boolean | null;
1062
+ stop?: Array<string> | null;
1063
+ numa?: boolean | null;
1064
+ num_ctx?: number | null;
1065
+ num_batch?: number | null;
1066
+ num_gpu?: number | null;
1067
+ main_gpu?: number | null;
1068
+ low_vram?: boolean | null;
1069
+ f16_kv?: boolean | null;
1070
+ logits_all?: boolean | null;
372
1071
  vocab_only?: boolean | null;
1072
+ use_mmap?: boolean | null;
1073
+ use_mlock?: boolean | null;
1074
+ num_thread?: number | null;
373
1075
  };
374
1076
  export type PaginatedAliasResponse = {
375
1077
  data: Array<Alias>;
1078
+ total: number;
376
1079
  page: number;
377
1080
  page_size: number;
378
- total: number;
379
1081
  };
380
1082
  /**
381
1083
  * Paginated response for API model listings
382
1084
  */
383
1085
  export type PaginatedApiModelResponse = {
384
1086
  data: Array<ApiModelResponse>;
1087
+ total: number;
385
1088
  page: number;
386
1089
  page_size: number;
387
- total: number;
388
1090
  };
389
1091
  export type PaginatedApiTokenResponse = {
390
1092
  data: Array<ApiToken>;
1093
+ total: number;
391
1094
  page: number;
392
1095
  page_size: number;
393
- total: number;
394
1096
  };
395
1097
  export type PaginatedDownloadResponse = {
396
1098
  data: Array<DownloadRequest>;
1099
+ total: number;
397
1100
  page: number;
398
1101
  page_size: number;
399
- total: number;
400
1102
  };
401
1103
  export type PaginatedLocalModelResponse = {
402
1104
  data: Array<LocalModelResponse>;
1105
+ total: number;
403
1106
  page: number;
404
1107
  page_size: number;
405
- total: number;
406
1108
  };
407
1109
  /**
408
1110
  * Paginated response for access requests
409
1111
  */
410
1112
  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
1113
  /**
420
1114
  * List of access requests
421
1115
  */
@@ -424,12 +1118,20 @@ export type PaginatedUserAccessResponse = {
424
1118
  * Total number of requests
425
1119
  */
426
1120
  total: number;
1121
+ /**
1122
+ * Current page number
1123
+ */
1124
+ page: number;
1125
+ /**
1126
+ * Number of items per page
1127
+ */
1128
+ page_size: number;
427
1129
  };
428
1130
  export type PaginatedUserAliasResponse = {
429
1131
  data: Array<UserAliasResponse>;
1132
+ total: number;
430
1133
  page: number;
431
1134
  page_size: number;
432
- total: number;
433
1135
  };
434
1136
  /**
435
1137
  * Query parameters for pagination and sorting
@@ -461,25 +1163,84 @@ export type PingResponse = {
461
1163
  */
462
1164
  message: string;
463
1165
  };
1166
+ /**
1167
+ * The type of the predicted content you want to provide. This type is
1168
+ * currently always `content`.
1169
+ */
1170
+ export type PredictionContent = {
1171
+ /**
1172
+ * The type of the predicted content you want to provide. This type is
1173
+ * currently always `content`.
1174
+ */
1175
+ content: PredictionContentContent;
1176
+ type: 'content';
1177
+ };
1178
+ /**
1179
+ * The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
1180
+ */
1181
+ export type PredictionContentContent = string | Array<ChatCompletionRequestMessageContentPartText>;
1182
+ /**
1183
+ * Breakdown of tokens used in a completion.
1184
+ */
1185
+ export type PromptTokensDetails = {
1186
+ /**
1187
+ * Audio input tokens present in the prompt.
1188
+ */
1189
+ audio_tokens?: number | null;
1190
+ /**
1191
+ * Cached tokens present in the prompt.
1192
+ */
1193
+ cached_tokens?: number | null;
1194
+ };
1195
+ export type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
464
1196
  export type RedirectResponse = {
465
1197
  /**
466
1198
  * The URL to redirect to (OAuth authorization URL or application home page)
467
1199
  */
468
1200
  location: string;
469
1201
  };
470
- export type Role = 'resource_user' | 'resource_power_user' | 'resource_manager' | 'resource_admin';
1202
+ export type ResourceRole = 'resource_user' | 'resource_power_user' | 'resource_manager' | 'resource_admin';
1203
+ export type ResponseFormat = {
1204
+ type: 'text';
1205
+ } | {
1206
+ type: 'json_object';
1207
+ } | {
1208
+ json_schema: ResponseFormatJsonSchema;
1209
+ type: 'json_schema';
1210
+ };
1211
+ export type ResponseFormatJsonSchema = {
1212
+ /**
1213
+ * A description of what the response format is for, used by the model to determine how to respond in the format.
1214
+ */
1215
+ description?: string | null;
1216
+ /**
1217
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
1218
+ */
1219
+ name: string;
1220
+ /**
1221
+ * The schema for the response format, described as a JSON Schema object.
1222
+ */
1223
+ schema?: unknown;
1224
+ /**
1225
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
1226
+ */
1227
+ strict?: boolean | null;
1228
+ };
1229
+ export type Role = 'system' | 'user' | 'assistant' | 'tool' | 'function';
1230
+ export type ServiceTier = 'auto' | 'default' | 'flex' | 'scale' | 'priority';
1231
+ export type ServiceTierResponse = 'scale' | 'default' | 'flex' | 'priority';
471
1232
  export type SettingInfo = {
1233
+ key: string;
472
1234
  current_value: unknown;
473
1235
  default_value: unknown;
474
- key: string;
475
- metadata: SettingMetadata;
476
1236
  source: SettingSource;
1237
+ metadata: SettingMetadata;
477
1238
  };
478
1239
  export type SettingMetadata = {
479
1240
  type: 'string';
480
1241
  } | {
481
- max: number;
482
1242
  min: number;
1243
+ max: number;
483
1244
  type: 'number';
484
1245
  } | {
485
1246
  type: 'boolean';
@@ -492,14 +1253,14 @@ export type SettingSource = 'system' | 'command_line' | 'environment' | 'setting
492
1253
  * Request to setup the application in authenticated mode
493
1254
  */
494
1255
  export type SetupRequest = {
495
- /**
496
- * Optional description of the server's purpose
497
- */
498
- description?: string | null;
499
1256
  /**
500
1257
  * Server name for identification (minimum 10 characters)
501
1258
  */
502
1259
  name: string;
1260
+ /**
1261
+ * Optional description of the server's purpose
1262
+ */
1263
+ description?: string | null;
503
1264
  };
504
1265
  /**
505
1266
  * Response containing the updated application status after setup
@@ -522,6 +1283,7 @@ export type ShowResponse = {
522
1283
  parameters: string;
523
1284
  template: string;
524
1285
  };
1286
+ export type Stop = string | Array<string>;
525
1287
  /**
526
1288
  * Request to test API connectivity with a prompt
527
1289
  */
@@ -530,14 +1292,14 @@ export type TestPromptRequest = {
530
1292
  * API key for authentication (provide either api_key OR id, api_key takes preference if both provided)
531
1293
  */
532
1294
  api_key?: string;
533
- /**
534
- * API base URL (optional when using id)
535
- */
536
- base_url: string;
537
1295
  /**
538
1296
  * API model ID to look up stored credentials (provide either api_key OR id, api_key takes preference if both provided)
539
1297
  */
540
1298
  id?: string;
1299
+ /**
1300
+ * API base URL (optional when using id)
1301
+ */
1302
+ base_url: string;
541
1303
  /**
542
1304
  * Model to use for testing
543
1305
  */
@@ -551,18 +1313,38 @@ export type TestPromptRequest = {
551
1313
  * Response from testing API connectivity
552
1314
  */
553
1315
  export type TestPromptResponse = {
554
- error?: string | null;
555
- response?: string | null;
556
1316
  success: boolean;
1317
+ response?: string | null;
1318
+ error?: string | null;
1319
+ };
1320
+ /**
1321
+ * API Token information response
1322
+ */
1323
+ export type TokenInfo = {
1324
+ role: TokenScope;
557
1325
  };
558
1326
  export type TokenScope = 'scope_token_user' | 'scope_token_power_user' | 'scope_token_manager' | 'scope_token_admin';
559
1327
  export type TokenStatus = 'active' | 'inactive';
1328
+ export type TopLogprobs = {
1329
+ /**
1330
+ * The token.
1331
+ */
1332
+ token: string;
1333
+ /**
1334
+ * The log probability of this token.
1335
+ */
1336
+ logprob: number;
1337
+ /**
1338
+ * A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
1339
+ */
1340
+ bytes?: Array<number> | null;
1341
+ };
560
1342
  export type UpdateAliasRequest = {
561
- context_params?: Array<string> | null;
562
- filename: string;
563
1343
  repo: string;
564
- request_params?: null | OaiRequestParams;
1344
+ filename: string;
565
1345
  snapshot?: string | null;
1346
+ request_params?: null | OaiRequestParams;
1347
+ context_params?: Array<string> | null;
566
1348
  };
567
1349
  /**
568
1350
  * Request to update an existing API model configuration
@@ -572,14 +1354,14 @@ export type UpdateApiModelRequest = {
572
1354
  * API format/protocol (required)
573
1355
  */
574
1356
  api_format: ApiFormat;
575
- /**
576
- * API key for authentication (optional, only update if provided for security)
577
- */
578
- api_key?: string | null;
579
1357
  /**
580
1358
  * API base URL (required)
581
1359
  */
582
1360
  base_url: string;
1361
+ /**
1362
+ * API key for authentication (optional, only update if provided for security)
1363
+ */
1364
+ api_key?: string | null;
583
1365
  /**
584
1366
  * List of available models (required)
585
1367
  */
@@ -612,31 +1394,31 @@ export type UpdateSettingRequest = {
612
1394
  value: unknown;
613
1395
  };
614
1396
  export type UserAccessRequest = {
615
- /**
616
- * Creation timestamp
617
- */
618
- created_at: string;
619
1397
  /**
620
1398
  * Unique identifier for the request
621
1399
  */
622
1400
  id: number;
1401
+ /**
1402
+ * Username of the requesting user
1403
+ */
1404
+ username: string;
1405
+ /**
1406
+ * User ID (UUID) of the requesting user
1407
+ */
1408
+ user_id: string;
623
1409
  reviewer?: string | null;
624
1410
  /**
625
1411
  * Current status of the request
626
1412
  */
627
1413
  status: UserAccessRequestStatus;
628
1414
  /**
629
- * Last update timestamp
630
- */
631
- updated_at: string;
632
- /**
633
- * User ID (UUID) of the requesting user
1415
+ * Creation timestamp
634
1416
  */
635
- user_id: string;
1417
+ created_at: string;
636
1418
  /**
637
- * Username of the requesting user
1419
+ * Last update timestamp
638
1420
  */
639
- username: string;
1421
+ updated_at: string;
640
1422
  };
641
1423
  export type UserAccessRequestStatus = 'pending' | 'approved' | 'rejected';
642
1424
  /**
@@ -644,56 +1426,56 @@ export type UserAccessRequestStatus = 'pending' | 'approved' | 'rejected';
644
1426
  */
645
1427
  export type UserAccessStatusResponse = {
646
1428
  /**
647
- * Creation timestamp
1429
+ * Username of the requesting user
648
1430
  */
649
- created_at: string;
1431
+ username: string;
650
1432
  /**
651
1433
  * Current status of the request (pending, approved, rejected)
652
1434
  */
653
1435
  status: UserAccessRequestStatus;
654
1436
  /**
655
- * Last update timestamp
1437
+ * Creation timestamp
656
1438
  */
657
- updated_at: string;
1439
+ created_at: string;
658
1440
  /**
659
- * Username of the requesting user
1441
+ * Last update timestamp
660
1442
  */
661
- username: string;
1443
+ updated_at: string;
662
1444
  };
663
1445
  export type UserAlias = {
664
1446
  alias: string;
665
- context_params?: Array<string>;
666
- filename: string;
667
1447
  repo: string;
668
- request_params?: OaiRequestParams;
1448
+ filename: string;
669
1449
  snapshot: string;
1450
+ request_params?: OaiRequestParams;
1451
+ context_params?: Array<string>;
670
1452
  };
671
1453
  export type UserAliasResponse = {
672
1454
  alias: string;
673
- context_params: Array<string>;
674
- filename: string;
675
- model_params: {};
676
1455
  repo: string;
677
- request_params: OaiRequestParams;
1456
+ filename: string;
678
1457
  snapshot: string;
679
1458
  source: string;
1459
+ model_params: {};
1460
+ request_params: OaiRequestParams;
1461
+ context_params: Array<string>;
680
1462
  };
681
1463
  export type UserInfo = {
1464
+ user_id: string;
1465
+ username: string;
682
1466
  first_name?: string | null;
683
1467
  last_name?: string | null;
684
1468
  role?: null | AppRole;
685
- user_id: string;
686
- username: string;
687
1469
  };
688
1470
  export type UserListResponse = {
689
1471
  client_id: string;
690
- has_next: boolean;
691
- has_previous: boolean;
1472
+ users: Array<UserInfo>;
692
1473
  page: number;
693
1474
  page_size: number;
694
1475
  total_pages: number;
695
1476
  total_users: number;
696
- users: Array<UserInfo>;
1477
+ has_next: boolean;
1478
+ has_previous: boolean;
697
1479
  };
698
1480
  /**
699
1481
  * User authentication response with discriminated union
@@ -702,8 +1484,47 @@ export type UserResponse = {
702
1484
  auth_status: 'logged_out';
703
1485
  } | (UserInfo & {
704
1486
  auth_status: 'logged_in';
1487
+ }) | (TokenInfo & {
1488
+ auth_status: 'api_token';
705
1489
  });
706
1490
  export type UserScope = 'scope_user_user' | 'scope_user_power_user' | 'scope_user_manager' | 'scope_user_admin';
1491
+ /**
1492
+ * The amount of context window space to use for the search.
1493
+ */
1494
+ export type WebSearchContextSize = 'low' | 'medium' | 'high';
1495
+ /**
1496
+ * Approximate location parameters for the search.
1497
+ */
1498
+ export type WebSearchLocation = {
1499
+ /**
1500
+ * The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
1501
+ */
1502
+ country?: string | null;
1503
+ /**
1504
+ * Free text input for the region of the user, e.g. `California`.
1505
+ */
1506
+ region?: string | null;
1507
+ /**
1508
+ * Free text input for the city of the user, e.g. `San Francisco`.
1509
+ */
1510
+ city?: string | null;
1511
+ /**
1512
+ * The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
1513
+ */
1514
+ timezone?: string | null;
1515
+ };
1516
+ /**
1517
+ * Options for the web search tool.
1518
+ */
1519
+ export type WebSearchOptions = {
1520
+ search_context_size?: null | WebSearchContextSize;
1521
+ user_location?: null | WebSearchUserLocation;
1522
+ };
1523
+ export type WebSearchUserLocation = {
1524
+ type: WebSearchUserLocationType;
1525
+ approximate: WebSearchLocation;
1526
+ };
1527
+ export type WebSearchUserLocationType = 'approximate';
707
1528
  export type ChatOllamaModelData = {
708
1529
  /**
709
1530
  * Chat request in Ollama format
@@ -715,9 +1536,17 @@ export type ChatOllamaModelData = {
715
1536
  };
716
1537
  export type ChatOllamaModelErrors = {
717
1538
  /**
718
- * Invalid request
1539
+ * Invalid request parameters
1540
+ */
1541
+ 400: OpenAiApiError;
1542
+ /**
1543
+ * Not authenticated
1544
+ */
1545
+ 401: OpenAiApiError;
1546
+ /**
1547
+ * Insufficient permissions
719
1548
  */
720
- 400: OllamaError;
1549
+ 403: OpenAiApiError;
721
1550
  /**
722
1551
  * Model not found
723
1552
  */
@@ -725,7 +1554,7 @@ export type ChatOllamaModelErrors = {
725
1554
  /**
726
1555
  * Internal server error
727
1556
  */
728
- 500: OllamaError;
1557
+ 500: OpenAiApiError;
729
1558
  };
730
1559
  export type ChatOllamaModelError = ChatOllamaModelErrors[keyof ChatOllamaModelErrors];
731
1560
  export type ChatOllamaModelResponses = {
@@ -744,6 +1573,18 @@ export type ShowOllamaModelData = {
744
1573
  url: '/api/show';
745
1574
  };
746
1575
  export type ShowOllamaModelErrors = {
1576
+ /**
1577
+ * Invalid request parameters
1578
+ */
1579
+ 400: OpenAiApiError;
1580
+ /**
1581
+ * Not authenticated
1582
+ */
1583
+ 401: OpenAiApiError;
1584
+ /**
1585
+ * Insufficient permissions
1586
+ */
1587
+ 403: OpenAiApiError;
747
1588
  /**
748
1589
  * Model not found
749
1590
  */
@@ -751,7 +1592,7 @@ export type ShowOllamaModelErrors = {
751
1592
  /**
752
1593
  * Internal server error
753
1594
  */
754
- 500: OllamaError;
1595
+ 500: OpenAiApiError;
755
1596
  };
756
1597
  export type ShowOllamaModelError = ShowOllamaModelErrors[keyof ShowOllamaModelErrors];
757
1598
  export type ShowOllamaModelResponses = {
@@ -768,10 +1609,22 @@ export type ListOllamaModelsData = {
768
1609
  url: '/api/tags';
769
1610
  };
770
1611
  export type ListOllamaModelsErrors = {
1612
+ /**
1613
+ * Invalid request parameters
1614
+ */
1615
+ 400: OpenAiApiError;
1616
+ /**
1617
+ * Not authenticated
1618
+ */
1619
+ 401: OpenAiApiError;
1620
+ /**
1621
+ * Insufficient permissions
1622
+ */
1623
+ 403: OpenAiApiError;
771
1624
  /**
772
1625
  * Internal server error
773
1626
  */
774
- 500: OllamaError;
1627
+ 500: OpenAiApiError;
775
1628
  };
776
1629
  export type ListOllamaModelsError = ListOllamaModelsErrors[keyof ListOllamaModelsErrors];
777
1630
  export type ListOllamaModelsResponses = {
@@ -805,6 +1658,10 @@ export type ListAllAccessRequestsData = {
805
1658
  url: '/bodhi/v1/access-requests';
806
1659
  };
807
1660
  export type ListAllAccessRequestsErrors = {
1661
+ /**
1662
+ * Invalid request parameters
1663
+ */
1664
+ 400: OpenAiApiError;
808
1665
  /**
809
1666
  * Not authenticated
810
1667
  */
@@ -813,6 +1670,10 @@ export type ListAllAccessRequestsErrors = {
813
1670
  * Insufficient permissions
814
1671
  */
815
1672
  403: OpenAiApiError;
1673
+ /**
1674
+ * Internal server error
1675
+ */
1676
+ 500: OpenAiApiError;
816
1677
  };
817
1678
  export type ListAllAccessRequestsError = ListAllAccessRequestsErrors[keyof ListAllAccessRequestsErrors];
818
1679
  export type ListAllAccessRequestsResponses = {
@@ -846,6 +1707,10 @@ export type ListPendingAccessRequestsData = {
846
1707
  url: '/bodhi/v1/access-requests/pending';
847
1708
  };
848
1709
  export type ListPendingAccessRequestsErrors = {
1710
+ /**
1711
+ * Invalid request parameters
1712
+ */
1713
+ 400: OpenAiApiError;
849
1714
  /**
850
1715
  * Not authenticated
851
1716
  */
@@ -854,6 +1719,10 @@ export type ListPendingAccessRequestsErrors = {
854
1719
  * Insufficient permissions
855
1720
  */
856
1721
  403: OpenAiApiError;
1722
+ /**
1723
+ * Internal server error
1724
+ */
1725
+ 500: OpenAiApiError;
857
1726
  };
858
1727
  export type ListPendingAccessRequestsError = ListPendingAccessRequestsErrors[keyof ListPendingAccessRequestsErrors];
859
1728
  export type ListPendingAccessRequestsResponses = {
@@ -878,6 +1747,10 @@ export type ApproveAccessRequestData = {
878
1747
  url: '/bodhi/v1/access-requests/{id}/approve';
879
1748
  };
880
1749
  export type ApproveAccessRequestErrors = {
1750
+ /**
1751
+ * Invalid request parameters
1752
+ */
1753
+ 400: OpenAiApiError;
881
1754
  /**
882
1755
  * Not authenticated
883
1756
  */
@@ -890,6 +1763,10 @@ export type ApproveAccessRequestErrors = {
890
1763
  * Request not found
891
1764
  */
892
1765
  404: OpenAiApiError;
1766
+ /**
1767
+ * Internal server error
1768
+ */
1769
+ 500: OpenAiApiError;
893
1770
  };
894
1771
  export type ApproveAccessRequestError = ApproveAccessRequestErrors[keyof ApproveAccessRequestErrors];
895
1772
  export type ApproveAccessRequestResponses = {
@@ -910,6 +1787,10 @@ export type RejectAccessRequestData = {
910
1787
  url: '/bodhi/v1/access-requests/{id}/reject';
911
1788
  };
912
1789
  export type RejectAccessRequestErrors = {
1790
+ /**
1791
+ * Invalid request parameters
1792
+ */
1793
+ 400: OpenAiApiError;
913
1794
  /**
914
1795
  * Not authenticated
915
1796
  */
@@ -922,6 +1803,10 @@ export type RejectAccessRequestErrors = {
922
1803
  * Request not found
923
1804
  */
924
1805
  404: OpenAiApiError;
1806
+ /**
1807
+ * Internal server error
1808
+ */
1809
+ 500: OpenAiApiError;
925
1810
  };
926
1811
  export type RejectAccessRequestError = RejectAccessRequestErrors[keyof RejectAccessRequestErrors];
927
1812
  export type RejectAccessRequestResponses = {
@@ -955,7 +1840,19 @@ export type ListApiModelsData = {
955
1840
  };
956
1841
  export type ListApiModelsErrors = {
957
1842
  /**
958
- * Internal server error during API model retrieval
1843
+ * Invalid request parameters
1844
+ */
1845
+ 400: OpenAiApiError;
1846
+ /**
1847
+ * Not authenticated
1848
+ */
1849
+ 401: OpenAiApiError;
1850
+ /**
1851
+ * Insufficient permissions
1852
+ */
1853
+ 403: OpenAiApiError;
1854
+ /**
1855
+ * Internal server error
959
1856
  */
960
1857
  500: OpenAiApiError;
961
1858
  };
@@ -975,9 +1872,17 @@ export type CreateApiModelData = {
975
1872
  };
976
1873
  export type CreateApiModelErrors = {
977
1874
  /**
978
- * Invalid request
1875
+ * Invalid request parameters
979
1876
  */
980
1877
  400: OpenAiApiError;
1878
+ /**
1879
+ * Not authenticated
1880
+ */
1881
+ 401: OpenAiApiError;
1882
+ /**
1883
+ * Insufficient permissions
1884
+ */
1885
+ 403: OpenAiApiError;
981
1886
  /**
982
1887
  * Alias already exists
983
1888
  */
@@ -1003,7 +1908,19 @@ export type GetApiFormatsData = {
1003
1908
  };
1004
1909
  export type GetApiFormatsErrors = {
1005
1910
  /**
1006
- * Internal server error during API format retrieval
1911
+ * Invalid request parameters
1912
+ */
1913
+ 400: OpenAiApiError;
1914
+ /**
1915
+ * Not authenticated
1916
+ */
1917
+ 401: OpenAiApiError;
1918
+ /**
1919
+ * Insufficient permissions
1920
+ */
1921
+ 403: OpenAiApiError;
1922
+ /**
1923
+ * Internal server error
1007
1924
  */
1008
1925
  500: OpenAiApiError;
1009
1926
  };
@@ -1023,9 +1940,17 @@ export type FetchApiModelsData = {
1023
1940
  };
1024
1941
  export type FetchApiModelsErrors = {
1025
1942
  /**
1026
- * Invalid request
1943
+ * Invalid request parameters
1027
1944
  */
1028
1945
  400: OpenAiApiError;
1946
+ /**
1947
+ * Not authenticated
1948
+ */
1949
+ 401: OpenAiApiError;
1950
+ /**
1951
+ * Insufficient permissions
1952
+ */
1953
+ 403: OpenAiApiError;
1029
1954
  /**
1030
1955
  * Internal server error
1031
1956
  */
@@ -1047,9 +1972,17 @@ export type TestApiModelData = {
1047
1972
  };
1048
1973
  export type TestApiModelErrors = {
1049
1974
  /**
1050
- * Invalid request
1975
+ * Invalid request parameters
1051
1976
  */
1052
1977
  400: OpenAiApiError;
1978
+ /**
1979
+ * Not authenticated
1980
+ */
1981
+ 401: OpenAiApiError;
1982
+ /**
1983
+ * Insufficient permissions
1984
+ */
1985
+ 403: OpenAiApiError;
1053
1986
  /**
1054
1987
  * Internal server error
1055
1988
  */
@@ -1067,14 +2000,26 @@ export type DeleteApiModelData = {
1067
2000
  body?: never;
1068
2001
  path: {
1069
2002
  /**
1070
- * API model alias
2003
+ * API model ID
1071
2004
  */
1072
- alias: string;
2005
+ id: string;
1073
2006
  };
1074
2007
  query?: never;
1075
- url: '/bodhi/v1/api-models/{alias}';
2008
+ url: '/bodhi/v1/api-models/{id}';
1076
2009
  };
1077
2010
  export type DeleteApiModelErrors = {
2011
+ /**
2012
+ * Invalid request parameters
2013
+ */
2014
+ 400: OpenAiApiError;
2015
+ /**
2016
+ * Not authenticated
2017
+ */
2018
+ 401: OpenAiApiError;
2019
+ /**
2020
+ * Insufficient permissions
2021
+ */
2022
+ 403: OpenAiApiError;
1078
2023
  /**
1079
2024
  * API model not found
1080
2025
  */
@@ -1092,24 +2037,32 @@ export type DeleteApiModelResponses = {
1092
2037
  204: void;
1093
2038
  };
1094
2039
  export type DeleteApiModelResponse = DeleteApiModelResponses[keyof DeleteApiModelResponses];
1095
- export type UpdateApiModelData = {
1096
- body: UpdateApiModelRequest;
2040
+ export type GetApiModelData = {
2041
+ body?: never;
1097
2042
  path: {
1098
2043
  /**
1099
- * API model alias
2044
+ * Unique identifier for the API model alias
1100
2045
  */
1101
- alias: string;
2046
+ id: string;
1102
2047
  };
1103
2048
  query?: never;
1104
- url: '/bodhi/v1/api-models/{alias}';
2049
+ url: '/bodhi/v1/api-models/{id}';
1105
2050
  };
1106
- export type UpdateApiModelErrors = {
2051
+ export type GetApiModelErrors = {
1107
2052
  /**
1108
- * Invalid request
2053
+ * Invalid request parameters
1109
2054
  */
1110
2055
  400: OpenAiApiError;
1111
2056
  /**
1112
- * API model not found
2057
+ * Not authenticated
2058
+ */
2059
+ 401: OpenAiApiError;
2060
+ /**
2061
+ * Insufficient permissions
2062
+ */
2063
+ 403: OpenAiApiError;
2064
+ /**
2065
+ * API model with specified ID not found
1113
2066
  */
1114
2067
  404: OpenAiApiError;
1115
2068
  /**
@@ -1117,43 +2070,55 @@ export type UpdateApiModelErrors = {
1117
2070
  */
1118
2071
  500: OpenAiApiError;
1119
2072
  };
1120
- export type UpdateApiModelError = UpdateApiModelErrors[keyof UpdateApiModelErrors];
1121
- export type UpdateApiModelResponses = {
2073
+ export type GetApiModelError = GetApiModelErrors[keyof GetApiModelErrors];
2074
+ export type GetApiModelResponses = {
1122
2075
  /**
1123
- * API model updated
2076
+ * API model configuration retrieved successfully
1124
2077
  */
1125
2078
  200: ApiModelResponse;
1126
2079
  };
1127
- export type UpdateApiModelResponse = UpdateApiModelResponses[keyof UpdateApiModelResponses];
1128
- export type GetApiModelData = {
1129
- body?: never;
2080
+ export type GetApiModelResponse = GetApiModelResponses[keyof GetApiModelResponses];
2081
+ export type UpdateApiModelData = {
2082
+ body: UpdateApiModelRequest;
1130
2083
  path: {
1131
2084
  /**
1132
- * Unique identifier for the API model alias
2085
+ * API model ID
1133
2086
  */
1134
2087
  id: string;
1135
2088
  };
1136
2089
  query?: never;
1137
2090
  url: '/bodhi/v1/api-models/{id}';
1138
2091
  };
1139
- export type GetApiModelErrors = {
2092
+ export type UpdateApiModelErrors = {
1140
2093
  /**
1141
- * API model with specified ID not found
2094
+ * Invalid request parameters
2095
+ */
2096
+ 400: OpenAiApiError;
2097
+ /**
2098
+ * Not authenticated
2099
+ */
2100
+ 401: OpenAiApiError;
2101
+ /**
2102
+ * Insufficient permissions
2103
+ */
2104
+ 403: OpenAiApiError;
2105
+ /**
2106
+ * API model not found
1142
2107
  */
1143
2108
  404: OpenAiApiError;
1144
2109
  /**
1145
- * Internal server error during model retrieval
2110
+ * Internal server error
1146
2111
  */
1147
2112
  500: OpenAiApiError;
1148
2113
  };
1149
- export type GetApiModelError = GetApiModelErrors[keyof GetApiModelErrors];
1150
- export type GetApiModelResponses = {
2114
+ export type UpdateApiModelError = UpdateApiModelErrors[keyof UpdateApiModelErrors];
2115
+ export type UpdateApiModelResponses = {
1151
2116
  /**
1152
- * API model configuration retrieved successfully
2117
+ * API model updated
1153
2118
  */
1154
2119
  200: ApiModelResponse;
1155
2120
  };
1156
- export type GetApiModelResponse = GetApiModelResponses[keyof GetApiModelResponses];
2121
+ export type UpdateApiModelResponse = UpdateApiModelResponses[keyof UpdateApiModelResponses];
1157
2122
  export type RequestAccessData = {
1158
2123
  /**
1159
2124
  * Application client requesting access
@@ -1165,11 +2130,19 @@ export type RequestAccessData = {
1165
2130
  };
1166
2131
  export type RequestAccessErrors = {
1167
2132
  /**
1168
- * Invalid request, application not registered, or incorrect app status
2133
+ * Invalid request parameters
1169
2134
  */
1170
2135
  400: OpenAiApiError;
1171
2136
  /**
1172
- * Internal server error during access request
2137
+ * Not authenticated
2138
+ */
2139
+ 401: OpenAiApiError;
2140
+ /**
2141
+ * Insufficient permissions
2142
+ */
2143
+ 403: OpenAiApiError;
2144
+ /**
2145
+ * Internal server error
1173
2146
  */
1174
2147
  500: OpenAiApiError;
1175
2148
  };
@@ -1191,12 +2164,24 @@ export type CompleteOAuthFlowData = {
1191
2164
  url: '/bodhi/v1/auth/callback';
1192
2165
  };
1193
2166
  export type CompleteOAuthFlowErrors = {
2167
+ /**
2168
+ * Invalid request parameters
2169
+ */
2170
+ 400: OpenAiApiError;
2171
+ /**
2172
+ * Not authenticated
2173
+ */
2174
+ 401: OpenAiApiError;
2175
+ /**
2176
+ * Insufficient permissions
2177
+ */
2178
+ 403: OpenAiApiError;
1194
2179
  /**
1195
2180
  * OAuth error, invalid request parameters, or state mismatch
1196
2181
  */
1197
2182
  422: OpenAiApiError;
1198
2183
  /**
1199
- * Internal server error during token exchange
2184
+ * Internal server error
1200
2185
  */
1201
2186
  500: OpenAiApiError;
1202
2187
  };
@@ -1216,7 +2201,19 @@ export type InitiateOAuthFlowData = {
1216
2201
  };
1217
2202
  export type InitiateOAuthFlowErrors = {
1218
2203
  /**
1219
- * Internal server error during OAuth initialization
2204
+ * Invalid request parameters
2205
+ */
2206
+ 400: OpenAiApiError;
2207
+ /**
2208
+ * Not authenticated
2209
+ */
2210
+ 401: OpenAiApiError;
2211
+ /**
2212
+ * Insufficient permissions
2213
+ */
2214
+ 403: OpenAiApiError;
2215
+ /**
2216
+ * Internal server error
1220
2217
  */
1221
2218
  500: OpenAiApiError;
1222
2219
  };
@@ -1239,6 +2236,10 @@ export type GetAppInfoData = {
1239
2236
  url: '/bodhi/v1/info';
1240
2237
  };
1241
2238
  export type GetAppInfoErrors = {
2239
+ /**
2240
+ * Invalid request parameters
2241
+ */
2242
+ 400: OpenAiApiError;
1242
2243
  /**
1243
2244
  * Internal server error
1244
2245
  */
@@ -1260,7 +2261,19 @@ export type LogoutUserData = {
1260
2261
  };
1261
2262
  export type LogoutUserErrors = {
1262
2263
  /**
1263
- * Session deletion failed
2264
+ * Invalid request parameters
2265
+ */
2266
+ 400: OpenAiApiError;
2267
+ /**
2268
+ * Not authenticated
2269
+ */
2270
+ 401: OpenAiApiError;
2271
+ /**
2272
+ * Insufficient permissions
2273
+ */
2274
+ 403: OpenAiApiError;
2275
+ /**
2276
+ * Internal server error
1264
2277
  */
1265
2278
  500: OpenAiApiError;
1266
2279
  };
@@ -1296,6 +2309,18 @@ export type ListModelFilesData = {
1296
2309
  url: '/bodhi/v1/modelfiles';
1297
2310
  };
1298
2311
  export type ListModelFilesErrors = {
2312
+ /**
2313
+ * Invalid request parameters
2314
+ */
2315
+ 400: OpenAiApiError;
2316
+ /**
2317
+ * Not authenticated
2318
+ */
2319
+ 401: OpenAiApiError;
2320
+ /**
2321
+ * Insufficient permissions
2322
+ */
2323
+ 403: OpenAiApiError;
1299
2324
  /**
1300
2325
  * Internal server error
1301
2326
  */
@@ -1334,7 +2359,19 @@ export type ListDownloadsData = {
1334
2359
  };
1335
2360
  export type ListDownloadsErrors = {
1336
2361
  /**
1337
- * Internal server error during download list retrieval
2362
+ * Invalid request parameters
2363
+ */
2364
+ 400: OpenAiApiError;
2365
+ /**
2366
+ * Not authenticated
2367
+ */
2368
+ 401: OpenAiApiError;
2369
+ /**
2370
+ * Insufficient permissions
2371
+ */
2372
+ 403: OpenAiApiError;
2373
+ /**
2374
+ * Internal server error
1338
2375
  */
1339
2376
  500: OpenAiApiError;
1340
2377
  };
@@ -1357,9 +2394,17 @@ export type PullModelFileData = {
1357
2394
  };
1358
2395
  export type PullModelFileErrors = {
1359
2396
  /**
1360
- * File already exists or invalid input
2397
+ * Invalid request parameters
1361
2398
  */
1362
2399
  400: OpenAiApiError;
2400
+ /**
2401
+ * Not authenticated
2402
+ */
2403
+ 401: OpenAiApiError;
2404
+ /**
2405
+ * Insufficient permissions
2406
+ */
2407
+ 403: OpenAiApiError;
1363
2408
  /**
1364
2409
  * Internal server error
1365
2410
  */
@@ -1390,9 +2435,17 @@ export type PullModelByAliasData = {
1390
2435
  };
1391
2436
  export type PullModelByAliasErrors = {
1392
2437
  /**
1393
- * File already exists
2438
+ * Invalid request parameters
1394
2439
  */
1395
2440
  400: OpenAiApiError;
2441
+ /**
2442
+ * Not authenticated
2443
+ */
2444
+ 401: OpenAiApiError;
2445
+ /**
2446
+ * Insufficient permissions
2447
+ */
2448
+ 403: OpenAiApiError;
1396
2449
  /**
1397
2450
  * Alias not found
1398
2451
  */
@@ -1426,6 +2479,18 @@ export type GetDownloadStatusData = {
1426
2479
  url: '/bodhi/v1/modelfiles/pull/{id}';
1427
2480
  };
1428
2481
  export type GetDownloadStatusErrors = {
2482
+ /**
2483
+ * Invalid request parameters
2484
+ */
2485
+ 400: OpenAiApiError;
2486
+ /**
2487
+ * Not authenticated
2488
+ */
2489
+ 401: OpenAiApiError;
2490
+ /**
2491
+ * Insufficient permissions
2492
+ */
2493
+ 403: OpenAiApiError;
1429
2494
  /**
1430
2495
  * Download request not found
1431
2496
  */
@@ -1467,6 +2532,18 @@ export type ListAllModelsData = {
1467
2532
  url: '/bodhi/v1/models';
1468
2533
  };
1469
2534
  export type ListAllModelsErrors = {
2535
+ /**
2536
+ * Invalid request parameters
2537
+ */
2538
+ 400: OpenAiApiError;
2539
+ /**
2540
+ * Not authenticated
2541
+ */
2542
+ 401: OpenAiApiError;
2543
+ /**
2544
+ * Insufficient permissions
2545
+ */
2546
+ 403: OpenAiApiError;
1470
2547
  /**
1471
2548
  * Internal server error
1472
2549
  */
@@ -1488,9 +2565,17 @@ export type CreateAliasData = {
1488
2565
  };
1489
2566
  export type CreateAliasErrors = {
1490
2567
  /**
1491
- * Invalid request
2568
+ * Invalid request parameters
1492
2569
  */
1493
2570
  400: OpenAiApiError;
2571
+ /**
2572
+ * Not authenticated
2573
+ */
2574
+ 401: OpenAiApiError;
2575
+ /**
2576
+ * Insufficient permissions
2577
+ */
2578
+ 403: OpenAiApiError;
1494
2579
  /**
1495
2580
  * Internal server error
1496
2581
  */
@@ -1516,6 +2601,18 @@ export type GetAliasData = {
1516
2601
  url: '/bodhi/v1/models/{alias}';
1517
2602
  };
1518
2603
  export type GetAliasErrors = {
2604
+ /**
2605
+ * Invalid request parameters
2606
+ */
2607
+ 400: OpenAiApiError;
2608
+ /**
2609
+ * Not authenticated
2610
+ */
2611
+ 401: OpenAiApiError;
2612
+ /**
2613
+ * Insufficient permissions
2614
+ */
2615
+ 403: OpenAiApiError;
1519
2616
  /**
1520
2617
  * Alias not found
1521
2618
  */
@@ -1546,9 +2643,17 @@ export type UpdateAliasData = {
1546
2643
  };
1547
2644
  export type UpdateAliasErrors = {
1548
2645
  /**
1549
- * Invalid request
2646
+ * Invalid request parameters
1550
2647
  */
1551
2648
  400: OpenAiApiError;
2649
+ /**
2650
+ * Not authenticated
2651
+ */
2652
+ 401: OpenAiApiError;
2653
+ /**
2654
+ * Insufficient permissions
2655
+ */
2656
+ 403: OpenAiApiError;
1552
2657
  /**
1553
2658
  * Internal server error
1554
2659
  */
@@ -1557,9 +2662,9 @@ export type UpdateAliasErrors = {
1557
2662
  export type UpdateAliasError = UpdateAliasErrors[keyof UpdateAliasErrors];
1558
2663
  export type UpdateAliasResponses = {
1559
2664
  /**
1560
- * Alias created succesfully
2665
+ * Alias updated succesfully
1561
2666
  */
1562
- 201: UserAliasResponse;
2667
+ 200: UserAliasResponse;
1563
2668
  };
1564
2669
  export type UpdateAliasResponse = UpdateAliasResponses[keyof UpdateAliasResponses];
1565
2670
  export type ListSettingsData = {
@@ -1570,9 +2675,17 @@ export type ListSettingsData = {
1570
2675
  };
1571
2676
  export type ListSettingsErrors = {
1572
2677
  /**
1573
- * Unauthorized - User is not an admin
2678
+ * Invalid request parameters
2679
+ */
2680
+ 400: OpenAiApiError;
2681
+ /**
2682
+ * Not authenticated
1574
2683
  */
1575
2684
  401: OpenAiApiError;
2685
+ /**
2686
+ * Insufficient permissions
2687
+ */
2688
+ 403: OpenAiApiError;
1576
2689
  /**
1577
2690
  * Internal server error
1578
2691
  */
@@ -1598,10 +2711,26 @@ export type DeleteSettingData = {
1598
2711
  url: '/bodhi/v1/settings/{key}';
1599
2712
  };
1600
2713
  export type DeleteSettingErrors = {
2714
+ /**
2715
+ * Invalid request parameters
2716
+ */
2717
+ 400: OpenAiApiError;
2718
+ /**
2719
+ * Not authenticated
2720
+ */
2721
+ 401: OpenAiApiError;
2722
+ /**
2723
+ * Insufficient permissions
2724
+ */
2725
+ 403: OpenAiApiError;
1601
2726
  /**
1602
2727
  * Setting not found
1603
2728
  */
1604
2729
  404: OpenAiApiError;
2730
+ /**
2731
+ * Internal server error
2732
+ */
2733
+ 500: OpenAiApiError;
1605
2734
  };
1606
2735
  export type DeleteSettingError = DeleteSettingErrors[keyof DeleteSettingErrors];
1607
2736
  export type DeleteSettingResponses = {
@@ -1632,13 +2761,25 @@ export type UpdateSettingData = {
1632
2761
  };
1633
2762
  export type UpdateSettingErrors = {
1634
2763
  /**
1635
- * Invalid setting or value
2764
+ * Invalid request parameters
1636
2765
  */
1637
2766
  400: OpenAiApiError;
2767
+ /**
2768
+ * Not authenticated
2769
+ */
2770
+ 401: OpenAiApiError;
2771
+ /**
2772
+ * Insufficient permissions
2773
+ */
2774
+ 403: OpenAiApiError;
1638
2775
  /**
1639
2776
  * Setting not found
1640
2777
  */
1641
2778
  404: OpenAiApiError;
2779
+ /**
2780
+ * Internal server error
2781
+ */
2782
+ 500: OpenAiApiError;
1642
2783
  };
1643
2784
  export type UpdateSettingError = UpdateSettingErrors[keyof UpdateSettingErrors];
1644
2785
  export type UpdateSettingResponses = {
@@ -1659,11 +2800,11 @@ export type SetupAppData = {
1659
2800
  };
1660
2801
  export type SetupAppErrors = {
1661
2802
  /**
1662
- * Invalid request or application already setup
2803
+ * Invalid request parameters
1663
2804
  */
1664
2805
  400: OpenAiApiError;
1665
2806
  /**
1666
- * Internal server error during setup
2807
+ * Internal server error
1667
2808
  */
1668
2809
  500: OpenAiApiError;
1669
2810
  };
@@ -1700,9 +2841,17 @@ export type ListApiTokensData = {
1700
2841
  };
1701
2842
  export type ListApiTokensErrors = {
1702
2843
  /**
1703
- * Unauthorized - Token missing or invalid
2844
+ * Invalid request parameters
2845
+ */
2846
+ 400: OpenAiApiError;
2847
+ /**
2848
+ * Not authenticated
1704
2849
  */
1705
2850
  401: OpenAiApiError;
2851
+ /**
2852
+ * Insufficient permissions
2853
+ */
2854
+ 403: OpenAiApiError;
1706
2855
  /**
1707
2856
  * Internal server error
1708
2857
  */
@@ -1727,11 +2876,19 @@ export type CreateApiTokenData = {
1727
2876
  };
1728
2877
  export type CreateApiTokenErrors = {
1729
2878
  /**
1730
- * Invalid request parameters or token name already exists
2879
+ * Invalid request parameters
1731
2880
  */
1732
2881
  400: OpenAiApiError;
1733
2882
  /**
1734
- * Internal server error during token creation
2883
+ * Not authenticated
2884
+ */
2885
+ 401: OpenAiApiError;
2886
+ /**
2887
+ * Insufficient permissions
2888
+ */
2889
+ 403: OpenAiApiError;
2890
+ /**
2891
+ * Internal server error
1735
2892
  */
1736
2893
  500: OpenAiApiError;
1737
2894
  };
@@ -1759,9 +2916,17 @@ export type UpdateApiTokenData = {
1759
2916
  };
1760
2917
  export type UpdateApiTokenErrors = {
1761
2918
  /**
1762
- * Unauthorized - Token missing or invalid
2919
+ * Invalid request parameters
2920
+ */
2921
+ 400: OpenAiApiError;
2922
+ /**
2923
+ * Not authenticated
1763
2924
  */
1764
2925
  401: OpenAiApiError;
2926
+ /**
2927
+ * Insufficient permissions
2928
+ */
2929
+ 403: OpenAiApiError;
1765
2930
  /**
1766
2931
  * Token not found
1767
2932
  */
@@ -1787,14 +2952,26 @@ export type GetCurrentUserData = {
1787
2952
  };
1788
2953
  export type GetCurrentUserErrors = {
1789
2954
  /**
1790
- * Authentication error or invalid token
2955
+ * Invalid request parameters
2956
+ */
2957
+ 400: OpenAiApiError;
2958
+ /**
2959
+ * Not authenticated
2960
+ */
2961
+ 401: OpenAiApiError;
2962
+ /**
2963
+ * Insufficient permissions
2964
+ */
2965
+ 403: OpenAiApiError;
2966
+ /**
2967
+ * Internal server error
1791
2968
  */
1792
2969
  500: OpenAiApiError;
1793
2970
  };
1794
2971
  export type GetCurrentUserError = GetCurrentUserErrors[keyof GetCurrentUserErrors];
1795
2972
  export type GetCurrentUserResponses = {
1796
2973
  /**
1797
- * Current user information retrieved successfully
2974
+ * User information (authenticated or not)
1798
2975
  */
1799
2976
  200: UserResponse;
1800
2977
  };
@@ -1806,10 +2983,18 @@ export type RequestUserAccessData = {
1806
2983
  url: '/bodhi/v1/user/request-access';
1807
2984
  };
1808
2985
  export type RequestUserAccessErrors = {
2986
+ /**
2987
+ * Invalid request parameters
2988
+ */
2989
+ 400: OpenAiApiError;
1809
2990
  /**
1810
2991
  * Not authenticated
1811
2992
  */
1812
2993
  401: OpenAiApiError;
2994
+ /**
2995
+ * Insufficient permissions
2996
+ */
2997
+ 403: OpenAiApiError;
1813
2998
  /**
1814
2999
  * Pending request already exists
1815
3000
  */
@@ -1818,15 +3003,18 @@ export type RequestUserAccessErrors = {
1818
3003
  * User already has role
1819
3004
  */
1820
3005
  422: OpenAiApiError;
3006
+ /**
3007
+ * Internal server error
3008
+ */
3009
+ 500: OpenAiApiError;
1821
3010
  };
1822
3011
  export type RequestUserAccessError = RequestUserAccessErrors[keyof RequestUserAccessErrors];
1823
3012
  export type RequestUserAccessResponses = {
1824
3013
  /**
1825
3014
  * Access request created successfully
1826
3015
  */
1827
- 201: EmptyResponse;
3016
+ 201: unknown;
1828
3017
  };
1829
- export type RequestUserAccessResponse = RequestUserAccessResponses[keyof RequestUserAccessResponses];
1830
3018
  export type GetUserAccessStatusData = {
1831
3019
  body?: never;
1832
3020
  path?: never;
@@ -1835,17 +3023,25 @@ export type GetUserAccessStatusData = {
1835
3023
  };
1836
3024
  export type GetUserAccessStatusErrors = {
1837
3025
  /**
1838
- * Bad Request
3026
+ * Invalid request parameters
1839
3027
  */
1840
3028
  400: OpenAiApiError;
1841
3029
  /**
1842
3030
  * Not authenticated
1843
3031
  */
1844
3032
  401: OpenAiApiError;
3033
+ /**
3034
+ * Insufficient permissions
3035
+ */
3036
+ 403: OpenAiApiError;
1845
3037
  /**
1846
3038
  * Request not found
1847
3039
  */
1848
3040
  404: OpenAiApiError;
3041
+ /**
3042
+ * Internal server error
3043
+ */
3044
+ 500: OpenAiApiError;
1849
3045
  };
1850
3046
  export type GetUserAccessStatusError = GetUserAccessStatusErrors[keyof GetUserAccessStatusErrors];
1851
3047
  export type GetUserAccessStatusResponses = {
@@ -1909,7 +3105,7 @@ export type RemoveUserData = {
1909
3105
  };
1910
3106
  export type RemoveUserErrors = {
1911
3107
  /**
1912
- * Invalid request
3108
+ * Invalid request parameters
1913
3109
  */
1914
3110
  400: OpenAiApiError;
1915
3111
  /**
@@ -1949,7 +3145,7 @@ export type ChangeUserRoleData = {
1949
3145
  };
1950
3146
  export type ChangeUserRoleErrors = {
1951
3147
  /**
1952
- * Invalid request
3148
+ * Invalid request parameters
1953
3149
  */
1954
3150
  400: OpenAiApiError;
1955
3151
  /**
@@ -1982,6 +3178,17 @@ export type HealthCheckData = {
1982
3178
  query?: never;
1983
3179
  url: '/health';
1984
3180
  };
3181
+ export type HealthCheckErrors = {
3182
+ /**
3183
+ * Invalid request parameters
3184
+ */
3185
+ 400: OpenAiApiError;
3186
+ /**
3187
+ * Internal server error
3188
+ */
3189
+ 500: OpenAiApiError;
3190
+ };
3191
+ export type HealthCheckError = HealthCheckErrors[keyof HealthCheckErrors];
1985
3192
  export type HealthCheckResponses = {
1986
3193
  /**
1987
3194
  * Application is healthy and fully operational
@@ -1995,6 +3202,17 @@ export type PingServerData = {
1995
3202
  query?: never;
1996
3203
  url: '/ping';
1997
3204
  };
3205
+ export type PingServerErrors = {
3206
+ /**
3207
+ * Invalid request parameters
3208
+ */
3209
+ 400: OpenAiApiError;
3210
+ /**
3211
+ * Internal server error
3212
+ */
3213
+ 500: OpenAiApiError;
3214
+ };
3215
+ export type PingServerError = PingServerErrors[keyof PingServerErrors];
1998
3216
  export type PingServerResponses = {
1999
3217
  /**
2000
3218
  * Server is responding normally
@@ -2003,7 +3221,7 @@ export type PingServerResponses = {
2003
3221
  };
2004
3222
  export type PingServerResponse = PingServerResponses[keyof PingServerResponses];
2005
3223
  export type CreateChatCompletionData = {
2006
- body: unknown;
3224
+ body: CreateChatCompletionRequest;
2007
3225
  path?: never;
2008
3226
  query?: never;
2009
3227
  url: '/v1/chat/completions';
@@ -2014,9 +3232,13 @@ export type CreateChatCompletionErrors = {
2014
3232
  */
2015
3233
  400: OpenAiApiError;
2016
3234
  /**
2017
- * Invalid authentication
3235
+ * Not authenticated
2018
3236
  */
2019
3237
  401: OpenAiApiError;
3238
+ /**
3239
+ * Insufficient permissions
3240
+ */
3241
+ 403: OpenAiApiError;
2020
3242
  /**
2021
3243
  * Internal server error
2022
3244
  */
@@ -2027,12 +3249,45 @@ export type CreateChatCompletionResponses = {
2027
3249
  /**
2028
3250
  * Chat completion response
2029
3251
  */
2030
- 200: unknown;
3252
+ 200: CreateChatCompletionResponse;
2031
3253
  /**
2032
3254
  * Chat completion stream, the status is 200, using 201 to avoid OpenAPI format limitation.
2033
3255
  */
2034
- 201: unknown;
3256
+ 201: CreateChatCompletionStreamResponse;
3257
+ };
3258
+ export type CreateChatCompletionResponse2 = CreateChatCompletionResponses[keyof CreateChatCompletionResponses];
3259
+ export type CreateEmbeddingData = {
3260
+ body: CreateEmbeddingRequest;
3261
+ path?: never;
3262
+ query?: never;
3263
+ url: '/v1/embeddings';
3264
+ };
3265
+ export type CreateEmbeddingErrors = {
3266
+ /**
3267
+ * Invalid request parameters
3268
+ */
3269
+ 400: OpenAiApiError;
3270
+ /**
3271
+ * Not authenticated
3272
+ */
3273
+ 401: OpenAiApiError;
3274
+ /**
3275
+ * Insufficient permissions
3276
+ */
3277
+ 403: OpenAiApiError;
3278
+ /**
3279
+ * Internal server error
3280
+ */
3281
+ 500: OpenAiApiError;
3282
+ };
3283
+ export type CreateEmbeddingError = CreateEmbeddingErrors[keyof CreateEmbeddingErrors];
3284
+ export type CreateEmbeddingResponses = {
3285
+ /**
3286
+ * Embedding response
3287
+ */
3288
+ 200: CreateEmbeddingResponse;
2035
3289
  };
3290
+ export type CreateEmbeddingResponse2 = CreateEmbeddingResponses[keyof CreateEmbeddingResponses];
2036
3291
  export type ListModelsData = {
2037
3292
  body?: never;
2038
3293
  path?: never;
@@ -2041,9 +3296,17 @@ export type ListModelsData = {
2041
3296
  };
2042
3297
  export type ListModelsErrors = {
2043
3298
  /**
2044
- * Invalid authentication
3299
+ * Invalid request parameters
3300
+ */
3301
+ 400: OpenAiApiError;
3302
+ /**
3303
+ * Not authenticated
2045
3304
  */
2046
3305
  401: OpenAiApiError;
3306
+ /**
3307
+ * Insufficient permissions
3308
+ */
3309
+ 403: OpenAiApiError;
2047
3310
  /**
2048
3311
  * Internal server error
2049
3312
  */
@@ -2070,9 +3333,17 @@ export type GetModelData = {
2070
3333
  };
2071
3334
  export type GetModelErrors = {
2072
3335
  /**
2073
- * Invalid authentication
3336
+ * Invalid request parameters
3337
+ */
3338
+ 400: OpenAiApiError;
3339
+ /**
3340
+ * Not authenticated
2074
3341
  */
2075
3342
  401: OpenAiApiError;
3343
+ /**
3344
+ * Insufficient permissions
3345
+ */
3346
+ 403: OpenAiApiError;
2076
3347
  /**
2077
3348
  * Model not found
2078
3349
  */