@deeprelay/sdk 0.0.1 → 0.1.1

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 (376) hide show
  1. package/.openapi-generator/FILES +126 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +24 -0
  4. package/LICENSE +204 -0
  5. package/README.md +197 -4
  6. package/dist/apis/BillingApi.d.ts +169 -0
  7. package/dist/apis/BillingApi.js +457 -0
  8. package/dist/apis/InferenceApi.d.ts +217 -0
  9. package/dist/apis/InferenceApi.js +582 -0
  10. package/dist/apis/MetaApi.d.ts +44 -0
  11. package/dist/apis/MetaApi.js +105 -0
  12. package/dist/apis/OperationsApi.d.ts +33 -0
  13. package/dist/apis/OperationsApi.js +79 -0
  14. package/dist/apis/UsageApi.d.ts +56 -0
  15. package/dist/apis/UsageApi.js +109 -0
  16. package/dist/apis/WebhooksApi.d.ts +82 -0
  17. package/dist/apis/WebhooksApi.js +224 -0
  18. package/dist/apis/index.d.ts +6 -0
  19. package/dist/apis/index.js +24 -0
  20. package/dist/esm/apis/BillingApi.d.ts +169 -0
  21. package/dist/esm/apis/BillingApi.js +453 -0
  22. package/dist/esm/apis/InferenceApi.d.ts +217 -0
  23. package/dist/esm/apis/InferenceApi.js +578 -0
  24. package/dist/esm/apis/MetaApi.d.ts +44 -0
  25. package/dist/esm/apis/MetaApi.js +101 -0
  26. package/dist/esm/apis/OperationsApi.d.ts +33 -0
  27. package/dist/esm/apis/OperationsApi.js +75 -0
  28. package/dist/esm/apis/UsageApi.d.ts +56 -0
  29. package/dist/esm/apis/UsageApi.js +105 -0
  30. package/dist/esm/apis/WebhooksApi.d.ts +82 -0
  31. package/dist/esm/apis/WebhooksApi.js +220 -0
  32. package/dist/esm/apis/index.d.ts +6 -0
  33. package/dist/esm/apis/index.js +8 -0
  34. package/dist/esm/index.d.ts +3 -0
  35. package/dist/esm/index.js +5 -0
  36. package/dist/esm/models/Balance.d.ts +65 -0
  37. package/dist/esm/models/Balance.js +63 -0
  38. package/dist/esm/models/ChatChoice.d.ts +55 -0
  39. package/dist/esm/models/ChatChoice.js +55 -0
  40. package/dist/esm/models/ChatCompletionRequest.d.ts +64 -0
  41. package/dist/esm/models/ChatCompletionRequest.js +57 -0
  42. package/dist/esm/models/ChatCompletionResponse.d.ts +71 -0
  43. package/dist/esm/models/ChatCompletionResponse.js +73 -0
  44. package/dist/esm/models/ChatMessage.d.ts +47 -0
  45. package/dist/esm/models/ChatMessage.js +55 -0
  46. package/dist/esm/models/CreateCryptoDepositRequest.d.ts +64 -0
  47. package/dist/esm/models/CreateCryptoDepositRequest.js +68 -0
  48. package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +50 -0
  49. package/dist/esm/models/CreateWebhookEndpointRequest.js +58 -0
  50. package/dist/esm/models/CryptoDeposit.d.ts +114 -0
  51. package/dist/esm/models/CryptoDeposit.js +90 -0
  52. package/dist/esm/models/Embedding.d.ts +51 -0
  53. package/dist/esm/models/Embedding.js +59 -0
  54. package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
  55. package/dist/esm/models/EmbeddingsRequest.js +60 -0
  56. package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
  57. package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
  58. package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
  59. package/dist/esm/models/EmbeddingsResponse.js +65 -0
  60. package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
  61. package/dist/esm/models/EmbeddingsUsage.js +47 -0
  62. package/dist/esm/models/GetHealth200Response.d.ts +39 -0
  63. package/dist/esm/models/GetHealth200Response.js +47 -0
  64. package/dist/esm/models/ImagesGenerationsRequest.d.ts +63 -0
  65. package/dist/esm/models/ImagesGenerationsRequest.js +59 -0
  66. package/dist/esm/models/ImagesResponse.d.ts +46 -0
  67. package/dist/esm/models/ImagesResponse.js +53 -0
  68. package/dist/esm/models/ImagesResponseDataInner.d.ts +32 -0
  69. package/dist/esm/models/ImagesResponseDataInner.js +43 -0
  70. package/dist/esm/models/ImagesResponseUsage.d.ts +32 -0
  71. package/dist/esm/models/ImagesResponseUsage.js +43 -0
  72. package/dist/esm/models/InferencePreflight.d.ts +92 -0
  73. package/dist/esm/models/InferencePreflight.js +86 -0
  74. package/dist/esm/models/ListDeposits200Response.d.ts +39 -0
  75. package/dist/esm/models/ListDeposits200Response.js +48 -0
  76. package/dist/esm/models/Model.d.ts +152 -0
  77. package/dist/esm/models/Model.js +110 -0
  78. package/dist/esm/models/ModelList.d.ts +46 -0
  79. package/dist/esm/models/ModelList.js +56 -0
  80. package/dist/esm/models/ModelParametersInner.d.ts +72 -0
  81. package/dist/esm/models/ModelParametersInner.js +64 -0
  82. package/dist/esm/models/ModelPricing.d.ts +126 -0
  83. package/dist/esm/models/ModelPricing.js +78 -0
  84. package/dist/esm/models/ModelRate.d.ts +62 -0
  85. package/dist/esm/models/ModelRate.js +51 -0
  86. package/dist/esm/models/OpenAIErrorEnvelope.d.ts +33 -0
  87. package/dist/esm/models/OpenAIErrorEnvelope.js +44 -0
  88. package/dist/esm/models/OpenAIErrorEnvelopeError.d.ts +50 -0
  89. package/dist/esm/models/OpenAIErrorEnvelopeError.js +53 -0
  90. package/dist/esm/models/Operation.d.ts +107 -0
  91. package/dist/esm/models/Operation.js +86 -0
  92. package/dist/esm/models/OperationError.d.ts +38 -0
  93. package/dist/esm/models/OperationError.js +43 -0
  94. package/dist/esm/models/OperationResult.d.ts +44 -0
  95. package/dist/esm/models/OperationResult.js +45 -0
  96. package/dist/esm/models/PeakWindow.d.ts +38 -0
  97. package/dist/esm/models/PeakWindow.js +47 -0
  98. package/dist/esm/models/Problem.d.ts +87 -0
  99. package/dist/esm/models/Problem.js +87 -0
  100. package/dist/esm/models/SpendingLimit.d.ts +101 -0
  101. package/dist/esm/models/SpendingLimit.js +85 -0
  102. package/dist/esm/models/StreamOptions.d.ts +32 -0
  103. package/dist/esm/models/StreamOptions.js +41 -0
  104. package/dist/esm/models/Subscription.d.ts +78 -0
  105. package/dist/esm/models/Subscription.js +68 -0
  106. package/dist/esm/models/SubscriptionCheckoutRequest.d.ts +45 -0
  107. package/dist/esm/models/SubscriptionCheckoutRequest.js +45 -0
  108. package/dist/esm/models/SubscriptionCheckoutSession.d.ts +45 -0
  109. package/dist/esm/models/SubscriptionCheckoutSession.js +52 -0
  110. package/dist/esm/models/SubscriptionPlan.d.ts +46 -0
  111. package/dist/esm/models/SubscriptionPlan.js +50 -0
  112. package/dist/esm/models/SubscriptionPortalRequest.d.ts +32 -0
  113. package/dist/esm/models/SubscriptionPortalRequest.js +41 -0
  114. package/dist/esm/models/SubscriptionPortalSession.d.ts +32 -0
  115. package/dist/esm/models/SubscriptionPortalSession.js +43 -0
  116. package/dist/esm/models/SubscriptionPrice.d.ts +53 -0
  117. package/dist/esm/models/SubscriptionPrice.js +55 -0
  118. package/dist/esm/models/SubscriptionQuota.d.ts +60 -0
  119. package/dist/esm/models/SubscriptionQuota.js +59 -0
  120. package/dist/esm/models/SubscriptionUsage.d.ts +65 -0
  121. package/dist/esm/models/SubscriptionUsage.js +63 -0
  122. package/dist/esm/models/UpdateSpendingLimitRequest.d.ts +59 -0
  123. package/dist/esm/models/UpdateSpendingLimitRequest.js +57 -0
  124. package/dist/esm/models/Usage.d.ts +44 -0
  125. package/dist/esm/models/Usage.js +51 -0
  126. package/dist/esm/models/UsageBucket.d.ts +56 -0
  127. package/dist/esm/models/UsageBucket.js +55 -0
  128. package/dist/esm/models/UsagePage.d.ts +39 -0
  129. package/dist/esm/models/UsagePage.js +48 -0
  130. package/dist/esm/models/VideoCreateRequest.d.ts +50 -0
  131. package/dist/esm/models/VideoCreateRequest.js +51 -0
  132. package/dist/esm/models/VideoJob.d.ts +117 -0
  133. package/dist/esm/models/VideoJob.js +94 -0
  134. package/dist/esm/models/VideoList.d.ts +52 -0
  135. package/dist/esm/models/VideoList.js +60 -0
  136. package/dist/esm/models/WebhookEndpoint.d.ts +74 -0
  137. package/dist/esm/models/WebhookEndpoint.js +72 -0
  138. package/dist/esm/models/WebhookEndpointPage.d.ts +39 -0
  139. package/dist/esm/models/WebhookEndpointPage.js +48 -0
  140. package/dist/esm/models/index.d.ts +52 -0
  141. package/dist/esm/models/index.js +54 -0
  142. package/dist/esm/runtime.d.ts +185 -0
  143. package/dist/esm/runtime.js +354 -0
  144. package/dist/index.d.ts +3 -0
  145. package/dist/index.js +21 -0
  146. package/dist/models/Balance.d.ts +65 -0
  147. package/dist/models/Balance.js +70 -0
  148. package/dist/models/ChatChoice.d.ts +55 -0
  149. package/dist/models/ChatChoice.js +63 -0
  150. package/dist/models/ChatCompletionRequest.d.ts +64 -0
  151. package/dist/models/ChatCompletionRequest.js +64 -0
  152. package/dist/models/ChatCompletionResponse.d.ts +71 -0
  153. package/dist/models/ChatCompletionResponse.js +81 -0
  154. package/dist/models/ChatMessage.d.ts +47 -0
  155. package/dist/models/ChatMessage.js +63 -0
  156. package/dist/models/CreateCryptoDepositRequest.d.ts +64 -0
  157. package/dist/models/CreateCryptoDepositRequest.js +76 -0
  158. package/dist/models/CreateWebhookEndpointRequest.d.ts +50 -0
  159. package/dist/models/CreateWebhookEndpointRequest.js +66 -0
  160. package/dist/models/CryptoDeposit.d.ts +114 -0
  161. package/dist/models/CryptoDeposit.js +98 -0
  162. package/dist/models/Embedding.d.ts +51 -0
  163. package/dist/models/Embedding.js +67 -0
  164. package/dist/models/EmbeddingsRequest.d.ts +64 -0
  165. package/dist/models/EmbeddingsRequest.js +68 -0
  166. package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
  167. package/dist/models/EmbeddingsRequestInput.js +53 -0
  168. package/dist/models/EmbeddingsResponse.d.ts +59 -0
  169. package/dist/models/EmbeddingsResponse.js +73 -0
  170. package/dist/models/EmbeddingsUsage.d.ts +38 -0
  171. package/dist/models/EmbeddingsUsage.js +54 -0
  172. package/dist/models/GetHealth200Response.d.ts +39 -0
  173. package/dist/models/GetHealth200Response.js +55 -0
  174. package/dist/models/ImagesGenerationsRequest.d.ts +63 -0
  175. package/dist/models/ImagesGenerationsRequest.js +67 -0
  176. package/dist/models/ImagesResponse.d.ts +46 -0
  177. package/dist/models/ImagesResponse.js +60 -0
  178. package/dist/models/ImagesResponseDataInner.d.ts +32 -0
  179. package/dist/models/ImagesResponseDataInner.js +50 -0
  180. package/dist/models/ImagesResponseUsage.d.ts +32 -0
  181. package/dist/models/ImagesResponseUsage.js +50 -0
  182. package/dist/models/InferencePreflight.d.ts +92 -0
  183. package/dist/models/InferencePreflight.js +94 -0
  184. package/dist/models/ListDeposits200Response.d.ts +39 -0
  185. package/dist/models/ListDeposits200Response.js +55 -0
  186. package/dist/models/Model.d.ts +152 -0
  187. package/dist/models/Model.js +118 -0
  188. package/dist/models/ModelList.d.ts +46 -0
  189. package/dist/models/ModelList.js +64 -0
  190. package/dist/models/ModelParametersInner.d.ts +72 -0
  191. package/dist/models/ModelParametersInner.js +72 -0
  192. package/dist/models/ModelPricing.d.ts +126 -0
  193. package/dist/models/ModelPricing.js +86 -0
  194. package/dist/models/ModelRate.d.ts +62 -0
  195. package/dist/models/ModelRate.js +58 -0
  196. package/dist/models/OpenAIErrorEnvelope.d.ts +33 -0
  197. package/dist/models/OpenAIErrorEnvelope.js +51 -0
  198. package/dist/models/OpenAIErrorEnvelopeError.d.ts +50 -0
  199. package/dist/models/OpenAIErrorEnvelopeError.js +60 -0
  200. package/dist/models/Operation.d.ts +107 -0
  201. package/dist/models/Operation.js +94 -0
  202. package/dist/models/OperationError.d.ts +38 -0
  203. package/dist/models/OperationError.js +50 -0
  204. package/dist/models/OperationResult.d.ts +44 -0
  205. package/dist/models/OperationResult.js +52 -0
  206. package/dist/models/PeakWindow.d.ts +38 -0
  207. package/dist/models/PeakWindow.js +54 -0
  208. package/dist/models/Problem.d.ts +87 -0
  209. package/dist/models/Problem.js +95 -0
  210. package/dist/models/SpendingLimit.d.ts +101 -0
  211. package/dist/models/SpendingLimit.js +93 -0
  212. package/dist/models/StreamOptions.d.ts +32 -0
  213. package/dist/models/StreamOptions.js +48 -0
  214. package/dist/models/Subscription.d.ts +78 -0
  215. package/dist/models/Subscription.js +75 -0
  216. package/dist/models/SubscriptionCheckoutRequest.d.ts +45 -0
  217. package/dist/models/SubscriptionCheckoutRequest.js +52 -0
  218. package/dist/models/SubscriptionCheckoutSession.d.ts +45 -0
  219. package/dist/models/SubscriptionCheckoutSession.js +59 -0
  220. package/dist/models/SubscriptionPlan.d.ts +46 -0
  221. package/dist/models/SubscriptionPlan.js +57 -0
  222. package/dist/models/SubscriptionPortalRequest.d.ts +32 -0
  223. package/dist/models/SubscriptionPortalRequest.js +48 -0
  224. package/dist/models/SubscriptionPortalSession.d.ts +32 -0
  225. package/dist/models/SubscriptionPortalSession.js +50 -0
  226. package/dist/models/SubscriptionPrice.d.ts +53 -0
  227. package/dist/models/SubscriptionPrice.js +62 -0
  228. package/dist/models/SubscriptionQuota.d.ts +60 -0
  229. package/dist/models/SubscriptionQuota.js +66 -0
  230. package/dist/models/SubscriptionUsage.d.ts +65 -0
  231. package/dist/models/SubscriptionUsage.js +70 -0
  232. package/dist/models/UpdateSpendingLimitRequest.d.ts +59 -0
  233. package/dist/models/UpdateSpendingLimitRequest.js +65 -0
  234. package/dist/models/Usage.d.ts +44 -0
  235. package/dist/models/Usage.js +58 -0
  236. package/dist/models/UsageBucket.d.ts +56 -0
  237. package/dist/models/UsageBucket.js +62 -0
  238. package/dist/models/UsagePage.d.ts +39 -0
  239. package/dist/models/UsagePage.js +55 -0
  240. package/dist/models/VideoCreateRequest.d.ts +50 -0
  241. package/dist/models/VideoCreateRequest.js +58 -0
  242. package/dist/models/VideoJob.d.ts +117 -0
  243. package/dist/models/VideoJob.js +102 -0
  244. package/dist/models/VideoList.d.ts +52 -0
  245. package/dist/models/VideoList.js +68 -0
  246. package/dist/models/WebhookEndpoint.d.ts +74 -0
  247. package/dist/models/WebhookEndpoint.js +80 -0
  248. package/dist/models/WebhookEndpointPage.d.ts +39 -0
  249. package/dist/models/WebhookEndpointPage.js +55 -0
  250. package/dist/models/index.d.ts +52 -0
  251. package/dist/models/index.js +70 -0
  252. package/dist/runtime.d.ts +185 -0
  253. package/dist/runtime.js +371 -0
  254. package/docs/Balance.md +45 -0
  255. package/docs/BillingApi.md +657 -0
  256. package/docs/ChatChoice.md +38 -0
  257. package/docs/ChatCompletionRequest.md +44 -0
  258. package/docs/ChatCompletionResponse.md +44 -0
  259. package/docs/ChatMessage.md +36 -0
  260. package/docs/CreateCryptoDepositRequest.md +38 -0
  261. package/docs/CreateWebhookEndpointRequest.md +36 -0
  262. package/docs/CryptoDeposit.md +55 -0
  263. package/docs/Embedding.md +38 -0
  264. package/docs/EmbeddingsRequest.md +42 -0
  265. package/docs/EmbeddingsRequestInput.md +33 -0
  266. package/docs/EmbeddingsResponse.md +40 -0
  267. package/docs/EmbeddingsUsage.md +37 -0
  268. package/docs/GetHealth200Response.md +34 -0
  269. package/docs/ImagesGenerationsRequest.md +42 -0
  270. package/docs/ImagesResponse.md +38 -0
  271. package/docs/ImagesResponseDataInner.md +34 -0
  272. package/docs/ImagesResponseUsage.md +34 -0
  273. package/docs/InferenceApi.md +861 -0
  274. package/docs/InferencePreflight.md +47 -0
  275. package/docs/ListDeposits200Response.md +36 -0
  276. package/docs/MetaApi.md +126 -0
  277. package/docs/Model.md +64 -0
  278. package/docs/ModelList.md +36 -0
  279. package/docs/ModelParametersInner.md +44 -0
  280. package/docs/ModelPricing.md +62 -0
  281. package/docs/ModelRate.md +45 -0
  282. package/docs/OpenAIErrorEnvelope.md +34 -0
  283. package/docs/OpenAIErrorEnvelopeError.md +40 -0
  284. package/docs/Operation.md +52 -0
  285. package/docs/OperationError.md +36 -0
  286. package/docs/OperationResult.md +39 -0
  287. package/docs/OperationsApi.md +80 -0
  288. package/docs/PeakWindow.md +37 -0
  289. package/docs/Problem.md +44 -0
  290. package/docs/SpendingLimit.md +54 -0
  291. package/docs/StreamOptions.md +34 -0
  292. package/docs/Subscription.md +49 -0
  293. package/docs/SubscriptionCheckoutRequest.md +39 -0
  294. package/docs/SubscriptionCheckoutSession.md +38 -0
  295. package/docs/SubscriptionPlan.md +39 -0
  296. package/docs/SubscriptionPortalRequest.md +35 -0
  297. package/docs/SubscriptionPortalSession.md +34 -0
  298. package/docs/SubscriptionPrice.md +41 -0
  299. package/docs/SubscriptionQuota.md +43 -0
  300. package/docs/SubscriptionUsage.md +45 -0
  301. package/docs/UpdateSpendingLimitRequest.md +40 -0
  302. package/docs/Usage.md +38 -0
  303. package/docs/UsageApi.md +95 -0
  304. package/docs/UsageBucket.md +42 -0
  305. package/docs/UsagePage.md +36 -0
  306. package/docs/VideoCreateRequest.md +40 -0
  307. package/docs/VideoJob.md +56 -0
  308. package/docs/VideoList.md +38 -0
  309. package/docs/WebhookEndpoint.md +44 -0
  310. package/docs/WebhookEndpointPage.md +36 -0
  311. package/docs/WebhooksApi.md +302 -0
  312. package/package.json +16 -7
  313. package/src/apis/BillingApi.ts +559 -0
  314. package/src/apis/InferenceApi.ts +753 -0
  315. package/src/apis/MetaApi.ts +103 -0
  316. package/src/apis/OperationsApi.ts +89 -0
  317. package/src/apis/UsageApi.ts +129 -0
  318. package/src/apis/WebhooksApi.ts +277 -0
  319. package/src/apis/index.ts +8 -0
  320. package/src/index.ts +5 -0
  321. package/src/models/Balance.ts +114 -0
  322. package/src/models/ChatChoice.ts +102 -0
  323. package/src/models/ChatCompletionRequest.ts +122 -0
  324. package/src/models/ChatCompletionResponse.ts +138 -0
  325. package/src/models/ChatMessage.ts +87 -0
  326. package/src/models/CreateCryptoDepositRequest.ts +108 -0
  327. package/src/models/CreateWebhookEndpointRequest.ts +90 -0
  328. package/src/models/CryptoDeposit.ts +177 -0
  329. package/src/models/Embedding.ts +96 -0
  330. package/src/models/EmbeddingsRequest.ts +117 -0
  331. package/src/models/EmbeddingsRequestInput.ts +59 -0
  332. package/src/models/EmbeddingsResponse.ts +120 -0
  333. package/src/models/EmbeddingsUsage.ts +75 -0
  334. package/src/models/GetHealth200Response.ts +75 -0
  335. package/src/models/ImagesGenerationsRequest.ts +109 -0
  336. package/src/models/ImagesResponse.ts +99 -0
  337. package/src/models/ImagesResponseDataInner.ts +66 -0
  338. package/src/models/ImagesResponseUsage.ts +66 -0
  339. package/src/models/InferencePreflight.ts +147 -0
  340. package/src/models/ListDeposits200Response.ts +83 -0
  341. package/src/models/Model.ts +241 -0
  342. package/src/models/ModelList.ts +95 -0
  343. package/src/models/ModelParametersInner.ts +120 -0
  344. package/src/models/ModelPricing.ts +203 -0
  345. package/src/models/ModelRate.ts +105 -0
  346. package/src/models/OpenAIErrorEnvelope.ts +74 -0
  347. package/src/models/OpenAIErrorEnvelopeError.ts +92 -0
  348. package/src/models/Operation.ts +179 -0
  349. package/src/models/OperationError.ts +73 -0
  350. package/src/models/OperationResult.ts +81 -0
  351. package/src/models/PeakWindow.ts +75 -0
  352. package/src/models/Problem.ts +139 -0
  353. package/src/models/SpendingLimit.ts +165 -0
  354. package/src/models/StreamOptions.ts +65 -0
  355. package/src/models/Subscription.ts +149 -0
  356. package/src/models/SubscriptionCheckoutRequest.ts +82 -0
  357. package/src/models/SubscriptionCheckoutSession.ts +92 -0
  358. package/src/models/SubscriptionPlan.ts +92 -0
  359. package/src/models/SubscriptionPortalRequest.ts +65 -0
  360. package/src/models/SubscriptionPortalSession.ts +66 -0
  361. package/src/models/SubscriptionPrice.ts +96 -0
  362. package/src/models/SubscriptionQuota.ts +106 -0
  363. package/src/models/SubscriptionUsage.ts +114 -0
  364. package/src/models/UpdateSpendingLimitRequest.ts +102 -0
  365. package/src/models/Usage.ts +84 -0
  366. package/src/models/UsageBucket.ts +100 -0
  367. package/src/models/UsagePage.ts +83 -0
  368. package/src/models/VideoCreateRequest.ts +91 -0
  369. package/src/models/VideoJob.ts +184 -0
  370. package/src/models/VideoList.ts +104 -0
  371. package/src/models/WebhookEndpoint.ts +125 -0
  372. package/src/models/WebhookEndpointPage.ts +83 -0
  373. package/src/models/index.ts +54 -0
  374. package/src/runtime.ts +454 -0
  375. package/tsconfig.esm.json +7 -0
  376. package/tsconfig.json +16 -0
@@ -0,0 +1,753 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import * as runtime from '../runtime';
16
+ import {
17
+ type ChatCompletionRequest,
18
+ ChatCompletionRequestFromJSON,
19
+ ChatCompletionRequestToJSON,
20
+ } from '../models/ChatCompletionRequest';
21
+ import {
22
+ type ChatCompletionResponse,
23
+ ChatCompletionResponseFromJSON,
24
+ ChatCompletionResponseToJSON,
25
+ } from '../models/ChatCompletionResponse';
26
+ import {
27
+ type EmbeddingsRequest,
28
+ EmbeddingsRequestFromJSON,
29
+ EmbeddingsRequestToJSON,
30
+ } from '../models/EmbeddingsRequest';
31
+ import {
32
+ type EmbeddingsResponse,
33
+ EmbeddingsResponseFromJSON,
34
+ EmbeddingsResponseToJSON,
35
+ } from '../models/EmbeddingsResponse';
36
+ import {
37
+ type ImagesGenerationsRequest,
38
+ ImagesGenerationsRequestFromJSON,
39
+ ImagesGenerationsRequestToJSON,
40
+ } from '../models/ImagesGenerationsRequest';
41
+ import {
42
+ type ImagesResponse,
43
+ ImagesResponseFromJSON,
44
+ ImagesResponseToJSON,
45
+ } from '../models/ImagesResponse';
46
+ import {
47
+ type InferencePreflight,
48
+ InferencePreflightFromJSON,
49
+ InferencePreflightToJSON,
50
+ } from '../models/InferencePreflight';
51
+ import {
52
+ type Model,
53
+ ModelFromJSON,
54
+ ModelToJSON,
55
+ } from '../models/Model';
56
+ import {
57
+ type ModelList,
58
+ ModelListFromJSON,
59
+ ModelListToJSON,
60
+ } from '../models/ModelList';
61
+ import {
62
+ type OpenAIErrorEnvelope,
63
+ OpenAIErrorEnvelopeFromJSON,
64
+ OpenAIErrorEnvelopeToJSON,
65
+ } from '../models/OpenAIErrorEnvelope';
66
+ import {
67
+ type VideoCreateRequest,
68
+ VideoCreateRequestFromJSON,
69
+ VideoCreateRequestToJSON,
70
+ } from '../models/VideoCreateRequest';
71
+ import {
72
+ type VideoJob,
73
+ VideoJobFromJSON,
74
+ VideoJobToJSON,
75
+ } from '../models/VideoJob';
76
+ import {
77
+ type VideoList,
78
+ VideoListFromJSON,
79
+ VideoListToJSON,
80
+ } from '../models/VideoList';
81
+
82
+ export interface CancelVideoRequest {
83
+ id: string;
84
+ }
85
+
86
+ export interface CreateChatCompletionRequest {
87
+ chatCompletionRequest: ChatCompletionRequest;
88
+ }
89
+
90
+ export interface CreateEmbeddingsRequest {
91
+ embeddingsRequest: EmbeddingsRequest;
92
+ }
93
+
94
+ export interface CreateImageRequest {
95
+ imagesGenerationsRequest: ImagesGenerationsRequest;
96
+ idempotencyKey?: string;
97
+ }
98
+
99
+ export interface CreateVideoRequest {
100
+ videoCreateRequest: VideoCreateRequest;
101
+ idempotencyKey?: string;
102
+ }
103
+
104
+ export interface GetModelRequest {
105
+ id: string;
106
+ }
107
+
108
+ export interface GetVideoRequest {
109
+ id: string;
110
+ }
111
+
112
+ export interface GetVideoContentRequest {
113
+ id: string;
114
+ }
115
+
116
+ export interface InferencePreflightRequest {
117
+ model: string;
118
+ }
119
+
120
+ export interface ListModelsRequest {
121
+ modality?: ListModelsModalityEnum;
122
+ }
123
+
124
+ export interface ListVideosRequest {
125
+ after?: string;
126
+ limit?: number;
127
+ }
128
+
129
+ /**
130
+ *
131
+ */
132
+ export class InferenceApi extends runtime.BaseAPI {
133
+
134
+ /**
135
+ * Creates request options for cancelVideo without sending the request
136
+ */
137
+ async cancelVideoRequestOpts(requestParameters: CancelVideoRequest): Promise<runtime.RequestOpts> {
138
+ if (requestParameters['id'] == null) {
139
+ throw new runtime.RequiredError(
140
+ 'id',
141
+ 'Required parameter "id" was null or undefined when calling cancelVideo().'
142
+ );
143
+ }
144
+
145
+ const queryParameters: any = {};
146
+
147
+ const headerParameters: runtime.HTTPHeaders = {};
148
+
149
+ if (this.configuration && this.configuration.accessToken) {
150
+ const token = this.configuration.accessToken;
151
+ const tokenString = await token("bearerAuth", []);
152
+
153
+ if (tokenString) {
154
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
155
+ }
156
+ }
157
+
158
+ let urlPath = `/videos/{id}/cancel`;
159
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
160
+
161
+ return {
162
+ path: urlPath,
163
+ method: 'POST',
164
+ headers: headerParameters,
165
+ query: queryParameters,
166
+ };
167
+ }
168
+
169
+ /**
170
+ * Cancel a video generation job
171
+ */
172
+ async cancelVideoRaw(requestParameters: CancelVideoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VideoJob>> {
173
+ const requestOptions = await this.cancelVideoRequestOpts(requestParameters);
174
+ const response = await this.request(requestOptions, initOverrides);
175
+
176
+ return new runtime.JSONApiResponse(response, (jsonValue) => VideoJobFromJSON(jsonValue));
177
+ }
178
+
179
+ /**
180
+ * Cancel a video generation job
181
+ */
182
+ async cancelVideo(requestParameters: CancelVideoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VideoJob> {
183
+ const response = await this.cancelVideoRaw(requestParameters, initOverrides);
184
+ return await response.value();
185
+ }
186
+
187
+ /**
188
+ * Creates request options for createChatCompletion without sending the request
189
+ */
190
+ async createChatCompletionRequestOpts(requestParameters: CreateChatCompletionRequest): Promise<runtime.RequestOpts> {
191
+ if (requestParameters['chatCompletionRequest'] == null) {
192
+ throw new runtime.RequiredError(
193
+ 'chatCompletionRequest',
194
+ 'Required parameter "chatCompletionRequest" was null or undefined when calling createChatCompletion().'
195
+ );
196
+ }
197
+
198
+ const queryParameters: any = {};
199
+
200
+ const headerParameters: runtime.HTTPHeaders = {};
201
+
202
+ headerParameters['Content-Type'] = 'application/json';
203
+
204
+ if (this.configuration && this.configuration.accessToken) {
205
+ const token = this.configuration.accessToken;
206
+ const tokenString = await token("bearerAuth", []);
207
+
208
+ if (tokenString) {
209
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
210
+ }
211
+ }
212
+
213
+ let urlPath = `/chat/completions`;
214
+
215
+ return {
216
+ path: urlPath,
217
+ method: 'POST',
218
+ headers: headerParameters,
219
+ query: queryParameters,
220
+ body: ChatCompletionRequestToJSON(requestParameters['chatCompletionRequest']),
221
+ };
222
+ }
223
+
224
+ /**
225
+ * Create a chat completion (OpenAI-compatible)
226
+ */
227
+ async createChatCompletionRaw(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>> {
228
+ const requestOptions = await this.createChatCompletionRequestOpts(requestParameters);
229
+ const response = await this.request(requestOptions, initOverrides);
230
+
231
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChatCompletionResponseFromJSON(jsonValue));
232
+ }
233
+
234
+ /**
235
+ * Create a chat completion (OpenAI-compatible)
236
+ */
237
+ async createChatCompletion(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse> {
238
+ const response = await this.createChatCompletionRaw(requestParameters, initOverrides);
239
+ return await response.value();
240
+ }
241
+
242
+ /**
243
+ * Creates request options for createEmbeddings without sending the request
244
+ */
245
+ async createEmbeddingsRequestOpts(requestParameters: CreateEmbeddingsRequest): Promise<runtime.RequestOpts> {
246
+ if (requestParameters['embeddingsRequest'] == null) {
247
+ throw new runtime.RequiredError(
248
+ 'embeddingsRequest',
249
+ 'Required parameter "embeddingsRequest" was null or undefined when calling createEmbeddings().'
250
+ );
251
+ }
252
+
253
+ const queryParameters: any = {};
254
+
255
+ const headerParameters: runtime.HTTPHeaders = {};
256
+
257
+ headerParameters['Content-Type'] = 'application/json';
258
+
259
+ if (this.configuration && this.configuration.accessToken) {
260
+ const token = this.configuration.accessToken;
261
+ const tokenString = await token("bearerAuth", []);
262
+
263
+ if (tokenString) {
264
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
265
+ }
266
+ }
267
+
268
+ let urlPath = `/embeddings`;
269
+
270
+ return {
271
+ path: urlPath,
272
+ method: 'POST',
273
+ headers: headerParameters,
274
+ query: queryParameters,
275
+ body: EmbeddingsRequestToJSON(requestParameters['embeddingsRequest']),
276
+ };
277
+ }
278
+
279
+ /**
280
+ * Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
281
+ * Create embeddings (OpenAI-compatible)
282
+ */
283
+ async createEmbeddingsRaw(requestParameters: CreateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmbeddingsResponse>> {
284
+ const requestOptions = await this.createEmbeddingsRequestOpts(requestParameters);
285
+ const response = await this.request(requestOptions, initOverrides);
286
+
287
+ return new runtime.JSONApiResponse(response, (jsonValue) => EmbeddingsResponseFromJSON(jsonValue));
288
+ }
289
+
290
+ /**
291
+ * Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
292
+ * Create embeddings (OpenAI-compatible)
293
+ */
294
+ async createEmbeddings(requestParameters: CreateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmbeddingsResponse> {
295
+ const response = await this.createEmbeddingsRaw(requestParameters, initOverrides);
296
+ return await response.value();
297
+ }
298
+
299
+ /**
300
+ * Creates request options for createImage without sending the request
301
+ */
302
+ async createImageRequestOpts(requestParameters: CreateImageRequest): Promise<runtime.RequestOpts> {
303
+ if (requestParameters['imagesGenerationsRequest'] == null) {
304
+ throw new runtime.RequiredError(
305
+ 'imagesGenerationsRequest',
306
+ 'Required parameter "imagesGenerationsRequest" was null or undefined when calling createImage().'
307
+ );
308
+ }
309
+
310
+ const queryParameters: any = {};
311
+
312
+ const headerParameters: runtime.HTTPHeaders = {};
313
+
314
+ headerParameters['Content-Type'] = 'application/json';
315
+
316
+ if (requestParameters['idempotencyKey'] != null) {
317
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
318
+ }
319
+
320
+ if (this.configuration && this.configuration.accessToken) {
321
+ const token = this.configuration.accessToken;
322
+ const tokenString = await token("bearerAuth", []);
323
+
324
+ if (tokenString) {
325
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
326
+ }
327
+ }
328
+
329
+ let urlPath = `/images/generations`;
330
+
331
+ return {
332
+ path: urlPath,
333
+ method: 'POST',
334
+ headers: headerParameters,
335
+ query: queryParameters,
336
+ body: ImagesGenerationsRequestToJSON(requestParameters['imagesGenerationsRequest']),
337
+ };
338
+ }
339
+
340
+ /**
341
+ * Synchronous text-to-image generation. Returns base64-encoded images only (`response_format` is restricted to `b64_json`); a value of `url` is rejected with `invalid_request_error` until S3-backed URL delivery lands. Pass an `Idempotency-Key` header to make a retried request replay the original response without a second charge.
342
+ * Create image (OpenAI-compatible)
343
+ */
344
+ async createImageRaw(requestParameters: CreateImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ImagesResponse>> {
345
+ const requestOptions = await this.createImageRequestOpts(requestParameters);
346
+ const response = await this.request(requestOptions, initOverrides);
347
+
348
+ return new runtime.JSONApiResponse(response, (jsonValue) => ImagesResponseFromJSON(jsonValue));
349
+ }
350
+
351
+ /**
352
+ * Synchronous text-to-image generation. Returns base64-encoded images only (`response_format` is restricted to `b64_json`); a value of `url` is rejected with `invalid_request_error` until S3-backed URL delivery lands. Pass an `Idempotency-Key` header to make a retried request replay the original response without a second charge.
353
+ * Create image (OpenAI-compatible)
354
+ */
355
+ async createImage(requestParameters: CreateImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ImagesResponse> {
356
+ const response = await this.createImageRaw(requestParameters, initOverrides);
357
+ return await response.value();
358
+ }
359
+
360
+ /**
361
+ * Creates request options for createVideo without sending the request
362
+ */
363
+ async createVideoRequestOpts(requestParameters: CreateVideoRequest): Promise<runtime.RequestOpts> {
364
+ if (requestParameters['videoCreateRequest'] == null) {
365
+ throw new runtime.RequiredError(
366
+ 'videoCreateRequest',
367
+ 'Required parameter "videoCreateRequest" was null or undefined when calling createVideo().'
368
+ );
369
+ }
370
+
371
+ const queryParameters: any = {};
372
+
373
+ const headerParameters: runtime.HTTPHeaders = {};
374
+
375
+ headerParameters['Content-Type'] = 'application/json';
376
+
377
+ if (requestParameters['idempotencyKey'] != null) {
378
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
379
+ }
380
+
381
+ if (this.configuration && this.configuration.accessToken) {
382
+ const token = this.configuration.accessToken;
383
+ const tokenString = await token("bearerAuth", []);
384
+
385
+ if (tokenString) {
386
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
387
+ }
388
+ }
389
+
390
+ let urlPath = `/videos`;
391
+
392
+ return {
393
+ path: urlPath,
394
+ method: 'POST',
395
+ headers: headerParameters,
396
+ query: queryParameters,
397
+ body: VideoCreateRequestToJSON(requestParameters['videoCreateRequest']),
398
+ };
399
+ }
400
+
401
+ /**
402
+ * Submit an asynchronous text-to-video generation job. Returns a job object with status `queued`; poll GET /videos/{id} until `completed`, then stream the result from GET /videos/{id}/content. Pass an `Idempotency-Key` header to make a retried request replay the original response without a second charge.
403
+ * Create a video generation job (async)
404
+ */
405
+ async createVideoRaw(requestParameters: CreateVideoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VideoJob>> {
406
+ const requestOptions = await this.createVideoRequestOpts(requestParameters);
407
+ const response = await this.request(requestOptions, initOverrides);
408
+
409
+ return new runtime.JSONApiResponse(response, (jsonValue) => VideoJobFromJSON(jsonValue));
410
+ }
411
+
412
+ /**
413
+ * Submit an asynchronous text-to-video generation job. Returns a job object with status `queued`; poll GET /videos/{id} until `completed`, then stream the result from GET /videos/{id}/content. Pass an `Idempotency-Key` header to make a retried request replay the original response without a second charge.
414
+ * Create a video generation job (async)
415
+ */
416
+ async createVideo(requestParameters: CreateVideoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VideoJob> {
417
+ const response = await this.createVideoRaw(requestParameters, initOverrides);
418
+ return await response.value();
419
+ }
420
+
421
+ /**
422
+ * Creates request options for getModel without sending the request
423
+ */
424
+ async getModelRequestOpts(requestParameters: GetModelRequest): Promise<runtime.RequestOpts> {
425
+ if (requestParameters['id'] == null) {
426
+ throw new runtime.RequiredError(
427
+ 'id',
428
+ 'Required parameter "id" was null or undefined when calling getModel().'
429
+ );
430
+ }
431
+
432
+ const queryParameters: any = {};
433
+
434
+ const headerParameters: runtime.HTTPHeaders = {};
435
+
436
+ if (this.configuration && this.configuration.accessToken) {
437
+ const token = this.configuration.accessToken;
438
+ const tokenString = await token("bearerAuth", []);
439
+
440
+ if (tokenString) {
441
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
442
+ }
443
+ }
444
+
445
+ let urlPath = `/models/{id}`;
446
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
447
+
448
+ return {
449
+ path: urlPath,
450
+ method: 'GET',
451
+ headers: headerParameters,
452
+ query: queryParameters,
453
+ };
454
+ }
455
+
456
+ /**
457
+ * Get a specific model (OpenAI-compatible)
458
+ */
459
+ async getModelRaw(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Model>> {
460
+ const requestOptions = await this.getModelRequestOpts(requestParameters);
461
+ const response = await this.request(requestOptions, initOverrides);
462
+
463
+ return new runtime.JSONApiResponse(response, (jsonValue) => ModelFromJSON(jsonValue));
464
+ }
465
+
466
+ /**
467
+ * Get a specific model (OpenAI-compatible)
468
+ */
469
+ async getModel(requestParameters: GetModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Model> {
470
+ const response = await this.getModelRaw(requestParameters, initOverrides);
471
+ return await response.value();
472
+ }
473
+
474
+ /**
475
+ * Creates request options for getVideo without sending the request
476
+ */
477
+ async getVideoRequestOpts(requestParameters: GetVideoRequest): Promise<runtime.RequestOpts> {
478
+ if (requestParameters['id'] == null) {
479
+ throw new runtime.RequiredError(
480
+ 'id',
481
+ 'Required parameter "id" was null or undefined when calling getVideo().'
482
+ );
483
+ }
484
+
485
+ const queryParameters: any = {};
486
+
487
+ const headerParameters: runtime.HTTPHeaders = {};
488
+
489
+ if (this.configuration && this.configuration.accessToken) {
490
+ const token = this.configuration.accessToken;
491
+ const tokenString = await token("bearerAuth", []);
492
+
493
+ if (tokenString) {
494
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
495
+ }
496
+ }
497
+
498
+ let urlPath = `/videos/{id}`;
499
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
500
+
501
+ return {
502
+ path: urlPath,
503
+ method: 'GET',
504
+ headers: headerParameters,
505
+ query: queryParameters,
506
+ };
507
+ }
508
+
509
+ /**
510
+ * Get a video generation job
511
+ */
512
+ async getVideoRaw(requestParameters: GetVideoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VideoJob>> {
513
+ const requestOptions = await this.getVideoRequestOpts(requestParameters);
514
+ const response = await this.request(requestOptions, initOverrides);
515
+
516
+ return new runtime.JSONApiResponse(response, (jsonValue) => VideoJobFromJSON(jsonValue));
517
+ }
518
+
519
+ /**
520
+ * Get a video generation job
521
+ */
522
+ async getVideo(requestParameters: GetVideoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VideoJob> {
523
+ const response = await this.getVideoRaw(requestParameters, initOverrides);
524
+ return await response.value();
525
+ }
526
+
527
+ /**
528
+ * Creates request options for getVideoContent without sending the request
529
+ */
530
+ async getVideoContentRequestOpts(requestParameters: GetVideoContentRequest): Promise<runtime.RequestOpts> {
531
+ if (requestParameters['id'] == null) {
532
+ throw new runtime.RequiredError(
533
+ 'id',
534
+ 'Required parameter "id" was null or undefined when calling getVideoContent().'
535
+ );
536
+ }
537
+
538
+ const queryParameters: any = {};
539
+
540
+ const headerParameters: runtime.HTTPHeaders = {};
541
+
542
+ if (this.configuration && this.configuration.accessToken) {
543
+ const token = this.configuration.accessToken;
544
+ const tokenString = await token("bearerAuth", []);
545
+
546
+ if (tokenString) {
547
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
548
+ }
549
+ }
550
+
551
+ let urlPath = `/videos/{id}/content`;
552
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
553
+
554
+ return {
555
+ path: urlPath,
556
+ method: 'GET',
557
+ headers: headerParameters,
558
+ query: queryParameters,
559
+ };
560
+ }
561
+
562
+ /**
563
+ * Streams the generated MP4 for a completed job. Returns 410 Gone once the artifact has expired (24h retention).
564
+ * Download a completed video artifact
565
+ */
566
+ async getVideoContentRaw(requestParameters: GetVideoContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
567
+ const requestOptions = await this.getVideoContentRequestOpts(requestParameters);
568
+ const response = await this.request(requestOptions, initOverrides);
569
+
570
+ return new runtime.BlobApiResponse(response);
571
+ }
572
+
573
+ /**
574
+ * Streams the generated MP4 for a completed job. Returns 410 Gone once the artifact has expired (24h retention).
575
+ * Download a completed video artifact
576
+ */
577
+ async getVideoContent(requestParameters: GetVideoContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
578
+ const response = await this.getVideoContentRaw(requestParameters, initOverrides);
579
+ return await response.value();
580
+ }
581
+
582
+ /**
583
+ * Creates request options for inferencePreflight without sending the request
584
+ */
585
+ async inferencePreflightRequestOpts(requestParameters: InferencePreflightRequest): Promise<runtime.RequestOpts> {
586
+ if (requestParameters['model'] == null) {
587
+ throw new runtime.RequiredError(
588
+ 'model',
589
+ 'Required parameter "model" was null or undefined when calling inferencePreflight().'
590
+ );
591
+ }
592
+
593
+ const queryParameters: any = {};
594
+
595
+ if (requestParameters['model'] != null) {
596
+ queryParameters['model'] = requestParameters['model'];
597
+ }
598
+
599
+ const headerParameters: runtime.HTTPHeaders = {};
600
+
601
+ if (this.configuration && this.configuration.accessToken) {
602
+ const token = this.configuration.accessToken;
603
+ const tokenString = await token("bearerAuth", []);
604
+
605
+ if (tokenString) {
606
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
607
+ }
608
+ }
609
+
610
+ let urlPath = `/inference/preflight`;
611
+
612
+ return {
613
+ path: urlPath,
614
+ method: 'GET',
615
+ headers: headerParameters,
616
+ query: queryParameters,
617
+ };
618
+ }
619
+
620
+ /**
621
+ * Answers \"what happens if I call this model right now?\" before the call is made: whether the plan covers the model, whether the organization is subscribed, and whether there is credit to pay if it is not covered. Requires the `serverless:read` scope. Nothing is sent, counted, charged, or reserved. The verdict is computed from the state of the SAME gates that judge the real request — plan coverage, subscription entitlement, remaining plan quota, credit balance and self-set spending caps — so the advice cannot drift from enforcement. It is deliberately NOT a dry run: no per-request cost estimate is quoted, because that figure changes with every prompt and quoting it would invite clients to cache it. The gates consulted depend on the model\'s MODALITY, because the endpoints do not all meet the same ones. Chat, embeddings and image requests meet the full gate (balance, then the organization\'s opt-in daily cap, then its monthly cap). Video creation meets only the balance check, so an organization past its own spending cap but holding credit is reported as fundable for video — which is what the video endpoint will in fact do. Predicting the strictest gate rather than the applicable one would make this endpoint refuse requests the API accepts. The same is true of the plan: video creation does not run the subscription gate, so `plan_covered` is false for a video model even if an operator has placed it on the plan\'s covered list. That is a deliberate divergence from the same-named field on `/v1/models`, which reports the platform\'s configuration. Here it means \"the plan covers this REQUEST\" — describing what will happen is the entire job of a preflight. One caveat on \"read-only\": resolving the balance creates the organization\'s balance row if it has never had one (idempotent, org-scoped, and the same row the first real request would create). Nothing else is written. The case this exists for is `warn` / `not_plan_covered`. A subscriber calling a model outside the plan IS served and IS charged pay-as-you-go, and nothing in the response to that request says so — the first signal used to be the invoice. `funded` is a boolean and never a figure. This route is on the inference read scope, so it must not disclose the organization\'s balance; use `/billing/balance` for the number. Failure posture is the opposite of the request gate\'s: any gate that cannot be read degrades the verdict toward `ok`, never toward `block`. A false `block` would stop a customer whose request would have succeeded, while a false `ok` costs them one honest error from the real call.
622
+ * Check whether a model request would be served, and at whose expense
623
+ */
624
+ async inferencePreflightRaw(requestParameters: InferencePreflightRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InferencePreflight>> {
625
+ const requestOptions = await this.inferencePreflightRequestOpts(requestParameters);
626
+ const response = await this.request(requestOptions, initOverrides);
627
+
628
+ return new runtime.JSONApiResponse(response, (jsonValue) => InferencePreflightFromJSON(jsonValue));
629
+ }
630
+
631
+ /**
632
+ * Answers \"what happens if I call this model right now?\" before the call is made: whether the plan covers the model, whether the organization is subscribed, and whether there is credit to pay if it is not covered. Requires the `serverless:read` scope. Nothing is sent, counted, charged, or reserved. The verdict is computed from the state of the SAME gates that judge the real request — plan coverage, subscription entitlement, remaining plan quota, credit balance and self-set spending caps — so the advice cannot drift from enforcement. It is deliberately NOT a dry run: no per-request cost estimate is quoted, because that figure changes with every prompt and quoting it would invite clients to cache it. The gates consulted depend on the model\'s MODALITY, because the endpoints do not all meet the same ones. Chat, embeddings and image requests meet the full gate (balance, then the organization\'s opt-in daily cap, then its monthly cap). Video creation meets only the balance check, so an organization past its own spending cap but holding credit is reported as fundable for video — which is what the video endpoint will in fact do. Predicting the strictest gate rather than the applicable one would make this endpoint refuse requests the API accepts. The same is true of the plan: video creation does not run the subscription gate, so `plan_covered` is false for a video model even if an operator has placed it on the plan\'s covered list. That is a deliberate divergence from the same-named field on `/v1/models`, which reports the platform\'s configuration. Here it means \"the plan covers this REQUEST\" — describing what will happen is the entire job of a preflight. One caveat on \"read-only\": resolving the balance creates the organization\'s balance row if it has never had one (idempotent, org-scoped, and the same row the first real request would create). Nothing else is written. The case this exists for is `warn` / `not_plan_covered`. A subscriber calling a model outside the plan IS served and IS charged pay-as-you-go, and nothing in the response to that request says so — the first signal used to be the invoice. `funded` is a boolean and never a figure. This route is on the inference read scope, so it must not disclose the organization\'s balance; use `/billing/balance` for the number. Failure posture is the opposite of the request gate\'s: any gate that cannot be read degrades the verdict toward `ok`, never toward `block`. A false `block` would stop a customer whose request would have succeeded, while a false `ok` costs them one honest error from the real call.
633
+ * Check whether a model request would be served, and at whose expense
634
+ */
635
+ async inferencePreflight(requestParameters: InferencePreflightRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InferencePreflight> {
636
+ const response = await this.inferencePreflightRaw(requestParameters, initOverrides);
637
+ return await response.value();
638
+ }
639
+
640
+ /**
641
+ * Creates request options for listModels without sending the request
642
+ */
643
+ async listModelsRequestOpts(requestParameters: ListModelsRequest): Promise<runtime.RequestOpts> {
644
+ const queryParameters: any = {};
645
+
646
+ if (requestParameters['modality'] != null) {
647
+ queryParameters['modality'] = requestParameters['modality'];
648
+ }
649
+
650
+ const headerParameters: runtime.HTTPHeaders = {};
651
+
652
+ if (this.configuration && this.configuration.accessToken) {
653
+ const token = this.configuration.accessToken;
654
+ const tokenString = await token("bearerAuth", []);
655
+
656
+ if (tokenString) {
657
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
658
+ }
659
+ }
660
+
661
+ let urlPath = `/models`;
662
+
663
+ return {
664
+ path: urlPath,
665
+ method: 'GET',
666
+ headers: headerParameters,
667
+ query: queryParameters,
668
+ };
669
+ }
670
+
671
+ /**
672
+ * List available models (OpenAI-compatible)
673
+ */
674
+ async listModelsRaw(requestParameters: ListModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelList>> {
675
+ const requestOptions = await this.listModelsRequestOpts(requestParameters);
676
+ const response = await this.request(requestOptions, initOverrides);
677
+
678
+ return new runtime.JSONApiResponse(response, (jsonValue) => ModelListFromJSON(jsonValue));
679
+ }
680
+
681
+ /**
682
+ * List available models (OpenAI-compatible)
683
+ */
684
+ async listModels(requestParameters: ListModelsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelList> {
685
+ const response = await this.listModelsRaw(requestParameters, initOverrides);
686
+ return await response.value();
687
+ }
688
+
689
+ /**
690
+ * Creates request options for listVideos without sending the request
691
+ */
692
+ async listVideosRequestOpts(requestParameters: ListVideosRequest): Promise<runtime.RequestOpts> {
693
+ const queryParameters: any = {};
694
+
695
+ if (requestParameters['after'] != null) {
696
+ queryParameters['after'] = requestParameters['after'];
697
+ }
698
+
699
+ if (requestParameters['limit'] != null) {
700
+ queryParameters['limit'] = requestParameters['limit'];
701
+ }
702
+
703
+ const headerParameters: runtime.HTTPHeaders = {};
704
+
705
+ if (this.configuration && this.configuration.accessToken) {
706
+ const token = this.configuration.accessToken;
707
+ const tokenString = await token("bearerAuth", []);
708
+
709
+ if (tokenString) {
710
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
711
+ }
712
+ }
713
+
714
+ let urlPath = `/videos`;
715
+
716
+ return {
717
+ path: urlPath,
718
+ method: 'GET',
719
+ headers: headerParameters,
720
+ query: queryParameters,
721
+ };
722
+ }
723
+
724
+ /**
725
+ * List video generation jobs
726
+ */
727
+ async listVideosRaw(requestParameters: ListVideosRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VideoList>> {
728
+ const requestOptions = await this.listVideosRequestOpts(requestParameters);
729
+ const response = await this.request(requestOptions, initOverrides);
730
+
731
+ return new runtime.JSONApiResponse(response, (jsonValue) => VideoListFromJSON(jsonValue));
732
+ }
733
+
734
+ /**
735
+ * List video generation jobs
736
+ */
737
+ async listVideos(requestParameters: ListVideosRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VideoList> {
738
+ const response = await this.listVideosRaw(requestParameters, initOverrides);
739
+ return await response.value();
740
+ }
741
+
742
+ }
743
+
744
+ /**
745
+ * @export
746
+ */
747
+ export const ListModelsModalityEnum = {
748
+ Chat: 'chat',
749
+ Image: 'image',
750
+ Video: 'video',
751
+ Embedding: 'embedding'
752
+ } as const;
753
+ export type ListModelsModalityEnum = typeof ListModelsModalityEnum[keyof typeof ListModelsModalityEnum];