llama-stack-client 0.4.4 → 0.4.5

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.
Files changed (291) hide show
  1. package/.github/workflows/ci.yml +4 -4
  2. package/.github/workflows/release-doctor.yml +1 -1
  3. package/.release-please-manifest.json +1 -1
  4. package/.stats.yml +4 -4
  5. package/CHANGELOG.md +41 -0
  6. package/LICENSE +1 -1
  7. package/README.md +41 -27
  8. package/api.md +32 -25
  9. package/dist/CHANGELOG.md +41 -0
  10. package/dist/LICENSE +1 -1
  11. package/dist/README.md +41 -27
  12. package/dist/core.d.ts.map +1 -1
  13. package/dist/core.js +5 -0
  14. package/dist/core.js.map +1 -1
  15. package/dist/core.mjs +5 -0
  16. package/dist/core.mjs.map +1 -1
  17. package/dist/index.d.mts +12 -6
  18. package/dist/index.d.ts +12 -6
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/package.json +1 -1
  23. package/dist/resources/alpha/admin.d.ts +41 -0
  24. package/dist/resources/alpha/admin.d.ts.map +1 -0
  25. package/dist/resources/alpha/admin.js +46 -0
  26. package/dist/resources/alpha/admin.js.map +1 -0
  27. package/dist/resources/alpha/admin.mjs +42 -0
  28. package/dist/resources/alpha/admin.mjs.map +1 -0
  29. package/dist/resources/alpha/alpha.d.ts +8 -4
  30. package/dist/resources/alpha/alpha.d.ts.map +1 -1
  31. package/dist/resources/alpha/alpha.js +6 -2
  32. package/dist/resources/alpha/alpha.js.map +1 -1
  33. package/dist/resources/alpha/alpha.mjs +6 -2
  34. package/dist/resources/alpha/alpha.mjs.map +1 -1
  35. package/dist/resources/alpha/benchmarks.d.ts +37 -1
  36. package/dist/resources/alpha/benchmarks.d.ts.map +1 -1
  37. package/dist/resources/alpha/eval/eval.d.ts +28 -7
  38. package/dist/resources/alpha/eval/eval.d.ts.map +1 -1
  39. package/dist/resources/alpha/eval/eval.js.map +1 -1
  40. package/dist/resources/alpha/eval/eval.mjs.map +1 -1
  41. package/dist/resources/alpha/index.d.ts +2 -1
  42. package/dist/resources/alpha/index.d.ts.map +1 -1
  43. package/dist/resources/alpha/index.js +3 -1
  44. package/dist/resources/alpha/index.js.map +1 -1
  45. package/dist/resources/alpha/index.mjs +1 -0
  46. package/dist/resources/alpha/index.mjs.map +1 -1
  47. package/dist/resources/alpha/inference.d.ts +58 -7
  48. package/dist/resources/alpha/inference.d.ts.map +1 -1
  49. package/dist/resources/alpha/post-training/index.d.ts +2 -2
  50. package/dist/resources/alpha/post-training/index.d.ts.map +1 -1
  51. package/dist/resources/alpha/post-training/index.js.map +1 -1
  52. package/dist/resources/alpha/post-training/index.mjs +1 -1
  53. package/dist/resources/alpha/post-training/index.mjs.map +1 -1
  54. package/dist/resources/alpha/post-training/job.d.ts +4 -16
  55. package/dist/resources/alpha/post-training/job.d.ts.map +1 -1
  56. package/dist/resources/alpha/post-training/job.js +5 -6
  57. package/dist/resources/alpha/post-training/job.js.map +1 -1
  58. package/dist/resources/alpha/post-training/job.mjs +5 -6
  59. package/dist/resources/alpha/post-training/job.mjs.map +1 -1
  60. package/dist/resources/alpha/post-training/post-training.d.ts +38 -11
  61. package/dist/resources/alpha/post-training/post-training.d.ts.map +1 -1
  62. package/dist/resources/alpha/post-training/post-training.js.map +1 -1
  63. package/dist/resources/alpha/post-training/post-training.mjs +1 -1
  64. package/dist/resources/alpha/post-training/post-training.mjs.map +1 -1
  65. package/dist/resources/beta/datasets.d.ts +102 -8
  66. package/dist/resources/beta/datasets.d.ts.map +1 -1
  67. package/dist/resources/chat/chat.d.ts +119 -17
  68. package/dist/resources/chat/chat.d.ts.map +1 -1
  69. package/dist/resources/chat/chat.js.map +1 -1
  70. package/dist/resources/chat/chat.mjs.map +1 -1
  71. package/dist/resources/chat/completions.d.ts +1130 -73
  72. package/dist/resources/chat/completions.d.ts.map +1 -1
  73. package/dist/resources/chat/completions.js +0 -2
  74. package/dist/resources/chat/completions.js.map +1 -1
  75. package/dist/resources/chat/completions.mjs +0 -2
  76. package/dist/resources/chat/completions.mjs.map +1 -1
  77. package/dist/resources/completions.d.ts +135 -26
  78. package/dist/resources/completions.d.ts.map +1 -1
  79. package/dist/resources/completions.js.map +1 -1
  80. package/dist/resources/completions.mjs.map +1 -1
  81. package/dist/resources/conversations/conversations.d.ts +56 -12
  82. package/dist/resources/conversations/conversations.d.ts.map +1 -1
  83. package/dist/resources/conversations/conversations.js +0 -8
  84. package/dist/resources/conversations/conversations.js.map +1 -1
  85. package/dist/resources/conversations/conversations.mjs +0 -8
  86. package/dist/resources/conversations/conversations.mjs.map +1 -1
  87. package/dist/resources/conversations/items.d.ts +364 -81
  88. package/dist/resources/conversations/items.d.ts.map +1 -1
  89. package/dist/resources/conversations/items.js +0 -6
  90. package/dist/resources/conversations/items.js.map +1 -1
  91. package/dist/resources/conversations/items.mjs +0 -6
  92. package/dist/resources/conversations/items.mjs.map +1 -1
  93. package/dist/resources/embeddings.d.ts +46 -8
  94. package/dist/resources/embeddings.d.ts.map +1 -1
  95. package/dist/resources/embeddings.js +0 -2
  96. package/dist/resources/embeddings.js.map +1 -1
  97. package/dist/resources/embeddings.mjs +0 -2
  98. package/dist/resources/embeddings.mjs.map +1 -1
  99. package/dist/resources/files.d.ts +58 -31
  100. package/dist/resources/files.d.ts.map +1 -1
  101. package/dist/resources/files.js +4 -16
  102. package/dist/resources/files.js.map +1 -1
  103. package/dist/resources/files.mjs +4 -16
  104. package/dist/resources/files.mjs.map +1 -1
  105. package/dist/resources/index.d.ts +3 -3
  106. package/dist/resources/index.d.ts.map +1 -1
  107. package/dist/resources/index.js.map +1 -1
  108. package/dist/resources/index.mjs.map +1 -1
  109. package/dist/resources/inspect.d.ts +3 -45
  110. package/dist/resources/inspect.d.ts.map +1 -1
  111. package/dist/resources/inspect.js +0 -4
  112. package/dist/resources/inspect.js.map +1 -1
  113. package/dist/resources/inspect.mjs +0 -4
  114. package/dist/resources/inspect.mjs.map +1 -1
  115. package/dist/resources/models/models.d.ts +21 -6
  116. package/dist/resources/models/models.d.ts.map +1 -1
  117. package/dist/resources/models/models.js +0 -6
  118. package/dist/resources/models/models.js.map +1 -1
  119. package/dist/resources/models/models.mjs +0 -6
  120. package/dist/resources/models/models.mjs.map +1 -1
  121. package/dist/resources/moderations.d.ts +38 -5
  122. package/dist/resources/moderations.d.ts.map +1 -1
  123. package/dist/resources/moderations.js +1 -3
  124. package/dist/resources/moderations.js.map +1 -1
  125. package/dist/resources/moderations.mjs +1 -3
  126. package/dist/resources/moderations.mjs.map +1 -1
  127. package/dist/resources/prompts/prompts.d.ts +24 -10
  128. package/dist/resources/prompts/prompts.d.ts.map +1 -1
  129. package/dist/resources/prompts/prompts.js +2 -10
  130. package/dist/resources/prompts/prompts.js.map +1 -1
  131. package/dist/resources/prompts/prompts.mjs +2 -10
  132. package/dist/resources/prompts/prompts.mjs.map +1 -1
  133. package/dist/resources/prompts/versions.d.ts +0 -2
  134. package/dist/resources/prompts/versions.d.ts.map +1 -1
  135. package/dist/resources/prompts/versions.js +0 -2
  136. package/dist/resources/prompts/versions.js.map +1 -1
  137. package/dist/resources/prompts/versions.mjs +0 -2
  138. package/dist/resources/prompts/versions.mjs.map +1 -1
  139. package/dist/resources/providers.d.ts +5 -12
  140. package/dist/resources/providers.d.ts.map +1 -1
  141. package/dist/resources/providers.js +0 -4
  142. package/dist/resources/providers.js.map +1 -1
  143. package/dist/resources/providers.mjs +0 -4
  144. package/dist/resources/providers.mjs.map +1 -1
  145. package/dist/resources/responses/input-items.d.ts +108 -9
  146. package/dist/resources/responses/input-items.d.ts.map +1 -1
  147. package/dist/resources/responses/responses.d.ts +881 -124
  148. package/dist/resources/responses/responses.d.ts.map +1 -1
  149. package/dist/resources/responses/responses.js.map +1 -1
  150. package/dist/resources/responses/responses.mjs.map +1 -1
  151. package/dist/resources/routes.d.ts +10 -9
  152. package/dist/resources/routes.d.ts.map +1 -1
  153. package/dist/resources/routes.js.map +1 -1
  154. package/dist/resources/routes.mjs.map +1 -1
  155. package/dist/resources/safety.d.ts +131 -9
  156. package/dist/resources/safety.d.ts.map +1 -1
  157. package/dist/resources/safety.js +1 -3
  158. package/dist/resources/safety.js.map +1 -1
  159. package/dist/resources/safety.mjs +1 -3
  160. package/dist/resources/safety.mjs.map +1 -1
  161. package/dist/resources/scoring-functions.d.ts +23 -1
  162. package/dist/resources/scoring-functions.d.ts.map +1 -1
  163. package/dist/resources/scoring.d.ts +24 -0
  164. package/dist/resources/scoring.d.ts.map +1 -1
  165. package/dist/resources/shared.d.ts +139 -7
  166. package/dist/resources/shared.d.ts.map +1 -1
  167. package/dist/resources/shields.d.ts +21 -0
  168. package/dist/resources/shields.d.ts.map +1 -1
  169. package/dist/resources/vector-io.d.ts +75 -58
  170. package/dist/resources/vector-io.d.ts.map +1 -1
  171. package/dist/resources/vector-io.js +1 -1
  172. package/dist/resources/vector-io.mjs +1 -1
  173. package/dist/resources/vector-stores/file-batches.d.ts +13 -7
  174. package/dist/resources/vector-stores/file-batches.d.ts.map +1 -1
  175. package/dist/resources/vector-stores/file-batches.js +3 -6
  176. package/dist/resources/vector-stores/file-batches.js.map +1 -1
  177. package/dist/resources/vector-stores/file-batches.mjs +3 -6
  178. package/dist/resources/vector-stores/file-batches.mjs.map +1 -1
  179. package/dist/resources/vector-stores/files.d.ts +31 -9
  180. package/dist/resources/vector-stores/files.d.ts.map +1 -1
  181. package/dist/resources/vector-stores/files.js +4 -4
  182. package/dist/resources/vector-stores/files.js.map +1 -1
  183. package/dist/resources/vector-stores/files.mjs +4 -4
  184. package/dist/resources/vector-stores/files.mjs.map +1 -1
  185. package/dist/resources/vector-stores/vector-stores.d.ts +87 -13
  186. package/dist/resources/vector-stores/vector-stores.d.ts.map +1 -1
  187. package/dist/resources/vector-stores/vector-stores.js +5 -10
  188. package/dist/resources/vector-stores/vector-stores.js.map +1 -1
  189. package/dist/resources/vector-stores/vector-stores.mjs +5 -10
  190. package/dist/resources/vector-stores/vector-stores.mjs.map +1 -1
  191. package/dist/src/core.ts +6 -0
  192. package/dist/src/index.ts +11 -16
  193. package/dist/src/resources/alpha/admin.ts +84 -0
  194. package/dist/src/resources/alpha/alpha.ts +16 -8
  195. package/dist/src/resources/alpha/benchmarks.ts +37 -1
  196. package/dist/src/resources/alpha/eval/eval.ts +28 -7
  197. package/dist/src/resources/alpha/index.ts +2 -0
  198. package/dist/src/resources/alpha/inference.ts +58 -7
  199. package/dist/src/resources/alpha/post-training/index.ts +2 -10
  200. package/dist/src/resources/alpha/post-training/job.ts +5 -26
  201. package/dist/src/resources/alpha/post-training/post-training.ts +38 -22
  202. package/dist/src/resources/beta/datasets.ts +103 -8
  203. package/dist/src/resources/chat/chat.ts +122 -20
  204. package/dist/src/resources/chat/completions.ts +1138 -79
  205. package/dist/src/resources/completions.ts +137 -28
  206. package/dist/src/resources/conversations/conversations.ts +67 -15
  207. package/dist/src/resources/conversations/items.ts +479 -110
  208. package/dist/src/resources/embeddings.ts +46 -8
  209. package/dist/src/resources/files.ts +58 -31
  210. package/dist/src/resources/index.ts +3 -3
  211. package/dist/src/resources/inspect.ts +3 -57
  212. package/dist/src/resources/models/models.ts +21 -6
  213. package/dist/src/resources/moderations.ts +38 -5
  214. package/dist/src/resources/prompts/prompts.ts +26 -12
  215. package/dist/src/resources/prompts/versions.ts +0 -2
  216. package/dist/src/resources/providers.ts +5 -16
  217. package/dist/src/resources/responses/input-items.ts +138 -15
  218. package/dist/src/resources/responses/responses.ts +1076 -196
  219. package/dist/src/resources/routes.ts +10 -14
  220. package/dist/src/resources/safety.ts +131 -8
  221. package/dist/src/resources/scoring-functions.ts +23 -1
  222. package/dist/src/resources/scoring.ts +24 -0
  223. package/dist/src/resources/shared.ts +148 -7
  224. package/dist/src/resources/shields.ts +21 -0
  225. package/dist/src/resources/vector-io.ts +95 -78
  226. package/dist/src/resources/vector-stores/file-batches.ts +13 -7
  227. package/dist/src/resources/vector-stores/files.ts +31 -11
  228. package/dist/src/resources/vector-stores/vector-stores.ts +89 -15
  229. package/dist/src/version.ts +1 -1
  230. package/dist/version.d.ts +1 -1
  231. package/dist/version.js +1 -1
  232. package/dist/version.mjs +1 -1
  233. package/package.json +1 -1
  234. package/src/core.ts +6 -0
  235. package/src/index.ts +11 -16
  236. package/src/resources/alpha/admin.ts +84 -0
  237. package/src/resources/alpha/alpha.ts +16 -8
  238. package/src/resources/alpha/benchmarks.ts +37 -1
  239. package/src/resources/alpha/eval/eval.ts +28 -7
  240. package/src/resources/alpha/index.ts +2 -0
  241. package/src/resources/alpha/inference.ts +58 -7
  242. package/src/resources/alpha/post-training/index.ts +2 -10
  243. package/src/resources/alpha/post-training/job.ts +5 -26
  244. package/src/resources/alpha/post-training/post-training.ts +38 -22
  245. package/src/resources/beta/datasets.ts +103 -8
  246. package/src/resources/chat/chat.ts +122 -20
  247. package/src/resources/chat/completions.ts +1138 -79
  248. package/src/resources/completions.ts +137 -28
  249. package/src/resources/conversations/conversations.ts +67 -15
  250. package/src/resources/conversations/items.ts +479 -110
  251. package/src/resources/embeddings.ts +46 -8
  252. package/src/resources/files.ts +58 -31
  253. package/src/resources/index.ts +3 -3
  254. package/src/resources/inspect.ts +3 -57
  255. package/src/resources/models/models.ts +21 -6
  256. package/src/resources/moderations.ts +38 -5
  257. package/src/resources/prompts/prompts.ts +26 -12
  258. package/src/resources/prompts/versions.ts +0 -2
  259. package/src/resources/providers.ts +5 -16
  260. package/src/resources/responses/input-items.ts +138 -15
  261. package/src/resources/responses/responses.ts +1076 -196
  262. package/src/resources/routes.ts +10 -14
  263. package/src/resources/safety.ts +131 -8
  264. package/src/resources/scoring-functions.ts +23 -1
  265. package/src/resources/scoring.ts +24 -0
  266. package/src/resources/shared.ts +148 -7
  267. package/src/resources/shields.ts +21 -0
  268. package/src/resources/vector-io.ts +95 -78
  269. package/src/resources/vector-stores/file-batches.ts +13 -7
  270. package/src/resources/vector-stores/files.ts +31 -11
  271. package/src/resources/vector-stores/vector-stores.ts +89 -15
  272. package/src/version.ts +1 -1
  273. package/tests/api-resources/alpha/admin.test.ts +111 -0
  274. package/tests/api-resources/alpha/eval/eval.test.ts +40 -20
  275. package/tests/api-resources/alpha/inference.test.ts +1 -1
  276. package/tests/api-resources/alpha/post-training/job.test.ts +21 -12
  277. package/tests/api-resources/alpha/post-training/post-training.test.ts +12 -2
  278. package/tests/api-resources/beta/datasets.test.ts +9 -3
  279. package/tests/api-resources/chat/completions.test.ts +20 -7
  280. package/tests/api-resources/completions.test.ts +5 -5
  281. package/tests/api-resources/conversations/items.test.ts +22 -3
  282. package/tests/api-resources/embeddings.test.ts +2 -2
  283. package/tests/api-resources/files.test.ts +6 -1
  284. package/tests/api-resources/responses/input-items.test.ts +7 -1
  285. package/tests/api-resources/responses/responses.test.ts +19 -5
  286. package/tests/api-resources/safety.test.ts +9 -5
  287. package/tests/api-resources/tool-runtime.test.ts +9 -2
  288. package/tests/api-resources/vector-io.test.ts +13 -4
  289. package/tests/api-resources/vector-stores/file-batches.test.ts +7 -1
  290. package/tests/api-resources/vector-stores/files.test.ts +7 -1
  291. package/tests/api-resources/vector-stores/vector-stores.test.ts +14 -2
@@ -6,8 +6,6 @@ import * as ChatAPI from "./chat.js";
6
6
  import { Stream } from "../../streaming.js";
7
7
  export declare class Completions extends APIResource {
8
8
  /**
9
- * Create chat completions.
10
- *
11
9
  * Generate an OpenAI-compatible chat completion for the given messages using the
12
10
  * specified model.
13
11
  */
@@ -15,8 +13,6 @@ export declare class Completions extends APIResource {
15
13
  create(body: CompletionCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<ChatAPI.ChatCompletionChunk>>;
16
14
  create(body: CompletionCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<ChatAPI.ChatCompletionChunk> | CompletionCreateResponse>;
17
15
  /**
18
- * Get chat completion.
19
- *
20
16
  * Describe a chat completion by its ID.
21
17
  */
22
18
  retrieve(completionId: string, options?: Core.RequestOptions): Core.APIPromise<CompletionRetrieveResponse>;
@@ -30,10 +26,25 @@ export declare class Completions extends APIResource {
30
26
  * Response from an OpenAI-compatible chat completion request.
31
27
  */
32
28
  export interface CompletionCreateResponse {
29
+ /**
30
+ * The ID of the chat completion.
31
+ */
33
32
  id: string;
33
+ /**
34
+ * List of choices.
35
+ */
34
36
  choices: Array<CompletionCreateResponse.Choice>;
37
+ /**
38
+ * The Unix timestamp in seconds when the chat completion was created.
39
+ */
35
40
  created: number;
41
+ /**
42
+ * The model that was used to generate the chat completion.
43
+ */
36
44
  model: string;
45
+ /**
46
+ * The object type.
47
+ */
37
48
  object?: 'chat.completion';
38
49
  /**
39
50
  * Usage information for OpenAI chat completion.
@@ -45,10 +56,16 @@ export declare namespace CompletionCreateResponse {
45
56
  * A choice from an OpenAI-compatible chat completion response.
46
57
  */
47
58
  interface Choice {
48
- finish_reason: string;
59
+ /**
60
+ * The reason the model stopped generating.
61
+ */
62
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
63
+ /**
64
+ * The index of the choice.
65
+ */
49
66
  index: number;
50
67
  /**
51
- * A message from the user in an OpenAI-compatible chat completion request.
68
+ * The message from the model.
52
69
  */
53
70
  message: Choice.OpenAIUserMessageParamOutput | Choice.OpenAISystemMessageParam | Choice.OpenAIAssistantMessageParamOutput | Choice.OpenAIToolMessageParam | Choice.OpenAIDeveloperMessageParam;
54
71
  /**
@@ -62,8 +79,17 @@ export declare namespace CompletionCreateResponse {
62
79
  * A message from the user in an OpenAI-compatible chat completion request.
63
80
  */
64
81
  interface OpenAIUserMessageParamOutput {
82
+ /**
83
+ * The content of the message, which can include text and other media.
84
+ */
65
85
  content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
86
+ /**
87
+ * The name of the user message participant.
88
+ */
66
89
  name?: string | null;
90
+ /**
91
+ * Must be 'user' to identify this as a user message.
92
+ */
67
93
  role?: 'user';
68
94
  }
69
95
  namespace OpenAIUserMessageParamOutput {
@@ -71,7 +97,13 @@ export declare namespace CompletionCreateResponse {
71
97
  * Text content part for OpenAI-compatible chat completion messages.
72
98
  */
73
99
  interface OpenAIChatCompletionContentPartTextParam {
100
+ /**
101
+ * The text content of the message.
102
+ */
74
103
  text: string;
104
+ /**
105
+ * Must be 'text' to identify this as text content.
106
+ */
75
107
  type?: 'text';
76
108
  }
77
109
  /**
@@ -79,28 +111,55 @@ export declare namespace CompletionCreateResponse {
79
111
  */
80
112
  interface OpenAIChatCompletionContentPartImageParam {
81
113
  /**
82
- * Image URL specification for OpenAI-compatible chat completion messages.
114
+ * Image URL specification and processing details.
83
115
  */
84
116
  image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
117
+ /**
118
+ * Must be 'image_url' to identify this as image content.
119
+ */
85
120
  type?: 'image_url';
86
121
  }
87
122
  namespace OpenAIChatCompletionContentPartImageParam {
88
123
  /**
89
- * Image URL specification for OpenAI-compatible chat completion messages.
124
+ * Image URL specification and processing details.
90
125
  */
91
126
  interface ImageURL {
127
+ /**
128
+ * URL of the image to include in the message.
129
+ */
92
130
  url: string;
93
- detail?: string | null;
131
+ /**
132
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
133
+ */
134
+ detail?: 'low' | 'high' | 'auto' | null;
94
135
  }
95
136
  }
96
137
  interface OpenAIFile {
138
+ /**
139
+ * File specification.
140
+ */
97
141
  file: OpenAIFile.File;
142
+ /**
143
+ * Must be 'file' to identify this as file content.
144
+ */
98
145
  type?: 'file';
99
146
  }
100
147
  namespace OpenAIFile {
148
+ /**
149
+ * File specification.
150
+ */
101
151
  interface File {
152
+ /**
153
+ * Base64-encoded file data.
154
+ */
102
155
  file_data?: string | null;
156
+ /**
157
+ * ID of an uploaded file.
158
+ */
103
159
  file_id?: string | null;
160
+ /**
161
+ * Name of the file.
162
+ */
104
163
  filename?: string | null;
105
164
  }
106
165
  }
@@ -109,8 +168,18 @@ export declare namespace CompletionCreateResponse {
109
168
  * A system message providing instructions or context to the model.
110
169
  */
111
170
  interface OpenAISystemMessageParam {
171
+ /**
172
+ * The content of the 'system prompt'. If multiple system messages are provided,
173
+ * they are concatenated.
174
+ */
112
175
  content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
176
+ /**
177
+ * The name of the system message participant.
178
+ */
113
179
  name?: string | null;
180
+ /**
181
+ * Must be 'system' to identify this as a system message.
182
+ */
114
183
  role?: 'system';
115
184
  }
116
185
  namespace OpenAISystemMessageParam {
@@ -118,7 +187,13 @@ export declare namespace CompletionCreateResponse {
118
187
  * Text content part for OpenAI-compatible chat completion messages.
119
188
  */
120
189
  interface ListOpenAIChatCompletionContentPartTextParam {
190
+ /**
191
+ * The text content of the message.
192
+ */
121
193
  text: string;
194
+ /**
195
+ * Must be 'text' to identify this as text content.
196
+ */
122
197
  type?: 'text';
123
198
  }
124
199
  }
@@ -127,9 +202,21 @@ export declare namespace CompletionCreateResponse {
127
202
  * chat completion request.
128
203
  */
129
204
  interface OpenAIAssistantMessageParamOutput {
205
+ /**
206
+ * The content of the model's response.
207
+ */
130
208
  content?: string | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam> | null;
209
+ /**
210
+ * The name of the assistant message participant.
211
+ */
131
212
  name?: string | null;
213
+ /**
214
+ * Must be 'assistant' to identify this as the model's response.
215
+ */
132
216
  role?: 'assistant';
217
+ /**
218
+ * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
219
+ */
133
220
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
134
221
  }
135
222
  namespace OpenAIAssistantMessageParamOutput {
@@ -137,19 +224,34 @@ export declare namespace CompletionCreateResponse {
137
224
  * Text content part for OpenAI-compatible chat completion messages.
138
225
  */
139
226
  interface ListOpenAIChatCompletionContentPartTextParam {
227
+ /**
228
+ * The text content of the message.
229
+ */
140
230
  text: string;
231
+ /**
232
+ * Must be 'text' to identify this as text content.
233
+ */
141
234
  type?: 'text';
142
235
  }
143
236
  /**
144
237
  * Tool call specification for OpenAI-compatible chat completion responses.
145
238
  */
146
239
  interface ToolCall {
240
+ /**
241
+ * Unique identifier for the tool call.
242
+ */
147
243
  id?: string | null;
148
244
  /**
149
245
  * Function call details for OpenAI-compatible tool calls.
150
246
  */
151
247
  function?: ToolCall.Function | null;
248
+ /**
249
+ * Index of the tool call in the list.
250
+ */
152
251
  index?: number | null;
252
+ /**
253
+ * Must be 'function' to identify this as a function call.
254
+ */
153
255
  type?: 'function';
154
256
  }
155
257
  namespace ToolCall {
@@ -157,7 +259,13 @@ export declare namespace CompletionCreateResponse {
157
259
  * Function call details for OpenAI-compatible tool calls.
158
260
  */
159
261
  interface Function {
262
+ /**
263
+ * Arguments to pass to the function as a JSON string.
264
+ */
160
265
  arguments?: string | null;
266
+ /**
267
+ * Name of the function to call.
268
+ */
161
269
  name?: string | null;
162
270
  }
163
271
  }
@@ -167,8 +275,17 @@ export declare namespace CompletionCreateResponse {
167
275
  * chat completion request.
168
276
  */
169
277
  interface OpenAIToolMessageParam {
278
+ /**
279
+ * The response content from the tool.
280
+ */
170
281
  content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
282
+ /**
283
+ * Unique identifier for the tool call this response is for.
284
+ */
171
285
  tool_call_id: string;
286
+ /**
287
+ * Must be 'tool' to identify this as a tool response.
288
+ */
172
289
  role?: 'tool';
173
290
  }
174
291
  namespace OpenAIToolMessageParam {
@@ -176,7 +293,13 @@ export declare namespace CompletionCreateResponse {
176
293
  * Text content part for OpenAI-compatible chat completion messages.
177
294
  */
178
295
  interface ListOpenAIChatCompletionContentPartTextParam {
296
+ /**
297
+ * The text content of the message.
298
+ */
179
299
  text: string;
300
+ /**
301
+ * Must be 'text' to identify this as text content.
302
+ */
180
303
  type?: 'text';
181
304
  }
182
305
  }
@@ -184,8 +307,17 @@ export declare namespace CompletionCreateResponse {
184
307
  * A message from the developer in an OpenAI-compatible chat completion request.
185
308
  */
186
309
  interface OpenAIDeveloperMessageParam {
310
+ /**
311
+ * The content of the developer message.
312
+ */
187
313
  content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
314
+ /**
315
+ * The name of the developer message participant.
316
+ */
188
317
  name?: string | null;
318
+ /**
319
+ * Must be 'developer' to identify this as a developer message.
320
+ */
189
321
  role?: 'developer';
190
322
  }
191
323
  namespace OpenAIDeveloperMessageParam {
@@ -193,7 +325,13 @@ export declare namespace CompletionCreateResponse {
193
325
  * Text content part for OpenAI-compatible chat completion messages.
194
326
  */
195
327
  interface ListOpenAIChatCompletionContentPartTextParam {
328
+ /**
329
+ * The text content of the message.
330
+ */
196
331
  text: string;
332
+ /**
333
+ * Must be 'text' to identify this as text content.
334
+ */
197
335
  type?: 'text';
198
336
  }
199
337
  }
@@ -202,61 +340,97 @@ export declare namespace CompletionCreateResponse {
202
340
  * chat completion response.
203
341
  */
204
342
  interface Logprobs {
343
+ /**
344
+ * The log probabilities for the tokens in the message.
345
+ */
205
346
  content?: Array<Logprobs.Content> | null;
347
+ /**
348
+ * The log probabilities for the refusal tokens.
349
+ */
206
350
  refusal?: Array<Logprobs.Refusal> | null;
207
351
  }
208
352
  namespace Logprobs {
209
353
  /**
210
354
  * The log probability for a token from an OpenAI-compatible chat completion
211
355
  * response.
212
- *
213
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
214
- * probability of the token :top_logprobs: The top log probabilities for the token
215
356
  */
216
357
  interface Content {
358
+ /**
359
+ * The token.
360
+ */
217
361
  token: string;
362
+ /**
363
+ * The log probability of the token.
364
+ */
218
365
  logprob: number;
219
- top_logprobs: Array<Content.TopLogprob>;
366
+ /**
367
+ * The bytes for the token.
368
+ */
220
369
  bytes?: Array<number> | null;
370
+ /**
371
+ * The top log probabilities for the token.
372
+ */
373
+ top_logprobs?: Array<Content.TopLogprob> | null;
221
374
  }
222
375
  namespace Content {
223
376
  /**
224
377
  * The top log probability for a token from an OpenAI-compatible chat completion
225
378
  * response.
226
- *
227
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
228
- * probability of the token
229
379
  */
230
380
  interface TopLogprob {
381
+ /**
382
+ * The token.
383
+ */
231
384
  token: string;
385
+ /**
386
+ * The log probability of the token.
387
+ */
232
388
  logprob: number;
389
+ /**
390
+ * The bytes for the token.
391
+ */
233
392
  bytes?: Array<number> | null;
234
393
  }
235
394
  }
236
395
  /**
237
396
  * The log probability for a token from an OpenAI-compatible chat completion
238
397
  * response.
239
- *
240
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
241
- * probability of the token :top_logprobs: The top log probabilities for the token
242
398
  */
243
399
  interface Refusal {
400
+ /**
401
+ * The token.
402
+ */
244
403
  token: string;
404
+ /**
405
+ * The log probability of the token.
406
+ */
245
407
  logprob: number;
246
- top_logprobs: Array<Refusal.TopLogprob>;
408
+ /**
409
+ * The bytes for the token.
410
+ */
247
411
  bytes?: Array<number> | null;
412
+ /**
413
+ * The top log probabilities for the token.
414
+ */
415
+ top_logprobs?: Array<Refusal.TopLogprob> | null;
248
416
  }
249
417
  namespace Refusal {
250
418
  /**
251
419
  * The top log probability for a token from an OpenAI-compatible chat completion
252
420
  * response.
253
- *
254
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
255
- * probability of the token
256
421
  */
257
422
  interface TopLogprob {
423
+ /**
424
+ * The token.
425
+ */
258
426
  token: string;
427
+ /**
428
+ * The log probability of the token.
429
+ */
259
430
  logprob: number;
431
+ /**
432
+ * The bytes for the token.
433
+ */
260
434
  bytes?: Array<number> | null;
261
435
  }
262
436
  }
@@ -266,8 +440,17 @@ export declare namespace CompletionCreateResponse {
266
440
  * Usage information for OpenAI chat completion.
267
441
  */
268
442
  interface Usage {
443
+ /**
444
+ * Number of tokens in the completion.
445
+ */
269
446
  completion_tokens: number;
447
+ /**
448
+ * Number of tokens in the prompt.
449
+ */
270
450
  prompt_tokens: number;
451
+ /**
452
+ * Total tokens used (prompt + completion).
453
+ */
271
454
  total_tokens: number;
272
455
  /**
273
456
  * Token details for output tokens in OpenAI chat completion usage.
@@ -283,22 +466,46 @@ export declare namespace CompletionCreateResponse {
283
466
  * Token details for output tokens in OpenAI chat completion usage.
284
467
  */
285
468
  interface CompletionTokensDetails {
469
+ /**
470
+ * Number of tokens used for reasoning (o1/o3 models).
471
+ */
286
472
  reasoning_tokens?: number | null;
287
473
  }
288
474
  /**
289
475
  * Token details for prompt tokens in OpenAI chat completion usage.
290
476
  */
291
477
  interface PromptTokensDetails {
478
+ /**
479
+ * Number of tokens retrieved from cache.
480
+ */
292
481
  cached_tokens?: number | null;
293
482
  }
294
483
  }
295
484
  }
296
485
  export interface CompletionRetrieveResponse {
486
+ /**
487
+ * The ID of the chat completion.
488
+ */
297
489
  id: string;
490
+ /**
491
+ * List of choices.
492
+ */
298
493
  choices: Array<CompletionRetrieveResponse.Choice>;
494
+ /**
495
+ * The Unix timestamp in seconds when the chat completion was created.
496
+ */
299
497
  created: number;
498
+ /**
499
+ * The input messages used to generate this completion.
500
+ */
300
501
  input_messages: Array<CompletionRetrieveResponse.OpenAIUserMessageParamOutput | CompletionRetrieveResponse.OpenAISystemMessageParam | CompletionRetrieveResponse.OpenAIAssistantMessageParamOutput | CompletionRetrieveResponse.OpenAIToolMessageParam | CompletionRetrieveResponse.OpenAIDeveloperMessageParam>;
502
+ /**
503
+ * The model that was used to generate the chat completion.
504
+ */
301
505
  model: string;
506
+ /**
507
+ * The object type.
508
+ */
302
509
  object?: 'chat.completion';
303
510
  /**
304
511
  * Usage information for OpenAI chat completion.
@@ -310,10 +517,16 @@ export declare namespace CompletionRetrieveResponse {
310
517
  * A choice from an OpenAI-compatible chat completion response.
311
518
  */
312
519
  interface Choice {
313
- finish_reason: string;
520
+ /**
521
+ * The reason the model stopped generating.
522
+ */
523
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
524
+ /**
525
+ * The index of the choice.
526
+ */
314
527
  index: number;
315
528
  /**
316
- * A message from the user in an OpenAI-compatible chat completion request.
529
+ * The message from the model.
317
530
  */
318
531
  message: Choice.OpenAIUserMessageParamOutput | Choice.OpenAISystemMessageParam | Choice.OpenAIAssistantMessageParamOutput | Choice.OpenAIToolMessageParam | Choice.OpenAIDeveloperMessageParam;
319
532
  /**
@@ -327,8 +540,17 @@ export declare namespace CompletionRetrieveResponse {
327
540
  * A message from the user in an OpenAI-compatible chat completion request.
328
541
  */
329
542
  interface OpenAIUserMessageParamOutput {
543
+ /**
544
+ * The content of the message, which can include text and other media.
545
+ */
330
546
  content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
547
+ /**
548
+ * The name of the user message participant.
549
+ */
331
550
  name?: string | null;
551
+ /**
552
+ * Must be 'user' to identify this as a user message.
553
+ */
332
554
  role?: 'user';
333
555
  }
334
556
  namespace OpenAIUserMessageParamOutput {
@@ -336,7 +558,13 @@ export declare namespace CompletionRetrieveResponse {
336
558
  * Text content part for OpenAI-compatible chat completion messages.
337
559
  */
338
560
  interface OpenAIChatCompletionContentPartTextParam {
561
+ /**
562
+ * The text content of the message.
563
+ */
339
564
  text: string;
565
+ /**
566
+ * Must be 'text' to identify this as text content.
567
+ */
340
568
  type?: 'text';
341
569
  }
342
570
  /**
@@ -344,28 +572,55 @@ export declare namespace CompletionRetrieveResponse {
344
572
  */
345
573
  interface OpenAIChatCompletionContentPartImageParam {
346
574
  /**
347
- * Image URL specification for OpenAI-compatible chat completion messages.
575
+ * Image URL specification and processing details.
348
576
  */
349
577
  image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
578
+ /**
579
+ * Must be 'image_url' to identify this as image content.
580
+ */
350
581
  type?: 'image_url';
351
582
  }
352
583
  namespace OpenAIChatCompletionContentPartImageParam {
353
584
  /**
354
- * Image URL specification for OpenAI-compatible chat completion messages.
585
+ * Image URL specification and processing details.
355
586
  */
356
587
  interface ImageURL {
588
+ /**
589
+ * URL of the image to include in the message.
590
+ */
357
591
  url: string;
358
- detail?: string | null;
592
+ /**
593
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
594
+ */
595
+ detail?: 'low' | 'high' | 'auto' | null;
359
596
  }
360
597
  }
361
598
  interface OpenAIFile {
599
+ /**
600
+ * File specification.
601
+ */
362
602
  file: OpenAIFile.File;
603
+ /**
604
+ * Must be 'file' to identify this as file content.
605
+ */
363
606
  type?: 'file';
364
607
  }
365
608
  namespace OpenAIFile {
609
+ /**
610
+ * File specification.
611
+ */
366
612
  interface File {
613
+ /**
614
+ * Base64-encoded file data.
615
+ */
367
616
  file_data?: string | null;
617
+ /**
618
+ * ID of an uploaded file.
619
+ */
368
620
  file_id?: string | null;
621
+ /**
622
+ * Name of the file.
623
+ */
369
624
  filename?: string | null;
370
625
  }
371
626
  }
@@ -374,8 +629,18 @@ export declare namespace CompletionRetrieveResponse {
374
629
  * A system message providing instructions or context to the model.
375
630
  */
376
631
  interface OpenAISystemMessageParam {
632
+ /**
633
+ * The content of the 'system prompt'. If multiple system messages are provided,
634
+ * they are concatenated.
635
+ */
377
636
  content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
637
+ /**
638
+ * The name of the system message participant.
639
+ */
378
640
  name?: string | null;
641
+ /**
642
+ * Must be 'system' to identify this as a system message.
643
+ */
379
644
  role?: 'system';
380
645
  }
381
646
  namespace OpenAISystemMessageParam {
@@ -383,7 +648,13 @@ export declare namespace CompletionRetrieveResponse {
383
648
  * Text content part for OpenAI-compatible chat completion messages.
384
649
  */
385
650
  interface ListOpenAIChatCompletionContentPartTextParam {
651
+ /**
652
+ * The text content of the message.
653
+ */
386
654
  text: string;
655
+ /**
656
+ * Must be 'text' to identify this as text content.
657
+ */
387
658
  type?: 'text';
388
659
  }
389
660
  }
@@ -392,9 +663,21 @@ export declare namespace CompletionRetrieveResponse {
392
663
  * chat completion request.
393
664
  */
394
665
  interface OpenAIAssistantMessageParamOutput {
666
+ /**
667
+ * The content of the model's response.
668
+ */
395
669
  content?: string | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam> | null;
670
+ /**
671
+ * The name of the assistant message participant.
672
+ */
396
673
  name?: string | null;
674
+ /**
675
+ * Must be 'assistant' to identify this as the model's response.
676
+ */
397
677
  role?: 'assistant';
678
+ /**
679
+ * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
680
+ */
398
681
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
399
682
  }
400
683
  namespace OpenAIAssistantMessageParamOutput {
@@ -402,19 +685,34 @@ export declare namespace CompletionRetrieveResponse {
402
685
  * Text content part for OpenAI-compatible chat completion messages.
403
686
  */
404
687
  interface ListOpenAIChatCompletionContentPartTextParam {
688
+ /**
689
+ * The text content of the message.
690
+ */
405
691
  text: string;
692
+ /**
693
+ * Must be 'text' to identify this as text content.
694
+ */
406
695
  type?: 'text';
407
696
  }
408
697
  /**
409
698
  * Tool call specification for OpenAI-compatible chat completion responses.
410
699
  */
411
700
  interface ToolCall {
701
+ /**
702
+ * Unique identifier for the tool call.
703
+ */
412
704
  id?: string | null;
413
705
  /**
414
706
  * Function call details for OpenAI-compatible tool calls.
415
707
  */
416
708
  function?: ToolCall.Function | null;
709
+ /**
710
+ * Index of the tool call in the list.
711
+ */
417
712
  index?: number | null;
713
+ /**
714
+ * Must be 'function' to identify this as a function call.
715
+ */
418
716
  type?: 'function';
419
717
  }
420
718
  namespace ToolCall {
@@ -422,7 +720,13 @@ export declare namespace CompletionRetrieveResponse {
422
720
  * Function call details for OpenAI-compatible tool calls.
423
721
  */
424
722
  interface Function {
723
+ /**
724
+ * Arguments to pass to the function as a JSON string.
725
+ */
425
726
  arguments?: string | null;
727
+ /**
728
+ * Name of the function to call.
729
+ */
426
730
  name?: string | null;
427
731
  }
428
732
  }
@@ -432,8 +736,17 @@ export declare namespace CompletionRetrieveResponse {
432
736
  * chat completion request.
433
737
  */
434
738
  interface OpenAIToolMessageParam {
739
+ /**
740
+ * The response content from the tool.
741
+ */
435
742
  content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
743
+ /**
744
+ * Unique identifier for the tool call this response is for.
745
+ */
436
746
  tool_call_id: string;
747
+ /**
748
+ * Must be 'tool' to identify this as a tool response.
749
+ */
437
750
  role?: 'tool';
438
751
  }
439
752
  namespace OpenAIToolMessageParam {
@@ -441,7 +754,13 @@ export declare namespace CompletionRetrieveResponse {
441
754
  * Text content part for OpenAI-compatible chat completion messages.
442
755
  */
443
756
  interface ListOpenAIChatCompletionContentPartTextParam {
757
+ /**
758
+ * The text content of the message.
759
+ */
444
760
  text: string;
761
+ /**
762
+ * Must be 'text' to identify this as text content.
763
+ */
445
764
  type?: 'text';
446
765
  }
447
766
  }
@@ -449,8 +768,17 @@ export declare namespace CompletionRetrieveResponse {
449
768
  * A message from the developer in an OpenAI-compatible chat completion request.
450
769
  */
451
770
  interface OpenAIDeveloperMessageParam {
771
+ /**
772
+ * The content of the developer message.
773
+ */
452
774
  content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
775
+ /**
776
+ * The name of the developer message participant.
777
+ */
453
778
  name?: string | null;
779
+ /**
780
+ * Must be 'developer' to identify this as a developer message.
781
+ */
454
782
  role?: 'developer';
455
783
  }
456
784
  namespace OpenAIDeveloperMessageParam {
@@ -458,7 +786,13 @@ export declare namespace CompletionRetrieveResponse {
458
786
  * Text content part for OpenAI-compatible chat completion messages.
459
787
  */
460
788
  interface ListOpenAIChatCompletionContentPartTextParam {
789
+ /**
790
+ * The text content of the message.
791
+ */
461
792
  text: string;
793
+ /**
794
+ * Must be 'text' to identify this as text content.
795
+ */
462
796
  type?: 'text';
463
797
  }
464
798
  }
@@ -467,61 +801,97 @@ export declare namespace CompletionRetrieveResponse {
467
801
  * chat completion response.
468
802
  */
469
803
  interface Logprobs {
804
+ /**
805
+ * The log probabilities for the tokens in the message.
806
+ */
470
807
  content?: Array<Logprobs.Content> | null;
808
+ /**
809
+ * The log probabilities for the refusal tokens.
810
+ */
471
811
  refusal?: Array<Logprobs.Refusal> | null;
472
812
  }
473
813
  namespace Logprobs {
474
814
  /**
475
815
  * The log probability for a token from an OpenAI-compatible chat completion
476
816
  * response.
477
- *
478
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
479
- * probability of the token :top_logprobs: The top log probabilities for the token
480
817
  */
481
818
  interface Content {
819
+ /**
820
+ * The token.
821
+ */
482
822
  token: string;
823
+ /**
824
+ * The log probability of the token.
825
+ */
483
826
  logprob: number;
484
- top_logprobs: Array<Content.TopLogprob>;
827
+ /**
828
+ * The bytes for the token.
829
+ */
485
830
  bytes?: Array<number> | null;
831
+ /**
832
+ * The top log probabilities for the token.
833
+ */
834
+ top_logprobs?: Array<Content.TopLogprob> | null;
486
835
  }
487
836
  namespace Content {
488
837
  /**
489
838
  * The top log probability for a token from an OpenAI-compatible chat completion
490
839
  * response.
491
- *
492
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
493
- * probability of the token
494
840
  */
495
841
  interface TopLogprob {
842
+ /**
843
+ * The token.
844
+ */
496
845
  token: string;
846
+ /**
847
+ * The log probability of the token.
848
+ */
497
849
  logprob: number;
850
+ /**
851
+ * The bytes for the token.
852
+ */
498
853
  bytes?: Array<number> | null;
499
854
  }
500
855
  }
501
856
  /**
502
857
  * The log probability for a token from an OpenAI-compatible chat completion
503
858
  * response.
504
- *
505
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
506
- * probability of the token :top_logprobs: The top log probabilities for the token
507
859
  */
508
860
  interface Refusal {
861
+ /**
862
+ * The token.
863
+ */
509
864
  token: string;
865
+ /**
866
+ * The log probability of the token.
867
+ */
510
868
  logprob: number;
511
- top_logprobs: Array<Refusal.TopLogprob>;
869
+ /**
870
+ * The bytes for the token.
871
+ */
512
872
  bytes?: Array<number> | null;
873
+ /**
874
+ * The top log probabilities for the token.
875
+ */
876
+ top_logprobs?: Array<Refusal.TopLogprob> | null;
513
877
  }
514
878
  namespace Refusal {
515
879
  /**
516
880
  * The top log probability for a token from an OpenAI-compatible chat completion
517
881
  * response.
518
- *
519
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
520
- * probability of the token
521
882
  */
522
883
  interface TopLogprob {
884
+ /**
885
+ * The token.
886
+ */
523
887
  token: string;
888
+ /**
889
+ * The log probability of the token.
890
+ */
524
891
  logprob: number;
892
+ /**
893
+ * The bytes for the token.
894
+ */
525
895
  bytes?: Array<number> | null;
526
896
  }
527
897
  }
@@ -531,8 +901,17 @@ export declare namespace CompletionRetrieveResponse {
531
901
  * A message from the user in an OpenAI-compatible chat completion request.
532
902
  */
533
903
  interface OpenAIUserMessageParamOutput {
904
+ /**
905
+ * The content of the message, which can include text and other media.
906
+ */
534
907
  content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
908
+ /**
909
+ * The name of the user message participant.
910
+ */
535
911
  name?: string | null;
912
+ /**
913
+ * Must be 'user' to identify this as a user message.
914
+ */
536
915
  role?: 'user';
537
916
  }
538
917
  namespace OpenAIUserMessageParamOutput {
@@ -540,7 +919,13 @@ export declare namespace CompletionRetrieveResponse {
540
919
  * Text content part for OpenAI-compatible chat completion messages.
541
920
  */
542
921
  interface OpenAIChatCompletionContentPartTextParam {
922
+ /**
923
+ * The text content of the message.
924
+ */
543
925
  text: string;
926
+ /**
927
+ * Must be 'text' to identify this as text content.
928
+ */
544
929
  type?: 'text';
545
930
  }
546
931
  /**
@@ -548,28 +933,55 @@ export declare namespace CompletionRetrieveResponse {
548
933
  */
549
934
  interface OpenAIChatCompletionContentPartImageParam {
550
935
  /**
551
- * Image URL specification for OpenAI-compatible chat completion messages.
936
+ * Image URL specification and processing details.
552
937
  */
553
938
  image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
939
+ /**
940
+ * Must be 'image_url' to identify this as image content.
941
+ */
554
942
  type?: 'image_url';
555
943
  }
556
944
  namespace OpenAIChatCompletionContentPartImageParam {
557
945
  /**
558
- * Image URL specification for OpenAI-compatible chat completion messages.
946
+ * Image URL specification and processing details.
559
947
  */
560
948
  interface ImageURL {
949
+ /**
950
+ * URL of the image to include in the message.
951
+ */
561
952
  url: string;
562
- detail?: string | null;
953
+ /**
954
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
955
+ */
956
+ detail?: 'low' | 'high' | 'auto' | null;
563
957
  }
564
958
  }
565
959
  interface OpenAIFile {
960
+ /**
961
+ * File specification.
962
+ */
566
963
  file: OpenAIFile.File;
964
+ /**
965
+ * Must be 'file' to identify this as file content.
966
+ */
567
967
  type?: 'file';
568
968
  }
569
969
  namespace OpenAIFile {
970
+ /**
971
+ * File specification.
972
+ */
570
973
  interface File {
974
+ /**
975
+ * Base64-encoded file data.
976
+ */
571
977
  file_data?: string | null;
978
+ /**
979
+ * ID of an uploaded file.
980
+ */
572
981
  file_id?: string | null;
982
+ /**
983
+ * Name of the file.
984
+ */
573
985
  filename?: string | null;
574
986
  }
575
987
  }
@@ -578,8 +990,18 @@ export declare namespace CompletionRetrieveResponse {
578
990
  * A system message providing instructions or context to the model.
579
991
  */
580
992
  interface OpenAISystemMessageParam {
993
+ /**
994
+ * The content of the 'system prompt'. If multiple system messages are provided,
995
+ * they are concatenated.
996
+ */
581
997
  content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
998
+ /**
999
+ * The name of the system message participant.
1000
+ */
582
1001
  name?: string | null;
1002
+ /**
1003
+ * Must be 'system' to identify this as a system message.
1004
+ */
583
1005
  role?: 'system';
584
1006
  }
585
1007
  namespace OpenAISystemMessageParam {
@@ -587,7 +1009,13 @@ export declare namespace CompletionRetrieveResponse {
587
1009
  * Text content part for OpenAI-compatible chat completion messages.
588
1010
  */
589
1011
  interface ListOpenAIChatCompletionContentPartTextParam {
1012
+ /**
1013
+ * The text content of the message.
1014
+ */
590
1015
  text: string;
1016
+ /**
1017
+ * Must be 'text' to identify this as text content.
1018
+ */
591
1019
  type?: 'text';
592
1020
  }
593
1021
  }
@@ -596,9 +1024,21 @@ export declare namespace CompletionRetrieveResponse {
596
1024
  * chat completion request.
597
1025
  */
598
1026
  interface OpenAIAssistantMessageParamOutput {
1027
+ /**
1028
+ * The content of the model's response.
1029
+ */
599
1030
  content?: string | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam> | null;
1031
+ /**
1032
+ * The name of the assistant message participant.
1033
+ */
600
1034
  name?: string | null;
1035
+ /**
1036
+ * Must be 'assistant' to identify this as the model's response.
1037
+ */
601
1038
  role?: 'assistant';
1039
+ /**
1040
+ * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
1041
+ */
602
1042
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
603
1043
  }
604
1044
  namespace OpenAIAssistantMessageParamOutput {
@@ -606,19 +1046,34 @@ export declare namespace CompletionRetrieveResponse {
606
1046
  * Text content part for OpenAI-compatible chat completion messages.
607
1047
  */
608
1048
  interface ListOpenAIChatCompletionContentPartTextParam {
1049
+ /**
1050
+ * The text content of the message.
1051
+ */
609
1052
  text: string;
1053
+ /**
1054
+ * Must be 'text' to identify this as text content.
1055
+ */
610
1056
  type?: 'text';
611
1057
  }
612
1058
  /**
613
1059
  * Tool call specification for OpenAI-compatible chat completion responses.
614
1060
  */
615
1061
  interface ToolCall {
1062
+ /**
1063
+ * Unique identifier for the tool call.
1064
+ */
616
1065
  id?: string | null;
617
1066
  /**
618
1067
  * Function call details for OpenAI-compatible tool calls.
619
1068
  */
620
1069
  function?: ToolCall.Function | null;
1070
+ /**
1071
+ * Index of the tool call in the list.
1072
+ */
621
1073
  index?: number | null;
1074
+ /**
1075
+ * Must be 'function' to identify this as a function call.
1076
+ */
622
1077
  type?: 'function';
623
1078
  }
624
1079
  namespace ToolCall {
@@ -626,7 +1081,13 @@ export declare namespace CompletionRetrieveResponse {
626
1081
  * Function call details for OpenAI-compatible tool calls.
627
1082
  */
628
1083
  interface Function {
1084
+ /**
1085
+ * Arguments to pass to the function as a JSON string.
1086
+ */
629
1087
  arguments?: string | null;
1088
+ /**
1089
+ * Name of the function to call.
1090
+ */
630
1091
  name?: string | null;
631
1092
  }
632
1093
  }
@@ -636,8 +1097,17 @@ export declare namespace CompletionRetrieveResponse {
636
1097
  * chat completion request.
637
1098
  */
638
1099
  interface OpenAIToolMessageParam {
1100
+ /**
1101
+ * The response content from the tool.
1102
+ */
639
1103
  content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1104
+ /**
1105
+ * Unique identifier for the tool call this response is for.
1106
+ */
640
1107
  tool_call_id: string;
1108
+ /**
1109
+ * Must be 'tool' to identify this as a tool response.
1110
+ */
641
1111
  role?: 'tool';
642
1112
  }
643
1113
  namespace OpenAIToolMessageParam {
@@ -645,7 +1115,13 @@ export declare namespace CompletionRetrieveResponse {
645
1115
  * Text content part for OpenAI-compatible chat completion messages.
646
1116
  */
647
1117
  interface ListOpenAIChatCompletionContentPartTextParam {
1118
+ /**
1119
+ * The text content of the message.
1120
+ */
648
1121
  text: string;
1122
+ /**
1123
+ * Must be 'text' to identify this as text content.
1124
+ */
649
1125
  type?: 'text';
650
1126
  }
651
1127
  }
@@ -653,8 +1129,17 @@ export declare namespace CompletionRetrieveResponse {
653
1129
  * A message from the developer in an OpenAI-compatible chat completion request.
654
1130
  */
655
1131
  interface OpenAIDeveloperMessageParam {
1132
+ /**
1133
+ * The content of the developer message.
1134
+ */
656
1135
  content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1136
+ /**
1137
+ * The name of the developer message participant.
1138
+ */
657
1139
  name?: string | null;
1140
+ /**
1141
+ * Must be 'developer' to identify this as a developer message.
1142
+ */
658
1143
  role?: 'developer';
659
1144
  }
660
1145
  namespace OpenAIDeveloperMessageParam {
@@ -662,7 +1147,13 @@ export declare namespace CompletionRetrieveResponse {
662
1147
  * Text content part for OpenAI-compatible chat completion messages.
663
1148
  */
664
1149
  interface ListOpenAIChatCompletionContentPartTextParam {
1150
+ /**
1151
+ * The text content of the message.
1152
+ */
665
1153
  text: string;
1154
+ /**
1155
+ * Must be 'text' to identify this as text content.
1156
+ */
666
1157
  type?: 'text';
667
1158
  }
668
1159
  }
@@ -670,8 +1161,17 @@ export declare namespace CompletionRetrieveResponse {
670
1161
  * Usage information for OpenAI chat completion.
671
1162
  */
672
1163
  interface Usage {
1164
+ /**
1165
+ * Number of tokens in the completion.
1166
+ */
673
1167
  completion_tokens: number;
1168
+ /**
1169
+ * Number of tokens in the prompt.
1170
+ */
674
1171
  prompt_tokens: number;
1172
+ /**
1173
+ * Total tokens used (prompt + completion).
1174
+ */
675
1175
  total_tokens: number;
676
1176
  /**
677
1177
  * Token details for output tokens in OpenAI chat completion usage.
@@ -687,12 +1187,18 @@ export declare namespace CompletionRetrieveResponse {
687
1187
  * Token details for output tokens in OpenAI chat completion usage.
688
1188
  */
689
1189
  interface CompletionTokensDetails {
1190
+ /**
1191
+ * Number of tokens used for reasoning (o1/o3 models).
1192
+ */
690
1193
  reasoning_tokens?: number | null;
691
1194
  }
692
1195
  /**
693
1196
  * Token details for prompt tokens in OpenAI chat completion usage.
694
1197
  */
695
1198
  interface PromptTokensDetails {
1199
+ /**
1200
+ * Number of tokens retrieved from cache.
1201
+ */
696
1202
  cached_tokens?: number | null;
697
1203
  }
698
1204
  }
@@ -701,19 +1207,52 @@ export declare namespace CompletionRetrieveResponse {
701
1207
  * Response from listing OpenAI-compatible chat completions.
702
1208
  */
703
1209
  export interface CompletionListResponse {
1210
+ /**
1211
+ * List of chat completion objects with their input messages.
1212
+ */
704
1213
  data: Array<CompletionListResponse.Data>;
1214
+ /**
1215
+ * ID of the first completion in this list.
1216
+ */
705
1217
  first_id: string;
1218
+ /**
1219
+ * Whether there are more completions available beyond this list.
1220
+ */
706
1221
  has_more: boolean;
1222
+ /**
1223
+ * ID of the last completion in this list.
1224
+ */
707
1225
  last_id: string;
1226
+ /**
1227
+ * Must be 'list' to identify this as a list response.
1228
+ */
708
1229
  object?: 'list';
709
1230
  }
710
1231
  export declare namespace CompletionListResponse {
711
1232
  interface Data {
1233
+ /**
1234
+ * The ID of the chat completion.
1235
+ */
712
1236
  id: string;
1237
+ /**
1238
+ * List of choices.
1239
+ */
713
1240
  choices: Array<Data.Choice>;
1241
+ /**
1242
+ * The Unix timestamp in seconds when the chat completion was created.
1243
+ */
714
1244
  created: number;
1245
+ /**
1246
+ * The input messages used to generate this completion.
1247
+ */
715
1248
  input_messages: Array<Data.OpenAIUserMessageParamOutput | Data.OpenAISystemMessageParam | Data.OpenAIAssistantMessageParamOutput | Data.OpenAIToolMessageParam | Data.OpenAIDeveloperMessageParam>;
1249
+ /**
1250
+ * The model that was used to generate the chat completion.
1251
+ */
716
1252
  model: string;
1253
+ /**
1254
+ * The object type.
1255
+ */
717
1256
  object?: 'chat.completion';
718
1257
  /**
719
1258
  * Usage information for OpenAI chat completion.
@@ -725,10 +1264,16 @@ export declare namespace CompletionListResponse {
725
1264
  * A choice from an OpenAI-compatible chat completion response.
726
1265
  */
727
1266
  interface Choice {
728
- finish_reason: string;
1267
+ /**
1268
+ * The reason the model stopped generating.
1269
+ */
1270
+ finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call';
1271
+ /**
1272
+ * The index of the choice.
1273
+ */
729
1274
  index: number;
730
1275
  /**
731
- * A message from the user in an OpenAI-compatible chat completion request.
1276
+ * The message from the model.
732
1277
  */
733
1278
  message: Choice.OpenAIUserMessageParamOutput | Choice.OpenAISystemMessageParam | Choice.OpenAIAssistantMessageParamOutput | Choice.OpenAIToolMessageParam | Choice.OpenAIDeveloperMessageParam;
734
1279
  /**
@@ -742,8 +1287,17 @@ export declare namespace CompletionListResponse {
742
1287
  * A message from the user in an OpenAI-compatible chat completion request.
743
1288
  */
744
1289
  interface OpenAIUserMessageParamOutput {
1290
+ /**
1291
+ * The content of the message, which can include text and other media.
1292
+ */
745
1293
  content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
1294
+ /**
1295
+ * The name of the user message participant.
1296
+ */
746
1297
  name?: string | null;
1298
+ /**
1299
+ * Must be 'user' to identify this as a user message.
1300
+ */
747
1301
  role?: 'user';
748
1302
  }
749
1303
  namespace OpenAIUserMessageParamOutput {
@@ -751,7 +1305,13 @@ export declare namespace CompletionListResponse {
751
1305
  * Text content part for OpenAI-compatible chat completion messages.
752
1306
  */
753
1307
  interface OpenAIChatCompletionContentPartTextParam {
1308
+ /**
1309
+ * The text content of the message.
1310
+ */
754
1311
  text: string;
1312
+ /**
1313
+ * Must be 'text' to identify this as text content.
1314
+ */
755
1315
  type?: 'text';
756
1316
  }
757
1317
  /**
@@ -759,28 +1319,55 @@ export declare namespace CompletionListResponse {
759
1319
  */
760
1320
  interface OpenAIChatCompletionContentPartImageParam {
761
1321
  /**
762
- * Image URL specification for OpenAI-compatible chat completion messages.
1322
+ * Image URL specification and processing details.
763
1323
  */
764
1324
  image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
1325
+ /**
1326
+ * Must be 'image_url' to identify this as image content.
1327
+ */
765
1328
  type?: 'image_url';
766
1329
  }
767
1330
  namespace OpenAIChatCompletionContentPartImageParam {
768
1331
  /**
769
- * Image URL specification for OpenAI-compatible chat completion messages.
1332
+ * Image URL specification and processing details.
770
1333
  */
771
1334
  interface ImageURL {
1335
+ /**
1336
+ * URL of the image to include in the message.
1337
+ */
772
1338
  url: string;
773
- detail?: string | null;
1339
+ /**
1340
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
1341
+ */
1342
+ detail?: 'low' | 'high' | 'auto' | null;
774
1343
  }
775
1344
  }
776
1345
  interface OpenAIFile {
1346
+ /**
1347
+ * File specification.
1348
+ */
777
1349
  file: OpenAIFile.File;
1350
+ /**
1351
+ * Must be 'file' to identify this as file content.
1352
+ */
778
1353
  type?: 'file';
779
1354
  }
780
1355
  namespace OpenAIFile {
1356
+ /**
1357
+ * File specification.
1358
+ */
781
1359
  interface File {
1360
+ /**
1361
+ * Base64-encoded file data.
1362
+ */
782
1363
  file_data?: string | null;
1364
+ /**
1365
+ * ID of an uploaded file.
1366
+ */
783
1367
  file_id?: string | null;
1368
+ /**
1369
+ * Name of the file.
1370
+ */
784
1371
  filename?: string | null;
785
1372
  }
786
1373
  }
@@ -789,8 +1376,18 @@ export declare namespace CompletionListResponse {
789
1376
  * A system message providing instructions or context to the model.
790
1377
  */
791
1378
  interface OpenAISystemMessageParam {
1379
+ /**
1380
+ * The content of the 'system prompt'. If multiple system messages are provided,
1381
+ * they are concatenated.
1382
+ */
792
1383
  content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1384
+ /**
1385
+ * The name of the system message participant.
1386
+ */
793
1387
  name?: string | null;
1388
+ /**
1389
+ * Must be 'system' to identify this as a system message.
1390
+ */
794
1391
  role?: 'system';
795
1392
  }
796
1393
  namespace OpenAISystemMessageParam {
@@ -798,7 +1395,13 @@ export declare namespace CompletionListResponse {
798
1395
  * Text content part for OpenAI-compatible chat completion messages.
799
1396
  */
800
1397
  interface ListOpenAIChatCompletionContentPartTextParam {
1398
+ /**
1399
+ * The text content of the message.
1400
+ */
801
1401
  text: string;
1402
+ /**
1403
+ * Must be 'text' to identify this as text content.
1404
+ */
802
1405
  type?: 'text';
803
1406
  }
804
1407
  }
@@ -807,9 +1410,21 @@ export declare namespace CompletionListResponse {
807
1410
  * chat completion request.
808
1411
  */
809
1412
  interface OpenAIAssistantMessageParamOutput {
1413
+ /**
1414
+ * The content of the model's response.
1415
+ */
810
1416
  content?: string | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam> | null;
1417
+ /**
1418
+ * The name of the assistant message participant.
1419
+ */
811
1420
  name?: string | null;
1421
+ /**
1422
+ * Must be 'assistant' to identify this as the model's response.
1423
+ */
812
1424
  role?: 'assistant';
1425
+ /**
1426
+ * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
1427
+ */
813
1428
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
814
1429
  }
815
1430
  namespace OpenAIAssistantMessageParamOutput {
@@ -817,19 +1432,34 @@ export declare namespace CompletionListResponse {
817
1432
  * Text content part for OpenAI-compatible chat completion messages.
818
1433
  */
819
1434
  interface ListOpenAIChatCompletionContentPartTextParam {
1435
+ /**
1436
+ * The text content of the message.
1437
+ */
820
1438
  text: string;
1439
+ /**
1440
+ * Must be 'text' to identify this as text content.
1441
+ */
821
1442
  type?: 'text';
822
1443
  }
823
1444
  /**
824
1445
  * Tool call specification for OpenAI-compatible chat completion responses.
825
1446
  */
826
1447
  interface ToolCall {
1448
+ /**
1449
+ * Unique identifier for the tool call.
1450
+ */
827
1451
  id?: string | null;
828
1452
  /**
829
1453
  * Function call details for OpenAI-compatible tool calls.
830
1454
  */
831
1455
  function?: ToolCall.Function | null;
1456
+ /**
1457
+ * Index of the tool call in the list.
1458
+ */
832
1459
  index?: number | null;
1460
+ /**
1461
+ * Must be 'function' to identify this as a function call.
1462
+ */
833
1463
  type?: 'function';
834
1464
  }
835
1465
  namespace ToolCall {
@@ -837,7 +1467,13 @@ export declare namespace CompletionListResponse {
837
1467
  * Function call details for OpenAI-compatible tool calls.
838
1468
  */
839
1469
  interface Function {
1470
+ /**
1471
+ * Arguments to pass to the function as a JSON string.
1472
+ */
840
1473
  arguments?: string | null;
1474
+ /**
1475
+ * Name of the function to call.
1476
+ */
841
1477
  name?: string | null;
842
1478
  }
843
1479
  }
@@ -847,8 +1483,17 @@ export declare namespace CompletionListResponse {
847
1483
  * chat completion request.
848
1484
  */
849
1485
  interface OpenAIToolMessageParam {
1486
+ /**
1487
+ * The response content from the tool.
1488
+ */
850
1489
  content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1490
+ /**
1491
+ * Unique identifier for the tool call this response is for.
1492
+ */
851
1493
  tool_call_id: string;
1494
+ /**
1495
+ * Must be 'tool' to identify this as a tool response.
1496
+ */
852
1497
  role?: 'tool';
853
1498
  }
854
1499
  namespace OpenAIToolMessageParam {
@@ -856,7 +1501,13 @@ export declare namespace CompletionListResponse {
856
1501
  * Text content part for OpenAI-compatible chat completion messages.
857
1502
  */
858
1503
  interface ListOpenAIChatCompletionContentPartTextParam {
1504
+ /**
1505
+ * The text content of the message.
1506
+ */
859
1507
  text: string;
1508
+ /**
1509
+ * Must be 'text' to identify this as text content.
1510
+ */
860
1511
  type?: 'text';
861
1512
  }
862
1513
  }
@@ -864,8 +1515,17 @@ export declare namespace CompletionListResponse {
864
1515
  * A message from the developer in an OpenAI-compatible chat completion request.
865
1516
  */
866
1517
  interface OpenAIDeveloperMessageParam {
1518
+ /**
1519
+ * The content of the developer message.
1520
+ */
867
1521
  content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1522
+ /**
1523
+ * The name of the developer message participant.
1524
+ */
868
1525
  name?: string | null;
1526
+ /**
1527
+ * Must be 'developer' to identify this as a developer message.
1528
+ */
869
1529
  role?: 'developer';
870
1530
  }
871
1531
  namespace OpenAIDeveloperMessageParam {
@@ -873,7 +1533,13 @@ export declare namespace CompletionListResponse {
873
1533
  * Text content part for OpenAI-compatible chat completion messages.
874
1534
  */
875
1535
  interface ListOpenAIChatCompletionContentPartTextParam {
1536
+ /**
1537
+ * The text content of the message.
1538
+ */
876
1539
  text: string;
1540
+ /**
1541
+ * Must be 'text' to identify this as text content.
1542
+ */
877
1543
  type?: 'text';
878
1544
  }
879
1545
  }
@@ -882,61 +1548,97 @@ export declare namespace CompletionListResponse {
882
1548
  * chat completion response.
883
1549
  */
884
1550
  interface Logprobs {
1551
+ /**
1552
+ * The log probabilities for the tokens in the message.
1553
+ */
885
1554
  content?: Array<Logprobs.Content> | null;
1555
+ /**
1556
+ * The log probabilities for the refusal tokens.
1557
+ */
886
1558
  refusal?: Array<Logprobs.Refusal> | null;
887
1559
  }
888
1560
  namespace Logprobs {
889
1561
  /**
890
1562
  * The log probability for a token from an OpenAI-compatible chat completion
891
1563
  * response.
892
- *
893
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
894
- * probability of the token :top_logprobs: The top log probabilities for the token
895
1564
  */
896
1565
  interface Content {
1566
+ /**
1567
+ * The token.
1568
+ */
897
1569
  token: string;
1570
+ /**
1571
+ * The log probability of the token.
1572
+ */
898
1573
  logprob: number;
899
- top_logprobs: Array<Content.TopLogprob>;
1574
+ /**
1575
+ * The bytes for the token.
1576
+ */
900
1577
  bytes?: Array<number> | null;
1578
+ /**
1579
+ * The top log probabilities for the token.
1580
+ */
1581
+ top_logprobs?: Array<Content.TopLogprob> | null;
901
1582
  }
902
1583
  namespace Content {
903
1584
  /**
904
1585
  * The top log probability for a token from an OpenAI-compatible chat completion
905
1586
  * response.
906
- *
907
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
908
- * probability of the token
909
1587
  */
910
1588
  interface TopLogprob {
1589
+ /**
1590
+ * The token.
1591
+ */
911
1592
  token: string;
1593
+ /**
1594
+ * The log probability of the token.
1595
+ */
912
1596
  logprob: number;
1597
+ /**
1598
+ * The bytes for the token.
1599
+ */
913
1600
  bytes?: Array<number> | null;
914
1601
  }
915
1602
  }
916
1603
  /**
917
1604
  * The log probability for a token from an OpenAI-compatible chat completion
918
1605
  * response.
919
- *
920
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
921
- * probability of the token :top_logprobs: The top log probabilities for the token
922
1606
  */
923
1607
  interface Refusal {
1608
+ /**
1609
+ * The token.
1610
+ */
924
1611
  token: string;
1612
+ /**
1613
+ * The log probability of the token.
1614
+ */
925
1615
  logprob: number;
926
- top_logprobs: Array<Refusal.TopLogprob>;
1616
+ /**
1617
+ * The bytes for the token.
1618
+ */
927
1619
  bytes?: Array<number> | null;
1620
+ /**
1621
+ * The top log probabilities for the token.
1622
+ */
1623
+ top_logprobs?: Array<Refusal.TopLogprob> | null;
928
1624
  }
929
1625
  namespace Refusal {
930
1626
  /**
931
1627
  * The top log probability for a token from an OpenAI-compatible chat completion
932
1628
  * response.
933
- *
934
- * :token: The token :bytes: (Optional) The bytes for the token :logprob: The log
935
- * probability of the token
936
1629
  */
937
1630
  interface TopLogprob {
1631
+ /**
1632
+ * The token.
1633
+ */
938
1634
  token: string;
1635
+ /**
1636
+ * The log probability of the token.
1637
+ */
939
1638
  logprob: number;
1639
+ /**
1640
+ * The bytes for the token.
1641
+ */
940
1642
  bytes?: Array<number> | null;
941
1643
  }
942
1644
  }
@@ -946,8 +1648,17 @@ export declare namespace CompletionListResponse {
946
1648
  * A message from the user in an OpenAI-compatible chat completion request.
947
1649
  */
948
1650
  interface OpenAIUserMessageParamOutput {
1651
+ /**
1652
+ * The content of the message, which can include text and other media.
1653
+ */
949
1654
  content: string | Array<OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamOutput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamOutput.OpenAIFile>;
1655
+ /**
1656
+ * The name of the user message participant.
1657
+ */
950
1658
  name?: string | null;
1659
+ /**
1660
+ * Must be 'user' to identify this as a user message.
1661
+ */
951
1662
  role?: 'user';
952
1663
  }
953
1664
  namespace OpenAIUserMessageParamOutput {
@@ -955,7 +1666,13 @@ export declare namespace CompletionListResponse {
955
1666
  * Text content part for OpenAI-compatible chat completion messages.
956
1667
  */
957
1668
  interface OpenAIChatCompletionContentPartTextParam {
1669
+ /**
1670
+ * The text content of the message.
1671
+ */
958
1672
  text: string;
1673
+ /**
1674
+ * Must be 'text' to identify this as text content.
1675
+ */
959
1676
  type?: 'text';
960
1677
  }
961
1678
  /**
@@ -963,28 +1680,55 @@ export declare namespace CompletionListResponse {
963
1680
  */
964
1681
  interface OpenAIChatCompletionContentPartImageParam {
965
1682
  /**
966
- * Image URL specification for OpenAI-compatible chat completion messages.
1683
+ * Image URL specification and processing details.
967
1684
  */
968
1685
  image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
1686
+ /**
1687
+ * Must be 'image_url' to identify this as image content.
1688
+ */
969
1689
  type?: 'image_url';
970
1690
  }
971
1691
  namespace OpenAIChatCompletionContentPartImageParam {
972
1692
  /**
973
- * Image URL specification for OpenAI-compatible chat completion messages.
1693
+ * Image URL specification and processing details.
974
1694
  */
975
1695
  interface ImageURL {
1696
+ /**
1697
+ * URL of the image to include in the message.
1698
+ */
976
1699
  url: string;
977
- detail?: string | null;
1700
+ /**
1701
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
1702
+ */
1703
+ detail?: 'low' | 'high' | 'auto' | null;
978
1704
  }
979
1705
  }
980
1706
  interface OpenAIFile {
1707
+ /**
1708
+ * File specification.
1709
+ */
981
1710
  file: OpenAIFile.File;
1711
+ /**
1712
+ * Must be 'file' to identify this as file content.
1713
+ */
982
1714
  type?: 'file';
983
1715
  }
984
1716
  namespace OpenAIFile {
1717
+ /**
1718
+ * File specification.
1719
+ */
985
1720
  interface File {
1721
+ /**
1722
+ * Base64-encoded file data.
1723
+ */
986
1724
  file_data?: string | null;
1725
+ /**
1726
+ * ID of an uploaded file.
1727
+ */
987
1728
  file_id?: string | null;
1729
+ /**
1730
+ * Name of the file.
1731
+ */
988
1732
  filename?: string | null;
989
1733
  }
990
1734
  }
@@ -993,8 +1737,18 @@ export declare namespace CompletionListResponse {
993
1737
  * A system message providing instructions or context to the model.
994
1738
  */
995
1739
  interface OpenAISystemMessageParam {
1740
+ /**
1741
+ * The content of the 'system prompt'. If multiple system messages are provided,
1742
+ * they are concatenated.
1743
+ */
996
1744
  content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1745
+ /**
1746
+ * The name of the system message participant.
1747
+ */
997
1748
  name?: string | null;
1749
+ /**
1750
+ * Must be 'system' to identify this as a system message.
1751
+ */
998
1752
  role?: 'system';
999
1753
  }
1000
1754
  namespace OpenAISystemMessageParam {
@@ -1002,7 +1756,13 @@ export declare namespace CompletionListResponse {
1002
1756
  * Text content part for OpenAI-compatible chat completion messages.
1003
1757
  */
1004
1758
  interface ListOpenAIChatCompletionContentPartTextParam {
1759
+ /**
1760
+ * The text content of the message.
1761
+ */
1005
1762
  text: string;
1763
+ /**
1764
+ * Must be 'text' to identify this as text content.
1765
+ */
1006
1766
  type?: 'text';
1007
1767
  }
1008
1768
  }
@@ -1011,9 +1771,21 @@ export declare namespace CompletionListResponse {
1011
1771
  * chat completion request.
1012
1772
  */
1013
1773
  interface OpenAIAssistantMessageParamOutput {
1774
+ /**
1775
+ * The content of the model's response.
1776
+ */
1014
1777
  content?: string | Array<OpenAIAssistantMessageParamOutput.ListOpenAIChatCompletionContentPartTextParam> | null;
1778
+ /**
1779
+ * The name of the assistant message participant.
1780
+ */
1015
1781
  name?: string | null;
1782
+ /**
1783
+ * Must be 'assistant' to identify this as the model's response.
1784
+ */
1016
1785
  role?: 'assistant';
1786
+ /**
1787
+ * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
1788
+ */
1017
1789
  tool_calls?: Array<OpenAIAssistantMessageParamOutput.ToolCall> | null;
1018
1790
  }
1019
1791
  namespace OpenAIAssistantMessageParamOutput {
@@ -1021,19 +1793,34 @@ export declare namespace CompletionListResponse {
1021
1793
  * Text content part for OpenAI-compatible chat completion messages.
1022
1794
  */
1023
1795
  interface ListOpenAIChatCompletionContentPartTextParam {
1796
+ /**
1797
+ * The text content of the message.
1798
+ */
1024
1799
  text: string;
1800
+ /**
1801
+ * Must be 'text' to identify this as text content.
1802
+ */
1025
1803
  type?: 'text';
1026
1804
  }
1027
1805
  /**
1028
1806
  * Tool call specification for OpenAI-compatible chat completion responses.
1029
1807
  */
1030
1808
  interface ToolCall {
1809
+ /**
1810
+ * Unique identifier for the tool call.
1811
+ */
1031
1812
  id?: string | null;
1032
1813
  /**
1033
1814
  * Function call details for OpenAI-compatible tool calls.
1034
1815
  */
1035
1816
  function?: ToolCall.Function | null;
1817
+ /**
1818
+ * Index of the tool call in the list.
1819
+ */
1036
1820
  index?: number | null;
1821
+ /**
1822
+ * Must be 'function' to identify this as a function call.
1823
+ */
1037
1824
  type?: 'function';
1038
1825
  }
1039
1826
  namespace ToolCall {
@@ -1041,7 +1828,13 @@ export declare namespace CompletionListResponse {
1041
1828
  * Function call details for OpenAI-compatible tool calls.
1042
1829
  */
1043
1830
  interface Function {
1831
+ /**
1832
+ * Arguments to pass to the function as a JSON string.
1833
+ */
1044
1834
  arguments?: string | null;
1835
+ /**
1836
+ * Name of the function to call.
1837
+ */
1045
1838
  name?: string | null;
1046
1839
  }
1047
1840
  }
@@ -1051,8 +1844,17 @@ export declare namespace CompletionListResponse {
1051
1844
  * chat completion request.
1052
1845
  */
1053
1846
  interface OpenAIToolMessageParam {
1847
+ /**
1848
+ * The response content from the tool.
1849
+ */
1054
1850
  content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1851
+ /**
1852
+ * Unique identifier for the tool call this response is for.
1853
+ */
1055
1854
  tool_call_id: string;
1855
+ /**
1856
+ * Must be 'tool' to identify this as a tool response.
1857
+ */
1056
1858
  role?: 'tool';
1057
1859
  }
1058
1860
  namespace OpenAIToolMessageParam {
@@ -1060,7 +1862,13 @@ export declare namespace CompletionListResponse {
1060
1862
  * Text content part for OpenAI-compatible chat completion messages.
1061
1863
  */
1062
1864
  interface ListOpenAIChatCompletionContentPartTextParam {
1865
+ /**
1866
+ * The text content of the message.
1867
+ */
1063
1868
  text: string;
1869
+ /**
1870
+ * Must be 'text' to identify this as text content.
1871
+ */
1064
1872
  type?: 'text';
1065
1873
  }
1066
1874
  }
@@ -1068,8 +1876,17 @@ export declare namespace CompletionListResponse {
1068
1876
  * A message from the developer in an OpenAI-compatible chat completion request.
1069
1877
  */
1070
1878
  interface OpenAIDeveloperMessageParam {
1879
+ /**
1880
+ * The content of the developer message.
1881
+ */
1071
1882
  content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
1883
+ /**
1884
+ * The name of the developer message participant.
1885
+ */
1072
1886
  name?: string | null;
1887
+ /**
1888
+ * Must be 'developer' to identify this as a developer message.
1889
+ */
1073
1890
  role?: 'developer';
1074
1891
  }
1075
1892
  namespace OpenAIDeveloperMessageParam {
@@ -1077,7 +1894,13 @@ export declare namespace CompletionListResponse {
1077
1894
  * Text content part for OpenAI-compatible chat completion messages.
1078
1895
  */
1079
1896
  interface ListOpenAIChatCompletionContentPartTextParam {
1897
+ /**
1898
+ * The text content of the message.
1899
+ */
1080
1900
  text: string;
1901
+ /**
1902
+ * Must be 'text' to identify this as text content.
1903
+ */
1081
1904
  type?: 'text';
1082
1905
  }
1083
1906
  }
@@ -1085,8 +1908,17 @@ export declare namespace CompletionListResponse {
1085
1908
  * Usage information for OpenAI chat completion.
1086
1909
  */
1087
1910
  interface Usage {
1911
+ /**
1912
+ * Number of tokens in the completion.
1913
+ */
1088
1914
  completion_tokens: number;
1915
+ /**
1916
+ * Number of tokens in the prompt.
1917
+ */
1089
1918
  prompt_tokens: number;
1919
+ /**
1920
+ * Total tokens used (prompt + completion).
1921
+ */
1090
1922
  total_tokens: number;
1091
1923
  /**
1092
1924
  * Token details for output tokens in OpenAI chat completion usage.
@@ -1102,12 +1934,18 @@ export declare namespace CompletionListResponse {
1102
1934
  * Token details for output tokens in OpenAI chat completion usage.
1103
1935
  */
1104
1936
  interface CompletionTokensDetails {
1937
+ /**
1938
+ * Number of tokens used for reasoning (o1/o3 models).
1939
+ */
1105
1940
  reasoning_tokens?: number | null;
1106
1941
  }
1107
1942
  /**
1108
1943
  * Token details for prompt tokens in OpenAI chat completion usage.
1109
1944
  */
1110
1945
  interface PromptTokensDetails {
1946
+ /**
1947
+ * Number of tokens retrieved from cache.
1948
+ */
1111
1949
  cached_tokens?: number | null;
1112
1950
  }
1113
1951
  }
@@ -1115,43 +1953,117 @@ export declare namespace CompletionListResponse {
1115
1953
  }
1116
1954
  export type CompletionCreateParams = CompletionCreateParamsNonStreaming | CompletionCreateParamsStreaming;
1117
1955
  export interface CompletionCreateParamsBase {
1956
+ /**
1957
+ * List of messages in the conversation.
1958
+ */
1118
1959
  messages: Array<CompletionCreateParams.OpenAIUserMessageParamInput | CompletionCreateParams.OpenAISystemMessageParam | CompletionCreateParams.OpenAIAssistantMessageParamInput | CompletionCreateParams.OpenAIToolMessageParam | CompletionCreateParams.OpenAIDeveloperMessageParam>;
1960
+ /**
1961
+ * The identifier of the model to use.
1962
+ */
1119
1963
  model: string;
1964
+ /**
1965
+ * The penalty for repeated tokens.
1966
+ */
1120
1967
  frequency_penalty?: number | null;
1968
+ /**
1969
+ * The function call to use.
1970
+ */
1121
1971
  function_call?: string | {
1122
1972
  [key: string]: unknown;
1123
1973
  } | null;
1974
+ /**
1975
+ * List of functions to use.
1976
+ */
1124
1977
  functions?: Array<{
1125
1978
  [key: string]: unknown;
1126
1979
  }> | null;
1980
+ /**
1981
+ * The logit bias to use.
1982
+ */
1127
1983
  logit_bias?: {
1128
1984
  [key: string]: number;
1129
1985
  } | null;
1986
+ /**
1987
+ * The log probabilities to use.
1988
+ */
1130
1989
  logprobs?: boolean | null;
1990
+ /**
1991
+ * The maximum number of tokens to generate.
1992
+ */
1131
1993
  max_completion_tokens?: number | null;
1994
+ /**
1995
+ * The maximum number of tokens to generate.
1996
+ */
1132
1997
  max_tokens?: number | null;
1998
+ /**
1999
+ * The number of completions to generate.
2000
+ */
1133
2001
  n?: number | null;
2002
+ /**
2003
+ * Whether to parallelize tool calls.
2004
+ */
1134
2005
  parallel_tool_calls?: boolean | null;
2006
+ /**
2007
+ * The penalty for repeated tokens.
2008
+ */
1135
2009
  presence_penalty?: number | null;
1136
2010
  /**
1137
- * Text response format for OpenAI-compatible chat completion requests.
2011
+ * The effort level for reasoning models.
2012
+ */
2013
+ reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
2014
+ /**
2015
+ * The response format to use.
1138
2016
  */
1139
2017
  response_format?: CompletionCreateParams.OpenAIResponseFormatText | CompletionCreateParams.OpenAIResponseFormatJsonSchema | CompletionCreateParams.OpenAIResponseFormatJsonObject | null;
2018
+ /**
2019
+ * A stable identifier used for safety monitoring and abuse detection.
2020
+ */
2021
+ safety_identifier?: string | null;
2022
+ /**
2023
+ * The seed to use.
2024
+ */
1140
2025
  seed?: number | null;
2026
+ /**
2027
+ * The stop tokens to use.
2028
+ */
1141
2029
  stop?: string | Array<string> | null;
2030
+ /**
2031
+ * Whether to stream the response.
2032
+ */
1142
2033
  stream?: boolean | null;
2034
+ /**
2035
+ * The stream options to use.
2036
+ */
1143
2037
  stream_options?: {
1144
2038
  [key: string]: unknown;
1145
2039
  } | null;
2040
+ /**
2041
+ * The temperature to use.
2042
+ */
1146
2043
  temperature?: number | null;
2044
+ /**
2045
+ * The tool choice to use.
2046
+ */
1147
2047
  tool_choice?: string | {
1148
2048
  [key: string]: unknown;
1149
2049
  } | null;
2050
+ /**
2051
+ * The tools to use.
2052
+ */
1150
2053
  tools?: Array<{
1151
2054
  [key: string]: unknown;
1152
2055
  }> | null;
2056
+ /**
2057
+ * The top log probabilities to use.
2058
+ */
1153
2059
  top_logprobs?: number | null;
2060
+ /**
2061
+ * The top p to use.
2062
+ */
1154
2063
  top_p?: number | null;
2064
+ /**
2065
+ * The user to use.
2066
+ */
1155
2067
  user?: string | null;
1156
2068
  [k: string]: unknown;
1157
2069
  }
@@ -1160,8 +2072,17 @@ export declare namespace CompletionCreateParams {
1160
2072
  * A message from the user in an OpenAI-compatible chat completion request.
1161
2073
  */
1162
2074
  interface OpenAIUserMessageParamInput {
2075
+ /**
2076
+ * The content of the message, which can include text and other media.
2077
+ */
1163
2078
  content: string | Array<OpenAIUserMessageParamInput.OpenAIChatCompletionContentPartTextParam | OpenAIUserMessageParamInput.OpenAIChatCompletionContentPartImageParam | OpenAIUserMessageParamInput.OpenAIFile>;
2079
+ /**
2080
+ * The name of the user message participant.
2081
+ */
1164
2082
  name?: string | null;
2083
+ /**
2084
+ * Must be 'user' to identify this as a user message.
2085
+ */
1165
2086
  role?: 'user';
1166
2087
  }
1167
2088
  namespace OpenAIUserMessageParamInput {
@@ -1169,7 +2090,13 @@ export declare namespace CompletionCreateParams {
1169
2090
  * Text content part for OpenAI-compatible chat completion messages.
1170
2091
  */
1171
2092
  interface OpenAIChatCompletionContentPartTextParam {
2093
+ /**
2094
+ * The text content of the message.
2095
+ */
1172
2096
  text: string;
2097
+ /**
2098
+ * Must be 'text' to identify this as text content.
2099
+ */
1173
2100
  type?: 'text';
1174
2101
  }
1175
2102
  /**
@@ -1177,28 +2104,55 @@ export declare namespace CompletionCreateParams {
1177
2104
  */
1178
2105
  interface OpenAIChatCompletionContentPartImageParam {
1179
2106
  /**
1180
- * Image URL specification for OpenAI-compatible chat completion messages.
2107
+ * Image URL specification and processing details.
1181
2108
  */
1182
2109
  image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
2110
+ /**
2111
+ * Must be 'image_url' to identify this as image content.
2112
+ */
1183
2113
  type?: 'image_url';
1184
2114
  }
1185
2115
  namespace OpenAIChatCompletionContentPartImageParam {
1186
2116
  /**
1187
- * Image URL specification for OpenAI-compatible chat completion messages.
2117
+ * Image URL specification and processing details.
1188
2118
  */
1189
2119
  interface ImageURL {
2120
+ /**
2121
+ * URL of the image to include in the message.
2122
+ */
1190
2123
  url: string;
1191
- detail?: string | null;
2124
+ /**
2125
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
2126
+ */
2127
+ detail?: 'low' | 'high' | 'auto' | null;
1192
2128
  }
1193
2129
  }
1194
2130
  interface OpenAIFile {
2131
+ /**
2132
+ * File specification.
2133
+ */
1195
2134
  file: OpenAIFile.File;
2135
+ /**
2136
+ * Must be 'file' to identify this as file content.
2137
+ */
1196
2138
  type?: 'file';
1197
2139
  }
1198
2140
  namespace OpenAIFile {
2141
+ /**
2142
+ * File specification.
2143
+ */
1199
2144
  interface File {
2145
+ /**
2146
+ * Base64-encoded file data.
2147
+ */
1200
2148
  file_data?: string | null;
2149
+ /**
2150
+ * ID of an uploaded file.
2151
+ */
1201
2152
  file_id?: string | null;
2153
+ /**
2154
+ * Name of the file.
2155
+ */
1202
2156
  filename?: string | null;
1203
2157
  }
1204
2158
  }
@@ -1207,8 +2161,18 @@ export declare namespace CompletionCreateParams {
1207
2161
  * A system message providing instructions or context to the model.
1208
2162
  */
1209
2163
  interface OpenAISystemMessageParam {
2164
+ /**
2165
+ * The content of the 'system prompt'. If multiple system messages are provided,
2166
+ * they are concatenated.
2167
+ */
1210
2168
  content: string | Array<OpenAISystemMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
2169
+ /**
2170
+ * The name of the system message participant.
2171
+ */
1211
2172
  name?: string | null;
2173
+ /**
2174
+ * Must be 'system' to identify this as a system message.
2175
+ */
1212
2176
  role?: 'system';
1213
2177
  }
1214
2178
  namespace OpenAISystemMessageParam {
@@ -1216,7 +2180,13 @@ export declare namespace CompletionCreateParams {
1216
2180
  * Text content part for OpenAI-compatible chat completion messages.
1217
2181
  */
1218
2182
  interface ListOpenAIChatCompletionContentPartTextParam {
2183
+ /**
2184
+ * The text content of the message.
2185
+ */
1219
2186
  text: string;
2187
+ /**
2188
+ * Must be 'text' to identify this as text content.
2189
+ */
1220
2190
  type?: 'text';
1221
2191
  }
1222
2192
  }
@@ -1225,9 +2195,21 @@ export declare namespace CompletionCreateParams {
1225
2195
  * chat completion request.
1226
2196
  */
1227
2197
  interface OpenAIAssistantMessageParamInput {
2198
+ /**
2199
+ * The content of the model's response.
2200
+ */
1228
2201
  content?: string | Array<OpenAIAssistantMessageParamInput.ListOpenAIChatCompletionContentPartTextParam> | null;
2202
+ /**
2203
+ * The name of the assistant message participant.
2204
+ */
1229
2205
  name?: string | null;
2206
+ /**
2207
+ * Must be 'assistant' to identify this as the model's response.
2208
+ */
1230
2209
  role?: 'assistant';
2210
+ /**
2211
+ * List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
2212
+ */
1231
2213
  tool_calls?: Array<OpenAIAssistantMessageParamInput.ToolCall> | null;
1232
2214
  }
1233
2215
  namespace OpenAIAssistantMessageParamInput {
@@ -1235,19 +2217,34 @@ export declare namespace CompletionCreateParams {
1235
2217
  * Text content part for OpenAI-compatible chat completion messages.
1236
2218
  */
1237
2219
  interface ListOpenAIChatCompletionContentPartTextParam {
2220
+ /**
2221
+ * The text content of the message.
2222
+ */
1238
2223
  text: string;
2224
+ /**
2225
+ * Must be 'text' to identify this as text content.
2226
+ */
1239
2227
  type?: 'text';
1240
2228
  }
1241
2229
  /**
1242
2230
  * Tool call specification for OpenAI-compatible chat completion responses.
1243
2231
  */
1244
2232
  interface ToolCall {
2233
+ /**
2234
+ * Unique identifier for the tool call.
2235
+ */
1245
2236
  id?: string | null;
1246
2237
  /**
1247
2238
  * Function call details for OpenAI-compatible tool calls.
1248
2239
  */
1249
2240
  function?: ToolCall.Function | null;
2241
+ /**
2242
+ * Index of the tool call in the list.
2243
+ */
1250
2244
  index?: number | null;
2245
+ /**
2246
+ * Must be 'function' to identify this as a function call.
2247
+ */
1251
2248
  type?: 'function';
1252
2249
  }
1253
2250
  namespace ToolCall {
@@ -1255,7 +2252,13 @@ export declare namespace CompletionCreateParams {
1255
2252
  * Function call details for OpenAI-compatible tool calls.
1256
2253
  */
1257
2254
  interface Function {
2255
+ /**
2256
+ * Arguments to pass to the function as a JSON string.
2257
+ */
1258
2258
  arguments?: string | null;
2259
+ /**
2260
+ * Name of the function to call.
2261
+ */
1259
2262
  name?: string | null;
1260
2263
  }
1261
2264
  }
@@ -1265,8 +2268,17 @@ export declare namespace CompletionCreateParams {
1265
2268
  * chat completion request.
1266
2269
  */
1267
2270
  interface OpenAIToolMessageParam {
2271
+ /**
2272
+ * The response content from the tool.
2273
+ */
1268
2274
  content: string | Array<OpenAIToolMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
2275
+ /**
2276
+ * Unique identifier for the tool call this response is for.
2277
+ */
1269
2278
  tool_call_id: string;
2279
+ /**
2280
+ * Must be 'tool' to identify this as a tool response.
2281
+ */
1270
2282
  role?: 'tool';
1271
2283
  }
1272
2284
  namespace OpenAIToolMessageParam {
@@ -1274,7 +2286,13 @@ export declare namespace CompletionCreateParams {
1274
2286
  * Text content part for OpenAI-compatible chat completion messages.
1275
2287
  */
1276
2288
  interface ListOpenAIChatCompletionContentPartTextParam {
2289
+ /**
2290
+ * The text content of the message.
2291
+ */
1277
2292
  text: string;
2293
+ /**
2294
+ * Must be 'text' to identify this as text content.
2295
+ */
1278
2296
  type?: 'text';
1279
2297
  }
1280
2298
  }
@@ -1282,8 +2300,17 @@ export declare namespace CompletionCreateParams {
1282
2300
  * A message from the developer in an OpenAI-compatible chat completion request.
1283
2301
  */
1284
2302
  interface OpenAIDeveloperMessageParam {
2303
+ /**
2304
+ * The content of the developer message.
2305
+ */
1285
2306
  content: string | Array<OpenAIDeveloperMessageParam.ListOpenAIChatCompletionContentPartTextParam>;
2307
+ /**
2308
+ * The name of the developer message participant.
2309
+ */
1286
2310
  name?: string | null;
2311
+ /**
2312
+ * Must be 'developer' to identify this as a developer message.
2313
+ */
1287
2314
  role?: 'developer';
1288
2315
  }
1289
2316
  namespace OpenAIDeveloperMessageParam {
@@ -1291,7 +2318,13 @@ export declare namespace CompletionCreateParams {
1291
2318
  * Text content part for OpenAI-compatible chat completion messages.
1292
2319
  */
1293
2320
  interface ListOpenAIChatCompletionContentPartTextParam {
2321
+ /**
2322
+ * The text content of the message.
2323
+ */
1294
2324
  text: string;
2325
+ /**
2326
+ * Must be 'text' to identify this as text content.
2327
+ */
1295
2328
  type?: 'text';
1296
2329
  }
1297
2330
  }
@@ -1299,6 +2332,9 @@ export declare namespace CompletionCreateParams {
1299
2332
  * Text response format for OpenAI-compatible chat completion requests.
1300
2333
  */
1301
2334
  interface OpenAIResponseFormatText {
2335
+ /**
2336
+ * Must be 'text' to indicate plain text response format.
2337
+ */
1302
2338
  type?: 'text';
1303
2339
  }
1304
2340
  /**
@@ -1306,14 +2342,17 @@ export declare namespace CompletionCreateParams {
1306
2342
  */
1307
2343
  interface OpenAIResponseFormatJsonSchema {
1308
2344
  /**
1309
- * JSON schema specification for OpenAI-compatible structured response format.
2345
+ * The JSON schema specification for the response.
1310
2346
  */
1311
2347
  json_schema: OpenAIResponseFormatJsonSchema.JsonSchema;
2348
+ /**
2349
+ * Must be 'json_schema' to indicate structured JSON response format.
2350
+ */
1312
2351
  type?: 'json_schema';
1313
2352
  }
1314
2353
  namespace OpenAIResponseFormatJsonSchema {
1315
2354
  /**
1316
- * JSON schema specification for OpenAI-compatible structured response format.
2355
+ * The JSON schema specification for the response.
1317
2356
  */
1318
2357
  interface JsonSchema {
1319
2358
  description?: string | null;
@@ -1328,22 +2367,40 @@ export declare namespace CompletionCreateParams {
1328
2367
  * JSON object response format for OpenAI-compatible chat completion requests.
1329
2368
  */
1330
2369
  interface OpenAIResponseFormatJsonObject {
2370
+ /**
2371
+ * Must be 'json_object' to indicate generic JSON object response format.
2372
+ */
1331
2373
  type?: 'json_object';
1332
2374
  }
1333
2375
  type CompletionCreateParamsNonStreaming = CompletionsAPI.CompletionCreateParamsNonStreaming;
1334
2376
  type CompletionCreateParamsStreaming = CompletionsAPI.CompletionCreateParamsStreaming;
1335
2377
  }
1336
2378
  export interface CompletionCreateParamsNonStreaming extends CompletionCreateParamsBase {
2379
+ /**
2380
+ * Whether to stream the response.
2381
+ */
1337
2382
  stream?: false | null;
1338
2383
  [k: string]: unknown;
1339
2384
  }
1340
2385
  export interface CompletionCreateParamsStreaming extends CompletionCreateParamsBase {
2386
+ /**
2387
+ * Whether to stream the response.
2388
+ */
1341
2389
  stream: true;
1342
2390
  [k: string]: unknown;
1343
2391
  }
1344
2392
  export interface CompletionListParams {
2393
+ /**
2394
+ * The ID of the last chat completion to return.
2395
+ */
1345
2396
  after?: string | null;
2397
+ /**
2398
+ * The maximum number of chat completions to return.
2399
+ */
1346
2400
  limit?: number | null;
2401
+ /**
2402
+ * The model to filter by.
2403
+ */
1347
2404
  model?: string | null;
1348
2405
  /**
1349
2406
  * Sort order for paginated responses.