@orq-ai/node 3.11.7 → 3.11.9

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 (160) hide show
  1. package/bin/mcp-server.js +104 -104
  2. package/bin/mcp-server.js.map +26 -26
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  7. package/lib/config.js.map +1 -1
  8. package/mcp-server/mcp-server.js +1 -1
  9. package/mcp-server/server.js +1 -1
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/createdataset.js +2 -2
  12. package/models/operations/createdatasetitem.js +2 -2
  13. package/models/operations/createdatasource.js +2 -2
  14. package/models/operations/createeval.js +16 -16
  15. package/models/operations/fileget.js +2 -2
  16. package/models/operations/filelist.js +2 -2
  17. package/models/operations/fileupload.js +2 -2
  18. package/models/operations/getevals.js +28 -28
  19. package/models/operations/listcontacts.js +2 -2
  20. package/models/operations/listdatasetdatapoints.js +2 -2
  21. package/models/operations/listdatasets.js +2 -2
  22. package/models/operations/listdatasources.js +2 -2
  23. package/models/operations/retrievecontact.js +2 -2
  24. package/models/operations/retrievedatapoint.js +2 -2
  25. package/models/operations/retrievedataset.js +2 -2
  26. package/models/operations/retrievedatasource.js +2 -2
  27. package/models/operations/updatecontact.js +2 -2
  28. package/models/operations/updatedatapoint.js +2 -2
  29. package/models/operations/updatedataset.js +2 -2
  30. package/models/operations/updatedatasource.js +2 -2
  31. package/models/operations/updateeval.js +16 -16
  32. package/package.json +1 -1
  33. package/packages/orq-rc/README.md +128 -87
  34. package/packages/orq-rc/docs/sdks/batches/README.md +307 -0
  35. package/packages/orq-rc/docs/sdks/knowledge/README.md +1 -1
  36. package/packages/orq-rc/docs/sdks/proxy/README.md +1284 -0
  37. package/packages/orq-rc/examples/package-lock.json +1 -1
  38. package/packages/orq-rc/jsr.json +1 -1
  39. package/packages/orq-rc/package-lock.json +2 -2
  40. package/packages/orq-rc/package.json +1 -1
  41. package/packages/orq-rc/src/funcs/batchesCancel.ts +166 -0
  42. package/packages/orq-rc/src/funcs/batchesCreate.ts +160 -0
  43. package/packages/orq-rc/src/funcs/batchesList.ts +165 -0
  44. package/packages/orq-rc/src/funcs/batchesRetrieve.ts +166 -0
  45. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +1 -1
  46. package/packages/orq-rc/src/funcs/proxyAudioSpeech.ts +159 -0
  47. package/packages/orq-rc/src/funcs/proxyAudioTranscriptions.ts +233 -0
  48. package/packages/orq-rc/src/funcs/proxyAudioTranslations.ts +223 -0
  49. package/packages/orq-rc/src/funcs/proxyChatCompletions.ts +172 -0
  50. package/packages/orq-rc/src/funcs/proxyCompletions.ts +168 -0
  51. package/packages/orq-rc/src/funcs/proxyEmbeddings.ts +161 -0
  52. package/packages/orq-rc/src/funcs/proxyImagesEdit.ts +173 -0
  53. package/packages/orq-rc/src/funcs/proxyImagesGenerate.ts +163 -0
  54. package/packages/orq-rc/src/funcs/proxyImagesVariation.ts +179 -0
  55. package/packages/orq-rc/src/funcs/proxyModerations.ts +164 -0
  56. package/packages/orq-rc/src/funcs/proxyRerank.ts +158 -0
  57. package/packages/orq-rc/src/funcs/proxyResponsesCreate.ts +171 -0
  58. package/packages/orq-rc/src/lib/config.ts +3 -3
  59. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  60. package/packages/orq-rc/src/mcp-server/server.ts +33 -1
  61. package/packages/orq-rc/src/mcp-server/tools/batchesCancel.ts +37 -0
  62. package/packages/orq-rc/src/mcp-server/tools/batchesCreate.ts +37 -0
  63. package/packages/orq-rc/src/mcp-server/tools/batchesList.ts +37 -0
  64. package/packages/orq-rc/src/mcp-server/tools/batchesRetrieve.ts +37 -0
  65. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +1 -1
  66. package/packages/orq-rc/src/mcp-server/tools/proxyAudioSpeech.ts +33 -0
  67. package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranscriptions.ts +35 -0
  68. package/packages/orq-rc/src/mcp-server/tools/proxyAudioTranslations.ts +35 -0
  69. package/packages/orq-rc/src/mcp-server/tools/proxyChatCompletions.ts +37 -0
  70. package/packages/orq-rc/src/mcp-server/tools/proxyCompletions.ts +37 -0
  71. package/packages/orq-rc/src/mcp-server/tools/proxyEmbeddings.ts +37 -0
  72. package/packages/orq-rc/src/mcp-server/tools/proxyImagesEdit.ts +35 -0
  73. package/packages/orq-rc/src/mcp-server/tools/proxyImagesGenerate.ts +35 -0
  74. package/packages/orq-rc/src/mcp-server/tools/proxyImagesVariation.ts +35 -0
  75. package/packages/orq-rc/src/mcp-server/tools/proxyModerations.ts +35 -0
  76. package/packages/orq-rc/src/mcp-server/tools/proxyRerank.ts +36 -0
  77. package/packages/orq-rc/src/mcp-server/tools/proxyResponsesCreate.ts +37 -0
  78. package/packages/orq-rc/src/models/components/deployments.ts +861 -0
  79. package/packages/orq-rc/src/models/components/index.ts +1 -0
  80. package/packages/orq-rc/src/models/components/publiccontact.ts +114 -0
  81. package/packages/orq-rc/src/models/errors/index.ts +3 -0
  82. package/packages/orq-rc/src/models/errors/postv2proxyaudiotranscriptions.ts +163 -0
  83. package/packages/orq-rc/src/models/errors/postv2proxyaudiotranslations.ts +162 -0
  84. package/packages/orq-rc/src/models/errors/postv2proxymoderations.ts +151 -0
  85. package/packages/orq-rc/src/models/operations/cancelbatch.ts +474 -0
  86. package/packages/orq-rc/src/models/operations/createbatch.ts +531 -0
  87. package/packages/orq-rc/src/models/operations/createbudget.ts +2 -2
  88. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +11697 -0
  89. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  90. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  91. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2205 -1224
  92. package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
  93. package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
  94. package/packages/orq-rc/src/models/operations/createresponse.ts +6908 -0
  95. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2282 -1214
  96. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +938 -51
  97. package/packages/orq-rc/src/models/operations/deploymentstream.ts +1471 -305
  98. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  99. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  101. package/packages/orq-rc/src/models/operations/getbudget.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/getevals.ts +107 -92
  103. package/packages/orq-rc/src/models/operations/index.ts +16 -0
  104. package/packages/orq-rc/src/models/operations/listbatches.ts +570 -0
  105. package/packages/orq-rc/src/models/operations/listbudgets.ts +2 -2
  106. package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
  107. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +498 -2
  108. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  109. package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
  110. package/packages/orq-rc/src/models/operations/postv2proxyaudiospeech.ts +393 -0
  111. package/packages/orq-rc/src/models/operations/postv2proxyaudiotranscriptions.ts +731 -0
  112. package/packages/orq-rc/src/models/operations/postv2proxyaudiotranslations.ts +741 -0
  113. package/packages/orq-rc/src/models/operations/postv2proxycompletions.ts +5831 -0
  114. package/packages/orq-rc/src/models/operations/postv2proxyembeddings.ts +878 -0
  115. package/packages/orq-rc/src/models/operations/postv2proxyimagesedits.ts +596 -0
  116. package/packages/orq-rc/src/models/operations/postv2proxyimagesgenerations.ts +1107 -0
  117. package/packages/orq-rc/src/models/operations/postv2proxyimagesvariations.ts +592 -0
  118. package/packages/orq-rc/src/models/operations/postv2proxymoderations.ts +802 -0
  119. package/packages/orq-rc/src/models/operations/postv2proxyrerank.ts +526 -0
  120. package/packages/orq-rc/src/models/operations/retrievebatch.ts +474 -0
  121. package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
  122. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +478 -2
  123. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  124. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
  125. package/packages/orq-rc/src/models/operations/updatebudget.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
  127. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +974 -2
  128. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  129. package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
  130. package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
  131. package/packages/orq-rc/src/sdk/batches.ts +81 -0
  132. package/packages/orq-rc/src/sdk/knowledge.ts +1 -1
  133. package/packages/orq-rc/src/sdk/proxy.ts +211 -0
  134. package/packages/orq-rc/src/sdk/sdk.ts +12 -0
  135. package/packages/orq-rc/temp/example.ts +5 -0
  136. package/src/lib/config.ts +3 -3
  137. package/src/mcp-server/mcp-server.ts +1 -1
  138. package/src/mcp-server/server.ts +1 -1
  139. package/src/models/operations/createcontact.ts +2 -2
  140. package/src/models/operations/createdataset.ts +2 -2
  141. package/src/models/operations/createdatasetitem.ts +2 -2
  142. package/src/models/operations/createdatasource.ts +2 -2
  143. package/src/models/operations/createeval.ts +16 -16
  144. package/src/models/operations/fileget.ts +2 -2
  145. package/src/models/operations/filelist.ts +2 -2
  146. package/src/models/operations/fileupload.ts +2 -2
  147. package/src/models/operations/getevals.ts +28 -28
  148. package/src/models/operations/listcontacts.ts +2 -2
  149. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  150. package/src/models/operations/listdatasets.ts +2 -2
  151. package/src/models/operations/listdatasources.ts +2 -2
  152. package/src/models/operations/retrievecontact.ts +2 -2
  153. package/src/models/operations/retrievedatapoint.ts +2 -2
  154. package/src/models/operations/retrievedataset.ts +2 -2
  155. package/src/models/operations/retrievedatasource.ts +2 -2
  156. package/src/models/operations/updatecontact.ts +2 -2
  157. package/src/models/operations/updatedatapoint.ts +2 -2
  158. package/src/models/operations/updatedataset.ts +2 -2
  159. package/src/models/operations/updatedatasource.ts +2 -2
  160. package/src/models/operations/updateeval.ts +16 -16
@@ -0,0 +1,1284 @@
1
+ # Proxy
2
+ (*proxy*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [chatCompletions](#chatcompletions) - Create chat completion
9
+ * [moderations](#moderations)
10
+ * [embeddings](#embeddings) - Create embeddings
11
+ * [rerank](#rerank) - Rerank a list of documents based on their relevance to a query.
12
+ * [audioSpeech](#audiospeech) - Generates audio from the input text.
13
+ * [completions](#completions) - Create a completion
14
+ * [imagesGenerate](#imagesgenerate) - Create an Image
15
+ * [imagesEdit](#imagesedit) - Edit an Image
16
+ * [imagesVariation](#imagesvariation) - Create an Image Variation
17
+ * [audioTranscriptions](#audiotranscriptions)
18
+ * [audioTranslations](#audiotranslations)
19
+ * [responsesCreate](#responsescreate) - Create response
20
+
21
+ ## chatCompletions
22
+
23
+ Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.
24
+
25
+ ### Example Usage
26
+
27
+ <!-- UsageSnippet language="typescript" operationID="CreateChatCompletion" method="post" path="/v2/proxy/chat/completions" -->
28
+ ```typescript
29
+ import { Orq } from "@orq-ai/node";
30
+
31
+ const orq = new Orq({
32
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
33
+ });
34
+
35
+ async function run() {
36
+ const result = await orq.proxy.chatCompletions({
37
+ messages: [
38
+ {
39
+ role: "assistant",
40
+ },
41
+ ],
42
+ model: "Camaro",
43
+ orq: {
44
+ retry: {
45
+ onCodes: [
46
+ 429,
47
+ 500,
48
+ 502,
49
+ ],
50
+ },
51
+ fallbacks: [
52
+ {
53
+ model: "openai/gpt-5",
54
+ },
55
+ {
56
+ model: "anthropic/claude-4-opus",
57
+ },
58
+ ],
59
+ contact: {
60
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
61
+ displayName: "Jane Doe",
62
+ email: "jane.doe@example.com",
63
+ },
64
+ thread: {
65
+ id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
66
+ tags: [
67
+ "customer-support",
68
+ ],
69
+ },
70
+ inputs: {
71
+ "customer_name": "John Smith",
72
+ "issue_type": "billing",
73
+ },
74
+ cache: {
75
+ ttl: 3600,
76
+ type: "exact_match",
77
+ },
78
+ knowledgeBases: [
79
+ {
80
+ topK: 5,
81
+ knowledgeId: "knowledge_01ARZ3NDEKTSV4RRFFQ69G5FAV",
82
+ },
83
+ ],
84
+ },
85
+ });
86
+
87
+ for await (const event of result) {
88
+ // Handle the event
89
+ console.log(event);
90
+ }
91
+ }
92
+
93
+ run();
94
+ ```
95
+
96
+ ### Standalone function
97
+
98
+ The standalone function version of this method:
99
+
100
+ ```typescript
101
+ import { OrqCore } from "@orq-ai/node/core.js";
102
+ import { proxyChatCompletions } from "@orq-ai/node/funcs/proxyChatCompletions.js";
103
+
104
+ // Use `OrqCore` for best tree-shaking performance.
105
+ // You can create one instance of it to use across an application.
106
+ const orq = new OrqCore({
107
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
108
+ });
109
+
110
+ async function run() {
111
+ const res = await proxyChatCompletions(orq, {
112
+ messages: [
113
+ {
114
+ role: "assistant",
115
+ },
116
+ ],
117
+ model: "Camaro",
118
+ orq: {
119
+ retry: {
120
+ onCodes: [
121
+ 429,
122
+ 500,
123
+ 502,
124
+ ],
125
+ },
126
+ fallbacks: [
127
+ {
128
+ model: "openai/gpt-5",
129
+ },
130
+ {
131
+ model: "anthropic/claude-4-opus",
132
+ },
133
+ ],
134
+ contact: {
135
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
136
+ displayName: "Jane Doe",
137
+ email: "jane.doe@example.com",
138
+ },
139
+ thread: {
140
+ id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
141
+ tags: [
142
+ "customer-support",
143
+ ],
144
+ },
145
+ inputs: {
146
+ "customer_name": "John Smith",
147
+ "issue_type": "billing",
148
+ },
149
+ cache: {
150
+ ttl: 3600,
151
+ type: "exact_match",
152
+ },
153
+ knowledgeBases: [
154
+ {
155
+ topK: 5,
156
+ knowledgeId: "knowledge_01ARZ3NDEKTSV4RRFFQ69G5FAV",
157
+ },
158
+ ],
159
+ },
160
+ });
161
+ if (res.ok) {
162
+ const { value: result } = res;
163
+ for await (const event of result) {
164
+ // Handle the event
165
+ console.log(event);
166
+ }
167
+ } else {
168
+ console.log("proxyChatCompletions failed:", res.error);
169
+ }
170
+ }
171
+
172
+ run();
173
+ ```
174
+
175
+ ### Parameters
176
+
177
+ | Parameter | Type | Required | Description |
178
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
179
+ | `request` | [operations.CreateChatCompletionRequestBody](../../models/operations/createchatcompletionrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
180
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
181
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
182
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
183
+
184
+ ### Response
185
+
186
+ **Promise\<[operations.CreateChatCompletionResponse](../../models/operations/createchatcompletionresponse.md)\>**
187
+
188
+ ### Errors
189
+
190
+ | Error Type | Status Code | Content Type |
191
+ | --------------- | --------------- | --------------- |
192
+ | errors.APIError | 4XX, 5XX | \*/\* |
193
+
194
+ ## moderations
195
+
196
+ ### Example Usage
197
+
198
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/moderations" method="post" path="/v2/proxy/moderations" -->
199
+ ```typescript
200
+ import { Orq } from "@orq-ai/node";
201
+
202
+ const orq = new Orq({
203
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
204
+ });
205
+
206
+ async function run() {
207
+ const result = await orq.proxy.moderations({
208
+ input: "<value>",
209
+ });
210
+
211
+ console.log(result);
212
+ }
213
+
214
+ run();
215
+ ```
216
+
217
+ ### Standalone function
218
+
219
+ The standalone function version of this method:
220
+
221
+ ```typescript
222
+ import { OrqCore } from "@orq-ai/node/core.js";
223
+ import { proxyModerations } from "@orq-ai/node/funcs/proxyModerations.js";
224
+
225
+ // Use `OrqCore` for best tree-shaking performance.
226
+ // You can create one instance of it to use across an application.
227
+ const orq = new OrqCore({
228
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
229
+ });
230
+
231
+ async function run() {
232
+ const res = await proxyModerations(orq, {
233
+ input: "<value>",
234
+ });
235
+ if (res.ok) {
236
+ const { value: result } = res;
237
+ console.log(result);
238
+ } else {
239
+ console.log("proxyModerations failed:", res.error);
240
+ }
241
+ }
242
+
243
+ run();
244
+ ```
245
+
246
+ ### Parameters
247
+
248
+ | Parameter | Type | Required | Description |
249
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
250
+ | `request` | [operations.PostV2ProxyModerationsRequestBody](../../models/operations/postv2proxymoderationsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
251
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
252
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
253
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
254
+
255
+ ### Response
256
+
257
+ **Promise\<[operations.PostV2ProxyModerationsResponseBody](../../models/operations/postv2proxymoderationsresponsebody.md)\>**
258
+
259
+ ### Errors
260
+
261
+ | Error Type | Status Code | Content Type |
262
+ | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
263
+ | errors.PostV2ProxyModerationsResponseBody | 422 | application/json |
264
+ | errors.APIError | 4XX, 5XX | \*/\* |
265
+
266
+ ## embeddings
267
+
268
+ Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
269
+
270
+ ### Example Usage
271
+
272
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/embeddings" method="post" path="/v2/proxy/embeddings" -->
273
+ ```typescript
274
+ import { Orq } from "@orq-ai/node";
275
+
276
+ const orq = new Orq({
277
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
278
+ });
279
+
280
+ async function run() {
281
+ const result = await orq.proxy.embeddings({
282
+ input: "<value>",
283
+ model: "Golf",
284
+ orq: {
285
+ fallbacks: [
286
+ {
287
+ model: "openai/gpt-4o-mini",
288
+ },
289
+ ],
290
+ cache: {
291
+ ttl: 3600,
292
+ type: "exact_match",
293
+ },
294
+ retry: {
295
+ onCodes: [
296
+ 429,
297
+ 500,
298
+ 502,
299
+ 503,
300
+ 504,
301
+ ],
302
+ },
303
+ contact: {
304
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
305
+ displayName: "Jane Doe",
306
+ email: "jane.doe@example.com",
307
+ metadata: [
308
+ {
309
+ "department": "Engineering",
310
+ "role": "Senior Developer",
311
+ },
312
+ ],
313
+ logoUrl: "https://example.com/avatars/jane-doe.jpg",
314
+ tags: [
315
+ "hr",
316
+ "engineering",
317
+ ],
318
+ },
319
+ },
320
+ });
321
+
322
+ console.log(result);
323
+ }
324
+
325
+ run();
326
+ ```
327
+
328
+ ### Standalone function
329
+
330
+ The standalone function version of this method:
331
+
332
+ ```typescript
333
+ import { OrqCore } from "@orq-ai/node/core.js";
334
+ import { proxyEmbeddings } from "@orq-ai/node/funcs/proxyEmbeddings.js";
335
+
336
+ // Use `OrqCore` for best tree-shaking performance.
337
+ // You can create one instance of it to use across an application.
338
+ const orq = new OrqCore({
339
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
340
+ });
341
+
342
+ async function run() {
343
+ const res = await proxyEmbeddings(orq, {
344
+ input: "<value>",
345
+ model: "Golf",
346
+ orq: {
347
+ fallbacks: [
348
+ {
349
+ model: "openai/gpt-4o-mini",
350
+ },
351
+ ],
352
+ cache: {
353
+ ttl: 3600,
354
+ type: "exact_match",
355
+ },
356
+ retry: {
357
+ onCodes: [
358
+ 429,
359
+ 500,
360
+ 502,
361
+ 503,
362
+ 504,
363
+ ],
364
+ },
365
+ contact: {
366
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
367
+ displayName: "Jane Doe",
368
+ email: "jane.doe@example.com",
369
+ metadata: [
370
+ {
371
+ "department": "Engineering",
372
+ "role": "Senior Developer",
373
+ },
374
+ ],
375
+ logoUrl: "https://example.com/avatars/jane-doe.jpg",
376
+ tags: [
377
+ "hr",
378
+ "engineering",
379
+ ],
380
+ },
381
+ },
382
+ });
383
+ if (res.ok) {
384
+ const { value: result } = res;
385
+ console.log(result);
386
+ } else {
387
+ console.log("proxyEmbeddings failed:", res.error);
388
+ }
389
+ }
390
+
391
+ run();
392
+ ```
393
+
394
+ ### Parameters
395
+
396
+ | Parameter | Type | Required | Description |
397
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
398
+ | `request` | [operations.PostV2ProxyEmbeddingsRequestBody](../../models/operations/postv2proxyembeddingsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
399
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
400
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
401
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
402
+
403
+ ### Response
404
+
405
+ **Promise\<[operations.PostV2ProxyEmbeddingsResponseBody](../../models/operations/postv2proxyembeddingsresponsebody.md)\>**
406
+
407
+ ### Errors
408
+
409
+ | Error Type | Status Code | Content Type |
410
+ | --------------- | --------------- | --------------- |
411
+ | errors.APIError | 4XX, 5XX | \*/\* |
412
+
413
+ ## rerank
414
+
415
+ Rerank a list of documents based on their relevance to a query.
416
+
417
+ ### Example Usage
418
+
419
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/rerank" method="post" path="/v2/proxy/rerank" -->
420
+ ```typescript
421
+ import { Orq } from "@orq-ai/node";
422
+
423
+ const orq = new Orq({
424
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
425
+ });
426
+
427
+ async function run() {
428
+ const result = await orq.proxy.rerank({
429
+ query: "<value>",
430
+ documents: [],
431
+ model: "Prius",
432
+ });
433
+
434
+ console.log(result);
435
+ }
436
+
437
+ run();
438
+ ```
439
+
440
+ ### Standalone function
441
+
442
+ The standalone function version of this method:
443
+
444
+ ```typescript
445
+ import { OrqCore } from "@orq-ai/node/core.js";
446
+ import { proxyRerank } from "@orq-ai/node/funcs/proxyRerank.js";
447
+
448
+ // Use `OrqCore` for best tree-shaking performance.
449
+ // You can create one instance of it to use across an application.
450
+ const orq = new OrqCore({
451
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
452
+ });
453
+
454
+ async function run() {
455
+ const res = await proxyRerank(orq, {
456
+ query: "<value>",
457
+ documents: [],
458
+ model: "Prius",
459
+ });
460
+ if (res.ok) {
461
+ const { value: result } = res;
462
+ console.log(result);
463
+ } else {
464
+ console.log("proxyRerank failed:", res.error);
465
+ }
466
+ }
467
+
468
+ run();
469
+ ```
470
+
471
+ ### Parameters
472
+
473
+ | Parameter | Type | Required | Description |
474
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
475
+ | `request` | [operations.PostV2ProxyRerankRequestBody](../../models/operations/postv2proxyrerankrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
476
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
477
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
478
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
479
+
480
+ ### Response
481
+
482
+ **Promise\<[operations.PostV2ProxyRerankResponseBody](../../models/operations/postv2proxyrerankresponsebody.md)\>**
483
+
484
+ ### Errors
485
+
486
+ | Error Type | Status Code | Content Type |
487
+ | --------------- | --------------- | --------------- |
488
+ | errors.APIError | 4XX, 5XX | \*/\* |
489
+
490
+ ## audioSpeech
491
+
492
+ Generates audio from the input text.
493
+
494
+ ### Example Usage
495
+
496
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/audio/speech" method="post" path="/v2/proxy/audio/speech" -->
497
+ ```typescript
498
+ import { Orq } from "@orq-ai/node";
499
+
500
+ const orq = new Orq({
501
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
502
+ });
503
+
504
+ async function run() {
505
+ await orq.proxy.audioSpeech({
506
+ input: "<value>",
507
+ model: "openai/tts-1-hd",
508
+ voice: "<value>",
509
+ });
510
+
511
+
512
+ }
513
+
514
+ run();
515
+ ```
516
+
517
+ ### Standalone function
518
+
519
+ The standalone function version of this method:
520
+
521
+ ```typescript
522
+ import { OrqCore } from "@orq-ai/node/core.js";
523
+ import { proxyAudioSpeech } from "@orq-ai/node/funcs/proxyAudioSpeech.js";
524
+
525
+ // Use `OrqCore` for best tree-shaking performance.
526
+ // You can create one instance of it to use across an application.
527
+ const orq = new OrqCore({
528
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
529
+ });
530
+
531
+ async function run() {
532
+ const res = await proxyAudioSpeech(orq, {
533
+ input: "<value>",
534
+ model: "openai/tts-1-hd",
535
+ voice: "<value>",
536
+ });
537
+ if (res.ok) {
538
+ const { value: result } = res;
539
+
540
+ } else {
541
+ console.log("proxyAudioSpeech failed:", res.error);
542
+ }
543
+ }
544
+
545
+ run();
546
+ ```
547
+
548
+ ### Parameters
549
+
550
+ | Parameter | Type | Required | Description |
551
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
552
+ | `request` | [operations.PostV2ProxyAudioSpeechRequestBody](../../models/operations/postv2proxyaudiospeechrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
553
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
554
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
555
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
556
+
557
+ ### Response
558
+
559
+ **Promise\<void\>**
560
+
561
+ ### Errors
562
+
563
+ | Error Type | Status Code | Content Type |
564
+ | --------------- | --------------- | --------------- |
565
+ | errors.APIError | 4XX, 5XX | \*/\* |
566
+
567
+ ## completions
568
+
569
+ For sending requests to legacy completion models
570
+
571
+ ### Example Usage
572
+
573
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/completions" method="post" path="/v2/proxy/completions" -->
574
+ ```typescript
575
+ import { Orq } from "@orq-ai/node";
576
+
577
+ const orq = new Orq({
578
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
579
+ });
580
+
581
+ async function run() {
582
+ const result = await orq.proxy.completions({
583
+ model: "XTS",
584
+ prompt: "<value>",
585
+ orq: {
586
+ retry: {
587
+ onCodes: [
588
+ 429,
589
+ 500,
590
+ 502,
591
+ ],
592
+ },
593
+ fallbacks: [
594
+ {
595
+ model: "openai/gpt-5",
596
+ },
597
+ {
598
+ model: "anthropic/claude-4-opus",
599
+ },
600
+ ],
601
+ contact: {
602
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
603
+ displayName: "Jane Doe",
604
+ email: "jane.doe@example.com",
605
+ },
606
+ thread: {
607
+ id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
608
+ tags: [
609
+ "customer-support",
610
+ ],
611
+ },
612
+ inputs: {
613
+ "customer_name": "John Smith",
614
+ "issue_type": "billing",
615
+ },
616
+ cache: {
617
+ ttl: 3600,
618
+ type: "exact_match",
619
+ },
620
+ knowledgeBases: [
621
+ {
622
+ topK: 5,
623
+ knowledgeId: "knowledge_01ARZ3NDEKTSV4RRFFQ69G5FAV",
624
+ },
625
+ ],
626
+ },
627
+ });
628
+
629
+ for await (const event of result) {
630
+ // Handle the event
631
+ console.log(event);
632
+ }
633
+ }
634
+
635
+ run();
636
+ ```
637
+
638
+ ### Standalone function
639
+
640
+ The standalone function version of this method:
641
+
642
+ ```typescript
643
+ import { OrqCore } from "@orq-ai/node/core.js";
644
+ import { proxyCompletions } from "@orq-ai/node/funcs/proxyCompletions.js";
645
+
646
+ // Use `OrqCore` for best tree-shaking performance.
647
+ // You can create one instance of it to use across an application.
648
+ const orq = new OrqCore({
649
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
650
+ });
651
+
652
+ async function run() {
653
+ const res = await proxyCompletions(orq, {
654
+ model: "XTS",
655
+ prompt: "<value>",
656
+ orq: {
657
+ retry: {
658
+ onCodes: [
659
+ 429,
660
+ 500,
661
+ 502,
662
+ ],
663
+ },
664
+ fallbacks: [
665
+ {
666
+ model: "openai/gpt-5",
667
+ },
668
+ {
669
+ model: "anthropic/claude-4-opus",
670
+ },
671
+ ],
672
+ contact: {
673
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
674
+ displayName: "Jane Doe",
675
+ email: "jane.doe@example.com",
676
+ },
677
+ thread: {
678
+ id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
679
+ tags: [
680
+ "customer-support",
681
+ ],
682
+ },
683
+ inputs: {
684
+ "customer_name": "John Smith",
685
+ "issue_type": "billing",
686
+ },
687
+ cache: {
688
+ ttl: 3600,
689
+ type: "exact_match",
690
+ },
691
+ knowledgeBases: [
692
+ {
693
+ topK: 5,
694
+ knowledgeId: "knowledge_01ARZ3NDEKTSV4RRFFQ69G5FAV",
695
+ },
696
+ ],
697
+ },
698
+ });
699
+ if (res.ok) {
700
+ const { value: result } = res;
701
+ for await (const event of result) {
702
+ // Handle the event
703
+ console.log(event);
704
+ }
705
+ } else {
706
+ console.log("proxyCompletions failed:", res.error);
707
+ }
708
+ }
709
+
710
+ run();
711
+ ```
712
+
713
+ ### Parameters
714
+
715
+ | Parameter | Type | Required | Description |
716
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
717
+ | `request` | [operations.PostV2ProxyCompletionsRequestBody](../../models/operations/postv2proxycompletionsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
718
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
719
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
720
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
721
+
722
+ ### Response
723
+
724
+ **Promise\<[operations.PostV2ProxyCompletionsResponse](../../models/operations/postv2proxycompletionsresponse.md)\>**
725
+
726
+ ### Errors
727
+
728
+ | Error Type | Status Code | Content Type |
729
+ | --------------- | --------------- | --------------- |
730
+ | errors.APIError | 4XX, 5XX | \*/\* |
731
+
732
+ ## imagesGenerate
733
+
734
+ Create an Image
735
+
736
+ ### Example Usage
737
+
738
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/images/generations" method="post" path="/v2/proxy/images/generations" -->
739
+ ```typescript
740
+ import { Orq } from "@orq-ai/node";
741
+
742
+ const orq = new Orq({
743
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
744
+ });
745
+
746
+ async function run() {
747
+ const result = await orq.proxy.imagesGenerate({
748
+ prompt: "<value>",
749
+ model: "F-150",
750
+ orq: {
751
+ retry: {
752
+ onCodes: [
753
+ 429,
754
+ 500,
755
+ 502,
756
+ 503,
757
+ 504,
758
+ ],
759
+ },
760
+ fallbacks: [
761
+ {
762
+ model: "openai/gpt-4o-mini",
763
+ },
764
+ ],
765
+ contact: {
766
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
767
+ displayName: "Jane Doe",
768
+ email: "jane.doe@example.com",
769
+ metadata: [
770
+ {
771
+ "department": "Engineering",
772
+ "role": "Senior Developer",
773
+ },
774
+ ],
775
+ logoUrl: "https://example.com/avatars/jane-doe.jpg",
776
+ tags: [
777
+ "hr",
778
+ "engineering",
779
+ ],
780
+ },
781
+ thread: {
782
+ id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
783
+ tags: [
784
+ "customer-support",
785
+ "priority-high",
786
+ ],
787
+ },
788
+ cache: {
789
+ ttl: 3600,
790
+ type: "exact_match",
791
+ },
792
+ },
793
+ });
794
+
795
+ console.log(result);
796
+ }
797
+
798
+ run();
799
+ ```
800
+
801
+ ### Standalone function
802
+
803
+ The standalone function version of this method:
804
+
805
+ ```typescript
806
+ import { OrqCore } from "@orq-ai/node/core.js";
807
+ import { proxyImagesGenerate } from "@orq-ai/node/funcs/proxyImagesGenerate.js";
808
+
809
+ // Use `OrqCore` for best tree-shaking performance.
810
+ // You can create one instance of it to use across an application.
811
+ const orq = new OrqCore({
812
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
813
+ });
814
+
815
+ async function run() {
816
+ const res = await proxyImagesGenerate(orq, {
817
+ prompt: "<value>",
818
+ model: "F-150",
819
+ orq: {
820
+ retry: {
821
+ onCodes: [
822
+ 429,
823
+ 500,
824
+ 502,
825
+ 503,
826
+ 504,
827
+ ],
828
+ },
829
+ fallbacks: [
830
+ {
831
+ model: "openai/gpt-4o-mini",
832
+ },
833
+ ],
834
+ contact: {
835
+ id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
836
+ displayName: "Jane Doe",
837
+ email: "jane.doe@example.com",
838
+ metadata: [
839
+ {
840
+ "department": "Engineering",
841
+ "role": "Senior Developer",
842
+ },
843
+ ],
844
+ logoUrl: "https://example.com/avatars/jane-doe.jpg",
845
+ tags: [
846
+ "hr",
847
+ "engineering",
848
+ ],
849
+ },
850
+ thread: {
851
+ id: "thread_01ARZ3NDEKTSV4RRFFQ69G5FAV",
852
+ tags: [
853
+ "customer-support",
854
+ "priority-high",
855
+ ],
856
+ },
857
+ cache: {
858
+ ttl: 3600,
859
+ type: "exact_match",
860
+ },
861
+ },
862
+ });
863
+ if (res.ok) {
864
+ const { value: result } = res;
865
+ console.log(result);
866
+ } else {
867
+ console.log("proxyImagesGenerate failed:", res.error);
868
+ }
869
+ }
870
+
871
+ run();
872
+ ```
873
+
874
+ ### Parameters
875
+
876
+ | Parameter | Type | Required | Description |
877
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
878
+ | `request` | [operations.PostV2ProxyImagesGenerationsRequestBody](../../models/operations/postv2proxyimagesgenerationsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
879
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
880
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
881
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
882
+
883
+ ### Response
884
+
885
+ **Promise\<[operations.PostV2ProxyImagesGenerationsResponseBody](../../models/operations/postv2proxyimagesgenerationsresponsebody.md)\>**
886
+
887
+ ### Errors
888
+
889
+ | Error Type | Status Code | Content Type |
890
+ | --------------- | --------------- | --------------- |
891
+ | errors.APIError | 4XX, 5XX | \*/\* |
892
+
893
+ ## imagesEdit
894
+
895
+ Edit an Image
896
+
897
+ ### Example Usage
898
+
899
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/images/edits" method="post" path="/v2/proxy/images/edits" -->
900
+ ```typescript
901
+ import { Orq } from "@orq-ai/node";
902
+
903
+ const orq = new Orq({
904
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
905
+ });
906
+
907
+ async function run() {
908
+ const result = await orq.proxy.imagesEdit({
909
+ model: "Grand Cherokee",
910
+ image: "https://picsum.photos/seed/4IopZRfO/3966/2653",
911
+ prompt: "<value>",
912
+ });
913
+
914
+ console.log(result);
915
+ }
916
+
917
+ run();
918
+ ```
919
+
920
+ ### Standalone function
921
+
922
+ The standalone function version of this method:
923
+
924
+ ```typescript
925
+ import { OrqCore } from "@orq-ai/node/core.js";
926
+ import { proxyImagesEdit } from "@orq-ai/node/funcs/proxyImagesEdit.js";
927
+
928
+ // Use `OrqCore` for best tree-shaking performance.
929
+ // You can create one instance of it to use across an application.
930
+ const orq = new OrqCore({
931
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
932
+ });
933
+
934
+ async function run() {
935
+ const res = await proxyImagesEdit(orq, {
936
+ model: "Grand Cherokee",
937
+ image: "https://picsum.photos/seed/4IopZRfO/3966/2653",
938
+ prompt: "<value>",
939
+ });
940
+ if (res.ok) {
941
+ const { value: result } = res;
942
+ console.log(result);
943
+ } else {
944
+ console.log("proxyImagesEdit failed:", res.error);
945
+ }
946
+ }
947
+
948
+ run();
949
+ ```
950
+
951
+ ### Parameters
952
+
953
+ | Parameter | Type | Required | Description |
954
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
955
+ | `request` | [operations.PostV2ProxyImagesEditsRequestBody](../../models/operations/postv2proxyimageseditsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
956
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
957
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
958
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
959
+
960
+ ### Response
961
+
962
+ **Promise\<[operations.PostV2ProxyImagesEditsResponseBody](../../models/operations/postv2proxyimageseditsresponsebody.md)\>**
963
+
964
+ ### Errors
965
+
966
+ | Error Type | Status Code | Content Type |
967
+ | --------------- | --------------- | --------------- |
968
+ | errors.APIError | 4XX, 5XX | \*/\* |
969
+
970
+ ## imagesVariation
971
+
972
+ Create an Image Variation
973
+
974
+ ### Example Usage
975
+
976
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/images/variations" method="post" path="/v2/proxy/images/variations" -->
977
+ ```typescript
978
+ import { Orq } from "@orq-ai/node";
979
+
980
+ const orq = new Orq({
981
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
982
+ });
983
+
984
+ async function run() {
985
+ const result = await orq.proxy.imagesVariation({
986
+ image: "https://picsum.photos/seed/3tyQFc/1182/550",
987
+ model: "Cruze",
988
+ });
989
+
990
+ console.log(result);
991
+ }
992
+
993
+ run();
994
+ ```
995
+
996
+ ### Standalone function
997
+
998
+ The standalone function version of this method:
999
+
1000
+ ```typescript
1001
+ import { OrqCore } from "@orq-ai/node/core.js";
1002
+ import { proxyImagesVariation } from "@orq-ai/node/funcs/proxyImagesVariation.js";
1003
+
1004
+ // Use `OrqCore` for best tree-shaking performance.
1005
+ // You can create one instance of it to use across an application.
1006
+ const orq = new OrqCore({
1007
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1008
+ });
1009
+
1010
+ async function run() {
1011
+ const res = await proxyImagesVariation(orq, {
1012
+ image: "https://picsum.photos/seed/3tyQFc/1182/550",
1013
+ model: "Cruze",
1014
+ });
1015
+ if (res.ok) {
1016
+ const { value: result } = res;
1017
+ console.log(result);
1018
+ } else {
1019
+ console.log("proxyImagesVariation failed:", res.error);
1020
+ }
1021
+ }
1022
+
1023
+ run();
1024
+ ```
1025
+
1026
+ ### Parameters
1027
+
1028
+ | Parameter | Type | Required | Description |
1029
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1030
+ | `request` | [operations.PostV2ProxyImagesVariationsRequestBody](../../models/operations/postv2proxyimagesvariationsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
1031
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1032
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1033
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1034
+
1035
+ ### Response
1036
+
1037
+ **Promise\<[operations.PostV2ProxyImagesVariationsResponseBody](../../models/operations/postv2proxyimagesvariationsresponsebody.md)\>**
1038
+
1039
+ ### Errors
1040
+
1041
+ | Error Type | Status Code | Content Type |
1042
+ | --------------- | --------------- | --------------- |
1043
+ | errors.APIError | 4XX, 5XX | \*/\* |
1044
+
1045
+ ## audioTranscriptions
1046
+
1047
+ ### Example Usage
1048
+
1049
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/audio/transcriptions" method="post" path="/v2/proxy/audio/transcriptions" -->
1050
+ ```typescript
1051
+ import { Orq } from "@orq-ai/node";
1052
+ import { openAsBlob } from "node:fs";
1053
+
1054
+ const orq = new Orq({
1055
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1056
+ });
1057
+
1058
+ async function run() {
1059
+ const result = await orq.proxy.audioTranscriptions({
1060
+ temperature: 0.5,
1061
+ timestampGranularities: [
1062
+ "word",
1063
+ "segment",
1064
+ ],
1065
+ file: await openAsBlob("example.file"),
1066
+ });
1067
+
1068
+ console.log(result);
1069
+ }
1070
+
1071
+ run();
1072
+ ```
1073
+
1074
+ ### Standalone function
1075
+
1076
+ The standalone function version of this method:
1077
+
1078
+ ```typescript
1079
+ import { OrqCore } from "@orq-ai/node/core.js";
1080
+ import { proxyAudioTranscriptions } from "@orq-ai/node/funcs/proxyAudioTranscriptions.js";
1081
+ import { openAsBlob } from "node:fs";
1082
+
1083
+ // Use `OrqCore` for best tree-shaking performance.
1084
+ // You can create one instance of it to use across an application.
1085
+ const orq = new OrqCore({
1086
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1087
+ });
1088
+
1089
+ async function run() {
1090
+ const res = await proxyAudioTranscriptions(orq, {
1091
+ temperature: 0.5,
1092
+ timestampGranularities: [
1093
+ "word",
1094
+ "segment",
1095
+ ],
1096
+ file: await openAsBlob("example.file"),
1097
+ });
1098
+ if (res.ok) {
1099
+ const { value: result } = res;
1100
+ console.log(result);
1101
+ } else {
1102
+ console.log("proxyAudioTranscriptions failed:", res.error);
1103
+ }
1104
+ }
1105
+
1106
+ run();
1107
+ ```
1108
+
1109
+ ### Parameters
1110
+
1111
+ | Parameter | Type | Required | Description |
1112
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1113
+ | `request` | [operations.PostV2ProxyAudioTranscriptionsRequestBody](../../models/operations/postv2proxyaudiotranscriptionsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
1114
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1115
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1116
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1117
+
1118
+ ### Response
1119
+
1120
+ **Promise\<[operations.PostV2ProxyAudioTranscriptionsResponseBody](../../models/operations/postv2proxyaudiotranscriptionsresponsebody.md)\>**
1121
+
1122
+ ### Errors
1123
+
1124
+ | Error Type | Status Code | Content Type |
1125
+ | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
1126
+ | errors.PostV2ProxyAudioTranscriptionsResponseBody | 422 | application/json |
1127
+ | errors.APIError | 4XX, 5XX | \*/\* |
1128
+
1129
+ ## audioTranslations
1130
+
1131
+ ### Example Usage
1132
+
1133
+ <!-- UsageSnippet language="typescript" operationID="post_/v2/proxy/audio/translations" method="post" path="/v2/proxy/audio/translations" -->
1134
+ ```typescript
1135
+ import { Orq } from "@orq-ai/node";
1136
+ import { openAsBlob } from "node:fs";
1137
+
1138
+ const orq = new Orq({
1139
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1140
+ });
1141
+
1142
+ async function run() {
1143
+ const result = await orq.proxy.audioTranslations({
1144
+ temperature: 0.5,
1145
+ file: await openAsBlob("example.file"),
1146
+ });
1147
+
1148
+ console.log(result);
1149
+ }
1150
+
1151
+ run();
1152
+ ```
1153
+
1154
+ ### Standalone function
1155
+
1156
+ The standalone function version of this method:
1157
+
1158
+ ```typescript
1159
+ import { OrqCore } from "@orq-ai/node/core.js";
1160
+ import { proxyAudioTranslations } from "@orq-ai/node/funcs/proxyAudioTranslations.js";
1161
+ import { openAsBlob } from "node:fs";
1162
+
1163
+ // Use `OrqCore` for best tree-shaking performance.
1164
+ // You can create one instance of it to use across an application.
1165
+ const orq = new OrqCore({
1166
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1167
+ });
1168
+
1169
+ async function run() {
1170
+ const res = await proxyAudioTranslations(orq, {
1171
+ temperature: 0.5,
1172
+ file: await openAsBlob("example.file"),
1173
+ });
1174
+ if (res.ok) {
1175
+ const { value: result } = res;
1176
+ console.log(result);
1177
+ } else {
1178
+ console.log("proxyAudioTranslations failed:", res.error);
1179
+ }
1180
+ }
1181
+
1182
+ run();
1183
+ ```
1184
+
1185
+ ### Parameters
1186
+
1187
+ | Parameter | Type | Required | Description |
1188
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1189
+ | `request` | [operations.PostV2ProxyAudioTranslationsRequestBody](../../models/operations/postv2proxyaudiotranslationsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
1190
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1191
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1192
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1193
+
1194
+ ### Response
1195
+
1196
+ **Promise\<[operations.PostV2ProxyAudioTranslationsResponseBody](../../models/operations/postv2proxyaudiotranslationsresponsebody.md)\>**
1197
+
1198
+ ### Errors
1199
+
1200
+ | Error Type | Status Code | Content Type |
1201
+ | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
1202
+ | errors.PostV2ProxyAudioTranslationsResponseBody | 422 | application/json |
1203
+ | errors.APIError | 4XX, 5XX | \*/\* |
1204
+
1205
+ ## responsesCreate
1206
+
1207
+ Creates a model response for the given input.
1208
+
1209
+ ### Example Usage
1210
+
1211
+ <!-- UsageSnippet language="typescript" operationID="CreateResponse" method="post" path="/v2/proxy/responses" -->
1212
+ ```typescript
1213
+ import { Orq } from "@orq-ai/node";
1214
+
1215
+ const orq = new Orq({
1216
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1217
+ });
1218
+
1219
+ async function run() {
1220
+ const result = await orq.proxy.responsesCreate({
1221
+ model: "Element",
1222
+ input: "<value>",
1223
+ });
1224
+
1225
+ for await (const event of result) {
1226
+ // Handle the event
1227
+ console.log(event);
1228
+ }
1229
+ }
1230
+
1231
+ run();
1232
+ ```
1233
+
1234
+ ### Standalone function
1235
+
1236
+ The standalone function version of this method:
1237
+
1238
+ ```typescript
1239
+ import { OrqCore } from "@orq-ai/node/core.js";
1240
+ import { proxyResponsesCreate } from "@orq-ai/node/funcs/proxyResponsesCreate.js";
1241
+
1242
+ // Use `OrqCore` for best tree-shaking performance.
1243
+ // You can create one instance of it to use across an application.
1244
+ const orq = new OrqCore({
1245
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1246
+ });
1247
+
1248
+ async function run() {
1249
+ const res = await proxyResponsesCreate(orq, {
1250
+ model: "Element",
1251
+ input: "<value>",
1252
+ });
1253
+ if (res.ok) {
1254
+ const { value: result } = res;
1255
+ for await (const event of result) {
1256
+ // Handle the event
1257
+ console.log(event);
1258
+ }
1259
+ } else {
1260
+ console.log("proxyResponsesCreate failed:", res.error);
1261
+ }
1262
+ }
1263
+
1264
+ run();
1265
+ ```
1266
+
1267
+ ### Parameters
1268
+
1269
+ | Parameter | Type | Required | Description |
1270
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1271
+ | `request` | [operations.CreateResponseRequestBody](../../models/operations/createresponserequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
1272
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1273
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1274
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1275
+
1276
+ ### Response
1277
+
1278
+ **Promise\<[operations.CreateResponseResponse](../../models/operations/createresponseresponse.md)\>**
1279
+
1280
+ ### Errors
1281
+
1282
+ | Error Type | Status Code | Content Type |
1283
+ | --------------- | --------------- | --------------- |
1284
+ | errors.APIError | 4XX, 5XX | \*/\* |