@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,169 @@
1
+ /**
2
+ * deeprelay Public Developer API
3
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@deeprelay.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import { type Balance } from '../models/Balance';
14
+ import { type CreateCryptoDepositRequest } from '../models/CreateCryptoDepositRequest';
15
+ import { type CryptoDeposit } from '../models/CryptoDeposit';
16
+ import { type ListDeposits200Response } from '../models/ListDeposits200Response';
17
+ import { type SpendingLimit } from '../models/SpendingLimit';
18
+ import { type Subscription } from '../models/Subscription';
19
+ import { type SubscriptionCheckoutRequest } from '../models/SubscriptionCheckoutRequest';
20
+ import { type SubscriptionCheckoutSession } from '../models/SubscriptionCheckoutSession';
21
+ import { type SubscriptionPortalRequest } from '../models/SubscriptionPortalRequest';
22
+ import { type SubscriptionPortalSession } from '../models/SubscriptionPortalSession';
23
+ import { type UpdateSpendingLimitRequest } from '../models/UpdateSpendingLimitRequest';
24
+ export interface CreateCryptoDepositOperationRequest {
25
+ createCryptoDepositRequest: CreateCryptoDepositRequest;
26
+ }
27
+ export interface CreateSubscriptionCheckoutRequest {
28
+ subscriptionCheckoutRequest?: SubscriptionCheckoutRequest;
29
+ }
30
+ export interface CreateSubscriptionPortalRequest {
31
+ subscriptionPortalRequest?: SubscriptionPortalRequest;
32
+ }
33
+ export interface GetDepositRequest {
34
+ id: string;
35
+ }
36
+ export interface UpdateSpendingLimitOperationRequest {
37
+ updateSpendingLimitRequest: UpdateSpendingLimitRequest;
38
+ }
39
+ /**
40
+ *
41
+ */
42
+ export declare class BillingApi extends runtime.BaseAPI {
43
+ /**
44
+ * Creates request options for createCryptoDeposit without sending the request
45
+ */
46
+ createCryptoDepositRequestOpts(requestParameters: CreateCryptoDepositOperationRequest): Promise<runtime.RequestOpts>;
47
+ /**
48
+ * Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
49
+ * Create a stablecoin deposit
50
+ */
51
+ createCryptoDepositRaw(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CryptoDeposit>>;
52
+ /**
53
+ * Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
54
+ * Create a stablecoin deposit
55
+ */
56
+ createCryptoDeposit(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
57
+ /**
58
+ * Creates request options for createSubscriptionCheckout without sending the request
59
+ */
60
+ createSubscriptionCheckoutRequestOpts(requestParameters: CreateSubscriptionCheckoutRequest): Promise<runtime.RequestOpts>;
61
+ /**
62
+ * Opens a hosted checkout session for the flat tier and returns its URL. Requires the `billing:write` scope AND organization-admin privileges — subscribing spends organization money. This endpoint does NOT subscribe anyone. Checkout is a hosted page that needs a browser and a card, so the caller\'s job is to put the returned URL in front of a human. The subscription becomes active when payment completes, which is not synchronous with this call: poll `/billing/subscription` to confirm. `success_url` and `cancel_url` are optional and fall back to the deployment\'s configured redirects, which is what lets a command-line client start a purchase without having any URLs of its own. An empty request body is valid and means \"use every default\". `plan_key`, when sent, pins the plan the client DISPLAYED: an unknown key is a 400 rather than a silent purchase of a different tier. Today there is one tier, so the only accepted value is its key — but sending it is the forward-compatible choice. One flat tier means at most one subscription per organization: a second checkout while an entitling subscription exists is a 409.
63
+ * Start a subscription checkout session
64
+ */
65
+ createSubscriptionCheckoutRaw(requestParameters: CreateSubscriptionCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionCheckoutSession>>;
66
+ /**
67
+ * Opens a hosted checkout session for the flat tier and returns its URL. Requires the `billing:write` scope AND organization-admin privileges — subscribing spends organization money. This endpoint does NOT subscribe anyone. Checkout is a hosted page that needs a browser and a card, so the caller\'s job is to put the returned URL in front of a human. The subscription becomes active when payment completes, which is not synchronous with this call: poll `/billing/subscription` to confirm. `success_url` and `cancel_url` are optional and fall back to the deployment\'s configured redirects, which is what lets a command-line client start a purchase without having any URLs of its own. An empty request body is valid and means \"use every default\". `plan_key`, when sent, pins the plan the client DISPLAYED: an unknown key is a 400 rather than a silent purchase of a different tier. Today there is one tier, so the only accepted value is its key — but sending it is the forward-compatible choice. One flat tier means at most one subscription per organization: a second checkout while an entitling subscription exists is a 409.
68
+ * Start a subscription checkout session
69
+ */
70
+ createSubscriptionCheckout(requestParameters?: CreateSubscriptionCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionCheckoutSession>;
71
+ /**
72
+ * Creates request options for createSubscriptionPortal without sending the request
73
+ */
74
+ createSubscriptionPortalRequestOpts(requestParameters: CreateSubscriptionPortalRequest): Promise<runtime.RequestOpts>;
75
+ /**
76
+ * Returns a URL for the hosted billing portal: where a customer cancels the subscription, resumes one they cancelled, changes payment method, or downloads invoices. Requires the `billing:write` scope AND organization-admin privileges. Cancellation lives here rather than on its own endpoint because it is one surface with the rest of the billing lifecycle. The common reason a subscription is about to lapse is a declined card, and the fix for that is a new card, not a cancellation — sending a customer somewhere that can only cancel would lose renewals. Cancelling in the portal ends the subscription at the close of the current period; coverage continues until then and `/billing/subscription` reports `cancel_at_period_end: true`. An organization that has never paid for anything gets 404: there is no billing account to manage, and this endpoint deliberately does not create one as a side effect of looking.
77
+ * Open the billing portal to cancel or manage the subscription
78
+ */
79
+ createSubscriptionPortalRaw(requestParameters: CreateSubscriptionPortalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPortalSession>>;
80
+ /**
81
+ * Returns a URL for the hosted billing portal: where a customer cancels the subscription, resumes one they cancelled, changes payment method, or downloads invoices. Requires the `billing:write` scope AND organization-admin privileges. Cancellation lives here rather than on its own endpoint because it is one surface with the rest of the billing lifecycle. The common reason a subscription is about to lapse is a declined card, and the fix for that is a new card, not a cancellation — sending a customer somewhere that can only cancel would lose renewals. Cancelling in the portal ends the subscription at the close of the current period; coverage continues until then and `/billing/subscription` reports `cancel_at_period_end: true`. An organization that has never paid for anything gets 404: there is no billing account to manage, and this endpoint deliberately does not create one as a side effect of looking.
82
+ * Open the billing portal to cancel or manage the subscription
83
+ */
84
+ createSubscriptionPortal(requestParameters?: CreateSubscriptionPortalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPortalSession>;
85
+ /**
86
+ * Creates request options for getBalance without sending the request
87
+ */
88
+ getBalanceRequestOpts(): Promise<runtime.RequestOpts>;
89
+ /**
90
+ * Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
91
+ * Get the org credit balance
92
+ */
93
+ getBalanceRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Balance>>;
94
+ /**
95
+ * Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
96
+ * Get the org credit balance
97
+ */
98
+ getBalance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Balance>;
99
+ /**
100
+ * Creates request options for getDeposit without sending the request
101
+ */
102
+ getDepositRequestOpts(requestParameters: GetDepositRequest): Promise<runtime.RequestOpts>;
103
+ /**
104
+ * Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
105
+ * Get one stablecoin deposit
106
+ */
107
+ getDepositRaw(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CryptoDeposit>>;
108
+ /**
109
+ * Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
110
+ * Get one stablecoin deposit
111
+ */
112
+ getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
113
+ /**
114
+ * Creates request options for getSpendingLimit without sending the request
115
+ */
116
+ getSpendingLimitRequestOpts(): Promise<runtime.RequestOpts>;
117
+ /**
118
+ * Returns the organization\'s monthly spending limit and opt-in daily spend cap, with the current month and day spend. Requires the `billing:read` scope. Returns 404 when no limit is configured.
119
+ * Get the org spending limit
120
+ */
121
+ getSpendingLimitRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SpendingLimit>>;
122
+ /**
123
+ * Returns the organization\'s monthly spending limit and opt-in daily spend cap, with the current month and day spend. Requires the `billing:read` scope. Returns 404 when no limit is configured.
124
+ * Get the org spending limit
125
+ */
126
+ getSpendingLimit(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SpendingLimit>;
127
+ /**
128
+ * Creates request options for getSubscription without sending the request
129
+ */
130
+ getSubscriptionRequestOpts(): Promise<runtime.RequestOpts>;
131
+ /**
132
+ * Returns the organization\'s flat-tier subscription: whether it is entitled, the current billing period, the plan\'s configured quota, and — for an entitled subscription — consumption against the four limits the server enforces on every request. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. An organization that never subscribed is NOT an error. It gets 200 with `subscribed: false`, `status: \"none\"` and the quota the plan would provide, so a client can answer \"what does the plan include\" without a second endpoint and without an error path. Read `subscribed`, not `status`, to decide whether the plan applies: `status` carries the billing provider\'s vocabulary, and the two can disagree — an `active` subscription just past its period end still entitles for a short grace window (renewal-webhook lag), while `past_due` and `canceled` never entitle. `usage` is present only for an entitled subscription whose meter could be read. An absent `usage` NEVER means \"nothing used\" — reading it as zero would report a full quota to an organization that has none left. This is the plan\'s meter. For pay-as-you-go credit see `/billing/balance`, for spend against a self-set cap see `/billing/spending-limit`, and for past consumption see `/usage`.
133
+ * Get the org subscription status and quota usage
134
+ */
135
+ getSubscriptionRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Subscription>>;
136
+ /**
137
+ * Returns the organization\'s flat-tier subscription: whether it is entitled, the current billing period, the plan\'s configured quota, and — for an entitled subscription — consumption against the four limits the server enforces on every request. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. An organization that never subscribed is NOT an error. It gets 200 with `subscribed: false`, `status: \"none\"` and the quota the plan would provide, so a client can answer \"what does the plan include\" without a second endpoint and without an error path. Read `subscribed`, not `status`, to decide whether the plan applies: `status` carries the billing provider\'s vocabulary, and the two can disagree — an `active` subscription just past its period end still entitles for a short grace window (renewal-webhook lag), while `past_due` and `canceled` never entitle. `usage` is present only for an entitled subscription whose meter could be read. An absent `usage` NEVER means \"nothing used\" — reading it as zero would report a full quota to an organization that has none left. This is the plan\'s meter. For pay-as-you-go credit see `/billing/balance`, for spend against a self-set cap see `/billing/spending-limit`, and for past consumption see `/usage`.
138
+ * Get the org subscription status and quota usage
139
+ */
140
+ getSubscription(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Subscription>;
141
+ /**
142
+ * Creates request options for listDeposits without sending the request
143
+ */
144
+ listDepositsRequestOpts(): Promise<runtime.RequestOpts>;
145
+ /**
146
+ * Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
147
+ * List stablecoin deposits
148
+ */
149
+ listDepositsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListDeposits200Response>>;
150
+ /**
151
+ * Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
152
+ * List stablecoin deposits
153
+ */
154
+ listDeposits(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDeposits200Response>;
155
+ /**
156
+ * Creates request options for updateSpendingLimit without sending the request
157
+ */
158
+ updateSpendingLimitRequestOpts(requestParameters: UpdateSpendingLimitOperationRequest): Promise<runtime.RequestOpts>;
159
+ /**
160
+ * Sets the monthly spending limit and optionally sets or clears the opt-in daily spend cap. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). `daily_limit_dollars` uses pointer semantics: omit to leave the cap unchanged, 0 to clear it, a positive value to set it.
161
+ * Set the org spending limit
162
+ */
163
+ updateSpendingLimitRaw(requestParameters: UpdateSpendingLimitOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SpendingLimit>>;
164
+ /**
165
+ * Sets the monthly spending limit and optionally sets or clears the opt-in daily spend cap. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). `daily_limit_dollars` uses pointer semantics: omit to leave the cap unchanged, 0 to clear it, a positive value to set it.
166
+ * Set the org spending limit
167
+ */
168
+ updateSpendingLimit(requestParameters: UpdateSpendingLimitOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SpendingLimit>;
169
+ }
@@ -0,0 +1,457 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * deeprelay Public Developer API
6
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@deeprelay.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.BillingApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const Balance_1 = require("../models/Balance");
28
+ const CreateCryptoDepositRequest_1 = require("../models/CreateCryptoDepositRequest");
29
+ const CryptoDeposit_1 = require("../models/CryptoDeposit");
30
+ const ListDeposits200Response_1 = require("../models/ListDeposits200Response");
31
+ const SpendingLimit_1 = require("../models/SpendingLimit");
32
+ const Subscription_1 = require("../models/Subscription");
33
+ const SubscriptionCheckoutRequest_1 = require("../models/SubscriptionCheckoutRequest");
34
+ const SubscriptionCheckoutSession_1 = require("../models/SubscriptionCheckoutSession");
35
+ const SubscriptionPortalRequest_1 = require("../models/SubscriptionPortalRequest");
36
+ const SubscriptionPortalSession_1 = require("../models/SubscriptionPortalSession");
37
+ const UpdateSpendingLimitRequest_1 = require("../models/UpdateSpendingLimitRequest");
38
+ /**
39
+ *
40
+ */
41
+ class BillingApi extends runtime.BaseAPI {
42
+ /**
43
+ * Creates request options for createCryptoDeposit without sending the request
44
+ */
45
+ createCryptoDepositRequestOpts(requestParameters) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ if (requestParameters['createCryptoDepositRequest'] == null) {
48
+ throw new runtime.RequiredError('createCryptoDepositRequest', 'Required parameter "createCryptoDepositRequest" was null or undefined when calling createCryptoDeposit().');
49
+ }
50
+ const queryParameters = {};
51
+ const headerParameters = {};
52
+ headerParameters['Content-Type'] = 'application/json';
53
+ if (this.configuration && this.configuration.accessToken) {
54
+ const token = this.configuration.accessToken;
55
+ const tokenString = yield token("bearerAuth", []);
56
+ if (tokenString) {
57
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
58
+ }
59
+ }
60
+ let urlPath = `/billing/deposits/crypto`;
61
+ return {
62
+ path: urlPath,
63
+ method: 'POST',
64
+ headers: headerParameters,
65
+ query: queryParameters,
66
+ body: (0, CreateCryptoDepositRequest_1.CreateCryptoDepositRequestToJSON)(requestParameters['createCryptoDepositRequest']),
67
+ };
68
+ });
69
+ }
70
+ /**
71
+ * Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
72
+ * Create a stablecoin deposit
73
+ */
74
+ createCryptoDepositRaw(requestParameters, initOverrides) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ const requestOptions = yield this.createCryptoDepositRequestOpts(requestParameters);
77
+ const response = yield this.request(requestOptions, initOverrides);
78
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CryptoDeposit_1.CryptoDepositFromJSON)(jsonValue));
79
+ });
80
+ }
81
+ /**
82
+ * Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
83
+ * Create a stablecoin deposit
84
+ */
85
+ createCryptoDeposit(requestParameters, initOverrides) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ const response = yield this.createCryptoDepositRaw(requestParameters, initOverrides);
88
+ return yield response.value();
89
+ });
90
+ }
91
+ /**
92
+ * Creates request options for createSubscriptionCheckout without sending the request
93
+ */
94
+ createSubscriptionCheckoutRequestOpts(requestParameters) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ const queryParameters = {};
97
+ const headerParameters = {};
98
+ headerParameters['Content-Type'] = 'application/json';
99
+ if (this.configuration && this.configuration.accessToken) {
100
+ const token = this.configuration.accessToken;
101
+ const tokenString = yield token("bearerAuth", []);
102
+ if (tokenString) {
103
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
104
+ }
105
+ }
106
+ let urlPath = `/billing/subscription/checkout`;
107
+ return {
108
+ path: urlPath,
109
+ method: 'POST',
110
+ headers: headerParameters,
111
+ query: queryParameters,
112
+ body: (0, SubscriptionCheckoutRequest_1.SubscriptionCheckoutRequestToJSON)(requestParameters['subscriptionCheckoutRequest']),
113
+ };
114
+ });
115
+ }
116
+ /**
117
+ * Opens a hosted checkout session for the flat tier and returns its URL. Requires the `billing:write` scope AND organization-admin privileges — subscribing spends organization money. This endpoint does NOT subscribe anyone. Checkout is a hosted page that needs a browser and a card, so the caller\'s job is to put the returned URL in front of a human. The subscription becomes active when payment completes, which is not synchronous with this call: poll `/billing/subscription` to confirm. `success_url` and `cancel_url` are optional and fall back to the deployment\'s configured redirects, which is what lets a command-line client start a purchase without having any URLs of its own. An empty request body is valid and means \"use every default\". `plan_key`, when sent, pins the plan the client DISPLAYED: an unknown key is a 400 rather than a silent purchase of a different tier. Today there is one tier, so the only accepted value is its key — but sending it is the forward-compatible choice. One flat tier means at most one subscription per organization: a second checkout while an entitling subscription exists is a 409.
118
+ * Start a subscription checkout session
119
+ */
120
+ createSubscriptionCheckoutRaw(requestParameters, initOverrides) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ const requestOptions = yield this.createSubscriptionCheckoutRequestOpts(requestParameters);
123
+ const response = yield this.request(requestOptions, initOverrides);
124
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, SubscriptionCheckoutSession_1.SubscriptionCheckoutSessionFromJSON)(jsonValue));
125
+ });
126
+ }
127
+ /**
128
+ * Opens a hosted checkout session for the flat tier and returns its URL. Requires the `billing:write` scope AND organization-admin privileges — subscribing spends organization money. This endpoint does NOT subscribe anyone. Checkout is a hosted page that needs a browser and a card, so the caller\'s job is to put the returned URL in front of a human. The subscription becomes active when payment completes, which is not synchronous with this call: poll `/billing/subscription` to confirm. `success_url` and `cancel_url` are optional and fall back to the deployment\'s configured redirects, which is what lets a command-line client start a purchase without having any URLs of its own. An empty request body is valid and means \"use every default\". `plan_key`, when sent, pins the plan the client DISPLAYED: an unknown key is a 400 rather than a silent purchase of a different tier. Today there is one tier, so the only accepted value is its key — but sending it is the forward-compatible choice. One flat tier means at most one subscription per organization: a second checkout while an entitling subscription exists is a 409.
129
+ * Start a subscription checkout session
130
+ */
131
+ createSubscriptionCheckout() {
132
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
133
+ const response = yield this.createSubscriptionCheckoutRaw(requestParameters, initOverrides);
134
+ return yield response.value();
135
+ });
136
+ }
137
+ /**
138
+ * Creates request options for createSubscriptionPortal without sending the request
139
+ */
140
+ createSubscriptionPortalRequestOpts(requestParameters) {
141
+ return __awaiter(this, void 0, void 0, function* () {
142
+ const queryParameters = {};
143
+ const headerParameters = {};
144
+ headerParameters['Content-Type'] = 'application/json';
145
+ if (this.configuration && this.configuration.accessToken) {
146
+ const token = this.configuration.accessToken;
147
+ const tokenString = yield token("bearerAuth", []);
148
+ if (tokenString) {
149
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
150
+ }
151
+ }
152
+ let urlPath = `/billing/subscription/portal`;
153
+ return {
154
+ path: urlPath,
155
+ method: 'POST',
156
+ headers: headerParameters,
157
+ query: queryParameters,
158
+ body: (0, SubscriptionPortalRequest_1.SubscriptionPortalRequestToJSON)(requestParameters['subscriptionPortalRequest']),
159
+ };
160
+ });
161
+ }
162
+ /**
163
+ * Returns a URL for the hosted billing portal: where a customer cancels the subscription, resumes one they cancelled, changes payment method, or downloads invoices. Requires the `billing:write` scope AND organization-admin privileges. Cancellation lives here rather than on its own endpoint because it is one surface with the rest of the billing lifecycle. The common reason a subscription is about to lapse is a declined card, and the fix for that is a new card, not a cancellation — sending a customer somewhere that can only cancel would lose renewals. Cancelling in the portal ends the subscription at the close of the current period; coverage continues until then and `/billing/subscription` reports `cancel_at_period_end: true`. An organization that has never paid for anything gets 404: there is no billing account to manage, and this endpoint deliberately does not create one as a side effect of looking.
164
+ * Open the billing portal to cancel or manage the subscription
165
+ */
166
+ createSubscriptionPortalRaw(requestParameters, initOverrides) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ const requestOptions = yield this.createSubscriptionPortalRequestOpts(requestParameters);
169
+ const response = yield this.request(requestOptions, initOverrides);
170
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, SubscriptionPortalSession_1.SubscriptionPortalSessionFromJSON)(jsonValue));
171
+ });
172
+ }
173
+ /**
174
+ * Returns a URL for the hosted billing portal: where a customer cancels the subscription, resumes one they cancelled, changes payment method, or downloads invoices. Requires the `billing:write` scope AND organization-admin privileges. Cancellation lives here rather than on its own endpoint because it is one surface with the rest of the billing lifecycle. The common reason a subscription is about to lapse is a declined card, and the fix for that is a new card, not a cancellation — sending a customer somewhere that can only cancel would lose renewals. Cancelling in the portal ends the subscription at the close of the current period; coverage continues until then and `/billing/subscription` reports `cancel_at_period_end: true`. An organization that has never paid for anything gets 404: there is no billing account to manage, and this endpoint deliberately does not create one as a side effect of looking.
175
+ * Open the billing portal to cancel or manage the subscription
176
+ */
177
+ createSubscriptionPortal() {
178
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
179
+ const response = yield this.createSubscriptionPortalRaw(requestParameters, initOverrides);
180
+ return yield response.value();
181
+ });
182
+ }
183
+ /**
184
+ * Creates request options for getBalance without sending the request
185
+ */
186
+ getBalanceRequestOpts() {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ const queryParameters = {};
189
+ const headerParameters = {};
190
+ if (this.configuration && this.configuration.accessToken) {
191
+ const token = this.configuration.accessToken;
192
+ const tokenString = yield token("bearerAuth", []);
193
+ if (tokenString) {
194
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
195
+ }
196
+ }
197
+ let urlPath = `/billing/balance`;
198
+ return {
199
+ path: urlPath,
200
+ method: 'GET',
201
+ headers: headerParameters,
202
+ query: queryParameters,
203
+ };
204
+ });
205
+ }
206
+ /**
207
+ * Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
208
+ * Get the org credit balance
209
+ */
210
+ getBalanceRaw(initOverrides) {
211
+ return __awaiter(this, void 0, void 0, function* () {
212
+ const requestOptions = yield this.getBalanceRequestOpts();
213
+ const response = yield this.request(requestOptions, initOverrides);
214
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Balance_1.BalanceFromJSON)(jsonValue));
215
+ });
216
+ }
217
+ /**
218
+ * Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
219
+ * Get the org credit balance
220
+ */
221
+ getBalance(initOverrides) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ const response = yield this.getBalanceRaw(initOverrides);
224
+ return yield response.value();
225
+ });
226
+ }
227
+ /**
228
+ * Creates request options for getDeposit without sending the request
229
+ */
230
+ getDepositRequestOpts(requestParameters) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ if (requestParameters['id'] == null) {
233
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getDeposit().');
234
+ }
235
+ const queryParameters = {};
236
+ const headerParameters = {};
237
+ if (this.configuration && this.configuration.accessToken) {
238
+ const token = this.configuration.accessToken;
239
+ const tokenString = yield token("bearerAuth", []);
240
+ if (tokenString) {
241
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
242
+ }
243
+ }
244
+ let urlPath = `/billing/deposits/{id}`;
245
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
246
+ return {
247
+ path: urlPath,
248
+ method: 'GET',
249
+ headers: headerParameters,
250
+ query: queryParameters,
251
+ };
252
+ });
253
+ }
254
+ /**
255
+ * Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
256
+ * Get one stablecoin deposit
257
+ */
258
+ getDepositRaw(requestParameters, initOverrides) {
259
+ return __awaiter(this, void 0, void 0, function* () {
260
+ const requestOptions = yield this.getDepositRequestOpts(requestParameters);
261
+ const response = yield this.request(requestOptions, initOverrides);
262
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, CryptoDeposit_1.CryptoDepositFromJSON)(jsonValue));
263
+ });
264
+ }
265
+ /**
266
+ * Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
267
+ * Get one stablecoin deposit
268
+ */
269
+ getDeposit(requestParameters, initOverrides) {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ const response = yield this.getDepositRaw(requestParameters, initOverrides);
272
+ return yield response.value();
273
+ });
274
+ }
275
+ /**
276
+ * Creates request options for getSpendingLimit without sending the request
277
+ */
278
+ getSpendingLimitRequestOpts() {
279
+ return __awaiter(this, void 0, void 0, function* () {
280
+ const queryParameters = {};
281
+ const headerParameters = {};
282
+ if (this.configuration && this.configuration.accessToken) {
283
+ const token = this.configuration.accessToken;
284
+ const tokenString = yield token("bearerAuth", []);
285
+ if (tokenString) {
286
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
287
+ }
288
+ }
289
+ let urlPath = `/billing/spending-limit`;
290
+ return {
291
+ path: urlPath,
292
+ method: 'GET',
293
+ headers: headerParameters,
294
+ query: queryParameters,
295
+ };
296
+ });
297
+ }
298
+ /**
299
+ * Returns the organization\'s monthly spending limit and opt-in daily spend cap, with the current month and day spend. Requires the `billing:read` scope. Returns 404 when no limit is configured.
300
+ * Get the org spending limit
301
+ */
302
+ getSpendingLimitRaw(initOverrides) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const requestOptions = yield this.getSpendingLimitRequestOpts();
305
+ const response = yield this.request(requestOptions, initOverrides);
306
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, SpendingLimit_1.SpendingLimitFromJSON)(jsonValue));
307
+ });
308
+ }
309
+ /**
310
+ * Returns the organization\'s monthly spending limit and opt-in daily spend cap, with the current month and day spend. Requires the `billing:read` scope. Returns 404 when no limit is configured.
311
+ * Get the org spending limit
312
+ */
313
+ getSpendingLimit(initOverrides) {
314
+ return __awaiter(this, void 0, void 0, function* () {
315
+ const response = yield this.getSpendingLimitRaw(initOverrides);
316
+ return yield response.value();
317
+ });
318
+ }
319
+ /**
320
+ * Creates request options for getSubscription without sending the request
321
+ */
322
+ getSubscriptionRequestOpts() {
323
+ return __awaiter(this, void 0, void 0, function* () {
324
+ const queryParameters = {};
325
+ const headerParameters = {};
326
+ if (this.configuration && this.configuration.accessToken) {
327
+ const token = this.configuration.accessToken;
328
+ const tokenString = yield token("bearerAuth", []);
329
+ if (tokenString) {
330
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
331
+ }
332
+ }
333
+ let urlPath = `/billing/subscription`;
334
+ return {
335
+ path: urlPath,
336
+ method: 'GET',
337
+ headers: headerParameters,
338
+ query: queryParameters,
339
+ };
340
+ });
341
+ }
342
+ /**
343
+ * Returns the organization\'s flat-tier subscription: whether it is entitled, the current billing period, the plan\'s configured quota, and — for an entitled subscription — consumption against the four limits the server enforces on every request. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. An organization that never subscribed is NOT an error. It gets 200 with `subscribed: false`, `status: \"none\"` and the quota the plan would provide, so a client can answer \"what does the plan include\" without a second endpoint and without an error path. Read `subscribed`, not `status`, to decide whether the plan applies: `status` carries the billing provider\'s vocabulary, and the two can disagree — an `active` subscription just past its period end still entitles for a short grace window (renewal-webhook lag), while `past_due` and `canceled` never entitle. `usage` is present only for an entitled subscription whose meter could be read. An absent `usage` NEVER means \"nothing used\" — reading it as zero would report a full quota to an organization that has none left. This is the plan\'s meter. For pay-as-you-go credit see `/billing/balance`, for spend against a self-set cap see `/billing/spending-limit`, and for past consumption see `/usage`.
344
+ * Get the org subscription status and quota usage
345
+ */
346
+ getSubscriptionRaw(initOverrides) {
347
+ return __awaiter(this, void 0, void 0, function* () {
348
+ const requestOptions = yield this.getSubscriptionRequestOpts();
349
+ const response = yield this.request(requestOptions, initOverrides);
350
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Subscription_1.SubscriptionFromJSON)(jsonValue));
351
+ });
352
+ }
353
+ /**
354
+ * Returns the organization\'s flat-tier subscription: whether it is entitled, the current billing period, the plan\'s configured quota, and — for an entitled subscription — consumption against the four limits the server enforces on every request. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. An organization that never subscribed is NOT an error. It gets 200 with `subscribed: false`, `status: \"none\"` and the quota the plan would provide, so a client can answer \"what does the plan include\" without a second endpoint and without an error path. Read `subscribed`, not `status`, to decide whether the plan applies: `status` carries the billing provider\'s vocabulary, and the two can disagree — an `active` subscription just past its period end still entitles for a short grace window (renewal-webhook lag), while `past_due` and `canceled` never entitle. `usage` is present only for an entitled subscription whose meter could be read. An absent `usage` NEVER means \"nothing used\" — reading it as zero would report a full quota to an organization that has none left. This is the plan\'s meter. For pay-as-you-go credit see `/billing/balance`, for spend against a self-set cap see `/billing/spending-limit`, and for past consumption see `/usage`.
355
+ * Get the org subscription status and quota usage
356
+ */
357
+ getSubscription(initOverrides) {
358
+ return __awaiter(this, void 0, void 0, function* () {
359
+ const response = yield this.getSubscriptionRaw(initOverrides);
360
+ return yield response.value();
361
+ });
362
+ }
363
+ /**
364
+ * Creates request options for listDeposits without sending the request
365
+ */
366
+ listDepositsRequestOpts() {
367
+ return __awaiter(this, void 0, void 0, function* () {
368
+ const queryParameters = {};
369
+ const headerParameters = {};
370
+ if (this.configuration && this.configuration.accessToken) {
371
+ const token = this.configuration.accessToken;
372
+ const tokenString = yield token("bearerAuth", []);
373
+ if (tokenString) {
374
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
375
+ }
376
+ }
377
+ let urlPath = `/billing/deposits`;
378
+ return {
379
+ path: urlPath,
380
+ method: 'GET',
381
+ headers: headerParameters,
382
+ query: queryParameters,
383
+ };
384
+ });
385
+ }
386
+ /**
387
+ * Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
388
+ * List stablecoin deposits
389
+ */
390
+ listDepositsRaw(initOverrides) {
391
+ return __awaiter(this, void 0, void 0, function* () {
392
+ const requestOptions = yield this.listDepositsRequestOpts();
393
+ const response = yield this.request(requestOptions, initOverrides);
394
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, ListDeposits200Response_1.ListDeposits200ResponseFromJSON)(jsonValue));
395
+ });
396
+ }
397
+ /**
398
+ * Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
399
+ * List stablecoin deposits
400
+ */
401
+ listDeposits(initOverrides) {
402
+ return __awaiter(this, void 0, void 0, function* () {
403
+ const response = yield this.listDepositsRaw(initOverrides);
404
+ return yield response.value();
405
+ });
406
+ }
407
+ /**
408
+ * Creates request options for updateSpendingLimit without sending the request
409
+ */
410
+ updateSpendingLimitRequestOpts(requestParameters) {
411
+ return __awaiter(this, void 0, void 0, function* () {
412
+ if (requestParameters['updateSpendingLimitRequest'] == null) {
413
+ throw new runtime.RequiredError('updateSpendingLimitRequest', 'Required parameter "updateSpendingLimitRequest" was null or undefined when calling updateSpendingLimit().');
414
+ }
415
+ const queryParameters = {};
416
+ const headerParameters = {};
417
+ headerParameters['Content-Type'] = 'application/json';
418
+ if (this.configuration && this.configuration.accessToken) {
419
+ const token = this.configuration.accessToken;
420
+ const tokenString = yield token("bearerAuth", []);
421
+ if (tokenString) {
422
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
423
+ }
424
+ }
425
+ let urlPath = `/billing/spending-limit`;
426
+ return {
427
+ path: urlPath,
428
+ method: 'PUT',
429
+ headers: headerParameters,
430
+ query: queryParameters,
431
+ body: (0, UpdateSpendingLimitRequest_1.UpdateSpendingLimitRequestToJSON)(requestParameters['updateSpendingLimitRequest']),
432
+ };
433
+ });
434
+ }
435
+ /**
436
+ * Sets the monthly spending limit and optionally sets or clears the opt-in daily spend cap. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). `daily_limit_dollars` uses pointer semantics: omit to leave the cap unchanged, 0 to clear it, a positive value to set it.
437
+ * Set the org spending limit
438
+ */
439
+ updateSpendingLimitRaw(requestParameters, initOverrides) {
440
+ return __awaiter(this, void 0, void 0, function* () {
441
+ const requestOptions = yield this.updateSpendingLimitRequestOpts(requestParameters);
442
+ const response = yield this.request(requestOptions, initOverrides);
443
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, SpendingLimit_1.SpendingLimitFromJSON)(jsonValue));
444
+ });
445
+ }
446
+ /**
447
+ * Sets the monthly spending limit and optionally sets or clears the opt-in daily spend cap. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). `daily_limit_dollars` uses pointer semantics: omit to leave the cap unchanged, 0 to clear it, a positive value to set it.
448
+ * Set the org spending limit
449
+ */
450
+ updateSpendingLimit(requestParameters, initOverrides) {
451
+ return __awaiter(this, void 0, void 0, function* () {
452
+ const response = yield this.updateSpendingLimitRaw(requestParameters, initOverrides);
453
+ return yield response.value();
454
+ });
455
+ }
456
+ }
457
+ exports.BillingApi = BillingApi;