@deeprelay/sdk 0.2.1 → 0.3.0

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 (512) hide show
  1. package/.openapi-generator/FILES +66 -0
  2. package/README.md +47 -11
  3. package/dist/apis/AlertsApi.d.ts +50 -0
  4. package/dist/apis/AlertsApi.js +127 -0
  5. package/dist/apis/ApiKeysApi.d.ts +107 -0
  6. package/dist/apis/ApiKeysApi.js +284 -0
  7. package/dist/apis/BillingApi.d.ts +25 -7
  8. package/dist/apis/BillingApi.js +57 -7
  9. package/dist/apis/InferenceApi.d.ts +12 -1
  10. package/dist/apis/InferenceApi.js +22 -1
  11. package/dist/apis/MetaApi.d.ts +1 -1
  12. package/dist/apis/MetaApi.js +1 -1
  13. package/dist/apis/RequestsApi.d.ts +130 -0
  14. package/dist/apis/RequestsApi.js +269 -0
  15. package/dist/apis/UsageApi.d.ts +1 -1
  16. package/dist/apis/UsageApi.js +1 -1
  17. package/dist/apis/WebhooksApi.d.ts +1 -1
  18. package/dist/apis/WebhooksApi.js +1 -1
  19. package/dist/apis/index.d.ts +3 -0
  20. package/dist/apis/index.js +3 -0
  21. package/dist/esm/apis/AlertsApi.d.ts +50 -0
  22. package/dist/esm/apis/AlertsApi.js +123 -0
  23. package/dist/esm/apis/ApiKeysApi.d.ts +107 -0
  24. package/dist/esm/apis/ApiKeysApi.js +280 -0
  25. package/dist/esm/apis/BillingApi.d.ts +25 -7
  26. package/dist/esm/apis/BillingApi.js +57 -7
  27. package/dist/esm/apis/InferenceApi.d.ts +12 -1
  28. package/dist/esm/apis/InferenceApi.js +22 -1
  29. package/dist/esm/apis/MetaApi.d.ts +1 -1
  30. package/dist/esm/apis/MetaApi.js +1 -1
  31. package/dist/esm/apis/RequestsApi.d.ts +130 -0
  32. package/dist/esm/apis/RequestsApi.js +265 -0
  33. package/dist/esm/apis/UsageApi.d.ts +1 -1
  34. package/dist/esm/apis/UsageApi.js +1 -1
  35. package/dist/esm/apis/WebhooksApi.d.ts +1 -1
  36. package/dist/esm/apis/WebhooksApi.js +1 -1
  37. package/dist/esm/apis/index.d.ts +3 -0
  38. package/dist/esm/apis/index.js +3 -0
  39. package/dist/esm/models/AlertEmailToggles.d.ts +50 -0
  40. package/dist/esm/models/AlertEmailToggles.js +55 -0
  41. package/dist/esm/models/AlertSettings.d.ts +51 -0
  42. package/dist/esm/models/AlertSettings.js +56 -0
  43. package/dist/esm/models/AlertSettingsUpdate.d.ts +39 -0
  44. package/dist/esm/models/AlertSettingsUpdate.js +48 -0
  45. package/dist/esm/models/ApiKey.d.ts +123 -0
  46. package/dist/esm/models/ApiKey.js +96 -0
  47. package/dist/esm/models/ApiKeyCreate.d.ts +70 -0
  48. package/dist/esm/models/ApiKeyCreate.js +57 -0
  49. package/dist/esm/models/ApiKeyCreated.d.ts +129 -0
  50. package/dist/esm/models/ApiKeyCreated.js +100 -0
  51. package/dist/esm/models/ApiKeyList.d.ts +33 -0
  52. package/dist/esm/models/ApiKeyList.js +44 -0
  53. package/dist/esm/models/ApiKeyScopes.d.ts +65 -0
  54. package/dist/esm/models/ApiKeyScopes.js +66 -0
  55. package/dist/esm/models/ApiKeyUpdate.d.ts +62 -0
  56. package/dist/esm/models/ApiKeyUpdate.js +51 -0
  57. package/dist/esm/models/Balance.d.ts +1 -1
  58. package/dist/esm/models/Balance.js +1 -1
  59. package/dist/esm/models/ChatChoice.d.ts +11 -1
  60. package/dist/esm/models/ChatChoice.js +3 -1
  61. package/dist/esm/models/ChatCompletionRequest.d.ts +78 -2
  62. package/dist/esm/models/ChatCompletionRequest.js +26 -1
  63. package/dist/esm/models/ChatCompletionRequestResponseFormat.d.ts +31 -0
  64. package/dist/esm/models/ChatCompletionRequestResponseFormat.js +52 -0
  65. package/dist/esm/models/ChatCompletionRequestToolChoice.d.ts +23 -0
  66. package/dist/esm/models/ChatCompletionRequestToolChoice.js +50 -0
  67. package/dist/esm/models/ChatCompletionResponse.d.ts +1 -1
  68. package/dist/esm/models/ChatCompletionResponse.js +1 -1
  69. package/dist/esm/models/ChatMessage.d.ts +22 -2
  70. package/dist/esm/models/ChatMessage.js +10 -5
  71. package/dist/esm/models/CostDetails.d.ts +59 -0
  72. package/dist/esm/models/CostDetails.js +59 -0
  73. package/dist/esm/models/CreateCryptoDepositRequest.d.ts +4 -1
  74. package/dist/esm/models/CreateCryptoDepositRequest.js +4 -2
  75. package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +5 -1
  76. package/dist/esm/models/CreateWebhookEndpointRequest.js +6 -2
  77. package/dist/esm/models/CryptoDeposit.d.ts +3 -1
  78. package/dist/esm/models/CryptoDeposit.js +4 -2
  79. package/dist/esm/models/Embedding.d.ts +1 -1
  80. package/dist/esm/models/Embedding.js +1 -1
  81. package/dist/esm/models/EmbeddingsRequest.d.ts +1 -1
  82. package/dist/esm/models/EmbeddingsRequest.js +1 -1
  83. package/dist/esm/models/EmbeddingsRequestInput.d.ts +1 -1
  84. package/dist/esm/models/EmbeddingsRequestInput.js +1 -1
  85. package/dist/esm/models/EmbeddingsResponse.d.ts +1 -1
  86. package/dist/esm/models/EmbeddingsResponse.js +1 -1
  87. package/dist/esm/models/EmbeddingsUsage.d.ts +1 -1
  88. package/dist/esm/models/EmbeddingsUsage.js +1 -1
  89. package/dist/esm/models/GetHealth200Response.d.ts +1 -1
  90. package/dist/esm/models/GetHealth200Response.js +1 -1
  91. package/dist/esm/models/ImagesGenerationsRequest.d.ts +2 -2
  92. package/dist/esm/models/ImagesGenerationsRequest.js +1 -1
  93. package/dist/esm/models/ImagesResponse.d.ts +1 -1
  94. package/dist/esm/models/ImagesResponse.js +1 -1
  95. package/dist/esm/models/ImagesResponseDataInner.d.ts +1 -1
  96. package/dist/esm/models/ImagesResponseDataInner.js +1 -1
  97. package/dist/esm/models/ImagesResponseUsage.d.ts +1 -1
  98. package/dist/esm/models/ImagesResponseUsage.js +1 -1
  99. package/dist/esm/models/InferencePreflight.d.ts +5 -2
  100. package/dist/esm/models/InferencePreflight.js +4 -1
  101. package/dist/esm/models/JSONSchemaFormat.d.ts +54 -0
  102. package/dist/esm/models/JSONSchemaFormat.js +49 -0
  103. package/dist/esm/models/ListDeposits200Response.d.ts +1 -1
  104. package/dist/esm/models/ListDeposits200Response.js +1 -1
  105. package/dist/esm/models/Model.d.ts +54 -5
  106. package/dist/esm/models/Model.js +21 -2
  107. package/dist/esm/models/ModelList.d.ts +1 -1
  108. package/dist/esm/models/ModelList.js +1 -1
  109. package/dist/esm/models/ModelMetrics.d.ts +101 -0
  110. package/dist/esm/models/ModelMetrics.js +85 -0
  111. package/dist/esm/models/ModelParametersInner.d.ts +1 -1
  112. package/dist/esm/models/ModelParametersInner.js +1 -1
  113. package/dist/esm/models/ModelPricing.d.ts +1 -1
  114. package/dist/esm/models/ModelPricing.js +1 -1
  115. package/dist/esm/models/ModelRate.d.ts +1 -1
  116. package/dist/esm/models/ModelRate.js +1 -1
  117. package/dist/esm/models/OpenAIErrorEnvelope.d.ts +1 -1
  118. package/dist/esm/models/OpenAIErrorEnvelope.js +1 -1
  119. package/dist/esm/models/OpenAIErrorEnvelopeError.d.ts +8 -2
  120. package/dist/esm/models/OpenAIErrorEnvelopeError.js +3 -1
  121. package/dist/esm/models/PeakWindow.d.ts +1 -1
  122. package/dist/esm/models/PeakWindow.js +1 -1
  123. package/dist/esm/models/Problem.d.ts +22 -1
  124. package/dist/esm/models/Problem.js +14 -1
  125. package/dist/esm/models/RefereeStatus.d.ts +1 -1
  126. package/dist/esm/models/RefereeStatus.js +1 -1
  127. package/dist/esm/models/Referral.d.ts +14 -2
  128. package/dist/esm/models/Referral.js +9 -1
  129. package/dist/esm/models/RequestLogEntry.d.ts +210 -0
  130. package/dist/esm/models/RequestLogEntry.js +129 -0
  131. package/dist/esm/models/RequestLogPage.d.ts +45 -0
  132. package/dist/esm/models/RequestLogPage.js +52 -0
  133. package/dist/esm/models/ResponseFormatJSONObject.d.ts +39 -0
  134. package/dist/esm/models/ResponseFormatJSONObject.js +51 -0
  135. package/dist/esm/models/ResponseFormatJSONSchema.d.ts +46 -0
  136. package/dist/esm/models/ResponseFormatJSONSchema.js +56 -0
  137. package/dist/esm/models/ResponseFormatText.d.ts +39 -0
  138. package/dist/esm/models/ResponseFormatText.js +51 -0
  139. package/dist/esm/models/SpendingLimit.d.ts +1 -1
  140. package/dist/esm/models/SpendingLimit.js +1 -1
  141. package/dist/esm/models/StreamOptions.d.ts +1 -1
  142. package/dist/esm/models/StreamOptions.js +1 -1
  143. package/dist/esm/models/Subscription.d.ts +9 -2
  144. package/dist/esm/models/Subscription.js +6 -1
  145. package/dist/esm/models/SubscriptionCheckoutRequest.d.ts +18 -4
  146. package/dist/esm/models/SubscriptionCheckoutRequest.js +10 -1
  147. package/dist/esm/models/SubscriptionCheckoutSession.d.ts +21 -1
  148. package/dist/esm/models/SubscriptionCheckoutSession.js +12 -1
  149. package/dist/esm/models/SubscriptionModelUsage.d.ts +68 -0
  150. package/dist/esm/models/SubscriptionModelUsage.js +67 -0
  151. package/dist/esm/models/SubscriptionPlan.d.ts +4 -4
  152. package/dist/esm/models/SubscriptionPlan.js +1 -1
  153. package/dist/esm/models/SubscriptionPortalRequest.d.ts +1 -1
  154. package/dist/esm/models/SubscriptionPortalRequest.js +1 -1
  155. package/dist/esm/models/SubscriptionPortalSession.d.ts +1 -1
  156. package/dist/esm/models/SubscriptionPortalSession.js +1 -1
  157. package/dist/esm/models/SubscriptionPrice.d.ts +1 -1
  158. package/dist/esm/models/SubscriptionPrice.js +1 -1
  159. package/dist/esm/models/SubscriptionQuota.d.ts +10 -4
  160. package/dist/esm/models/SubscriptionQuota.js +8 -4
  161. package/dist/esm/models/SubscriptionTier.d.ts +53 -0
  162. package/dist/esm/models/SubscriptionTier.js +55 -0
  163. package/dist/esm/models/SubscriptionUpgradeRequest.d.ts +32 -0
  164. package/dist/esm/models/SubscriptionUpgradeRequest.js +43 -0
  165. package/dist/esm/models/SubscriptionUsage.d.ts +28 -3
  166. package/dist/esm/models/SubscriptionUsage.js +15 -4
  167. package/dist/esm/models/Tool.d.ts +46 -0
  168. package/dist/esm/models/Tool.js +56 -0
  169. package/dist/esm/models/ToolCall.d.ts +60 -0
  170. package/dist/esm/models/ToolCall.js +56 -0
  171. package/dist/esm/models/ToolCallFunction.d.ts +39 -0
  172. package/dist/esm/models/ToolCallFunction.js +47 -0
  173. package/dist/esm/models/ToolChoiceFunction.d.ts +46 -0
  174. package/dist/esm/models/ToolChoiceFunction.js +56 -0
  175. package/dist/esm/models/ToolChoiceFunctionFunction.d.ts +32 -0
  176. package/dist/esm/models/ToolChoiceFunctionFunction.js +43 -0
  177. package/dist/esm/models/ToolFunction.d.ts +47 -0
  178. package/dist/esm/models/ToolFunction.js +47 -0
  179. package/dist/esm/models/UpdateSpendingLimitRequest.d.ts +1 -1
  180. package/dist/esm/models/UpdateSpendingLimitRequest.js +1 -1
  181. package/dist/esm/models/Usage.d.ts +29 -1
  182. package/dist/esm/models/Usage.js +12 -1
  183. package/dist/esm/models/UsageBucket.d.ts +1 -1
  184. package/dist/esm/models/UsageBucket.js +1 -1
  185. package/dist/esm/models/UsageCompletionTokensDetails.d.ts +32 -0
  186. package/dist/esm/models/UsageCompletionTokensDetails.js +41 -0
  187. package/dist/esm/models/UsagePage.d.ts +1 -1
  188. package/dist/esm/models/UsagePage.js +1 -1
  189. package/dist/esm/models/UsagePromptTokensDetails.d.ts +33 -0
  190. package/dist/esm/models/UsagePromptTokensDetails.js +41 -0
  191. package/dist/esm/models/VideoCreateRequest.d.ts +1 -1
  192. package/dist/esm/models/VideoCreateRequest.js +1 -1
  193. package/dist/esm/models/VideoJob.d.ts +1 -1
  194. package/dist/esm/models/VideoJob.js +1 -1
  195. package/dist/esm/models/VideoList.d.ts +1 -1
  196. package/dist/esm/models/VideoList.js +1 -1
  197. package/dist/esm/models/WebhookEndpoint.d.ts +5 -1
  198. package/dist/esm/models/WebhookEndpoint.js +6 -2
  199. package/dist/esm/models/WebhookEndpointPage.d.ts +1 -1
  200. package/dist/esm/models/WebhookEndpointPage.js +1 -1
  201. package/dist/esm/models/index.d.ts +30 -0
  202. package/dist/esm/models/index.js +30 -0
  203. package/dist/esm/runtime.d.ts +1 -1
  204. package/dist/esm/runtime.js +2 -2
  205. package/dist/models/AlertEmailToggles.d.ts +50 -0
  206. package/dist/models/AlertEmailToggles.js +62 -0
  207. package/dist/models/AlertSettings.d.ts +51 -0
  208. package/dist/models/AlertSettings.js +63 -0
  209. package/dist/models/AlertSettingsUpdate.d.ts +39 -0
  210. package/dist/models/AlertSettingsUpdate.js +55 -0
  211. package/dist/models/ApiKey.d.ts +123 -0
  212. package/dist/models/ApiKey.js +103 -0
  213. package/dist/models/ApiKeyCreate.d.ts +70 -0
  214. package/dist/models/ApiKeyCreate.js +64 -0
  215. package/dist/models/ApiKeyCreated.d.ts +129 -0
  216. package/dist/models/ApiKeyCreated.js +107 -0
  217. package/dist/models/ApiKeyList.d.ts +33 -0
  218. package/dist/models/ApiKeyList.js +51 -0
  219. package/dist/models/ApiKeyScopes.d.ts +65 -0
  220. package/dist/models/ApiKeyScopes.js +74 -0
  221. package/dist/models/ApiKeyUpdate.d.ts +62 -0
  222. package/dist/models/ApiKeyUpdate.js +58 -0
  223. package/dist/models/Balance.d.ts +1 -1
  224. package/dist/models/Balance.js +1 -1
  225. package/dist/models/ChatChoice.d.ts +11 -1
  226. package/dist/models/ChatChoice.js +3 -1
  227. package/dist/models/ChatCompletionRequest.d.ts +78 -2
  228. package/dist/models/ChatCompletionRequest.js +26 -1
  229. package/dist/models/ChatCompletionRequestResponseFormat.d.ts +31 -0
  230. package/dist/models/ChatCompletionRequestResponseFormat.js +58 -0
  231. package/dist/models/ChatCompletionRequestToolChoice.d.ts +23 -0
  232. package/dist/models/ChatCompletionRequestToolChoice.js +56 -0
  233. package/dist/models/ChatCompletionResponse.d.ts +1 -1
  234. package/dist/models/ChatCompletionResponse.js +1 -1
  235. package/dist/models/ChatMessage.d.ts +22 -2
  236. package/dist/models/ChatMessage.js +10 -5
  237. package/dist/models/CostDetails.d.ts +59 -0
  238. package/dist/models/CostDetails.js +66 -0
  239. package/dist/models/CreateCryptoDepositRequest.d.ts +4 -1
  240. package/dist/models/CreateCryptoDepositRequest.js +4 -2
  241. package/dist/models/CreateWebhookEndpointRequest.d.ts +5 -1
  242. package/dist/models/CreateWebhookEndpointRequest.js +6 -2
  243. package/dist/models/CryptoDeposit.d.ts +3 -1
  244. package/dist/models/CryptoDeposit.js +4 -2
  245. package/dist/models/Embedding.d.ts +1 -1
  246. package/dist/models/Embedding.js +1 -1
  247. package/dist/models/EmbeddingsRequest.d.ts +1 -1
  248. package/dist/models/EmbeddingsRequest.js +1 -1
  249. package/dist/models/EmbeddingsRequestInput.d.ts +1 -1
  250. package/dist/models/EmbeddingsRequestInput.js +1 -1
  251. package/dist/models/EmbeddingsResponse.d.ts +1 -1
  252. package/dist/models/EmbeddingsResponse.js +1 -1
  253. package/dist/models/EmbeddingsUsage.d.ts +1 -1
  254. package/dist/models/EmbeddingsUsage.js +1 -1
  255. package/dist/models/GetHealth200Response.d.ts +1 -1
  256. package/dist/models/GetHealth200Response.js +1 -1
  257. package/dist/models/ImagesGenerationsRequest.d.ts +2 -2
  258. package/dist/models/ImagesGenerationsRequest.js +1 -1
  259. package/dist/models/ImagesResponse.d.ts +1 -1
  260. package/dist/models/ImagesResponse.js +1 -1
  261. package/dist/models/ImagesResponseDataInner.d.ts +1 -1
  262. package/dist/models/ImagesResponseDataInner.js +1 -1
  263. package/dist/models/ImagesResponseUsage.d.ts +1 -1
  264. package/dist/models/ImagesResponseUsage.js +1 -1
  265. package/dist/models/InferencePreflight.d.ts +5 -2
  266. package/dist/models/InferencePreflight.js +4 -1
  267. package/dist/models/JSONSchemaFormat.d.ts +54 -0
  268. package/dist/models/JSONSchemaFormat.js +56 -0
  269. package/dist/models/ListDeposits200Response.d.ts +1 -1
  270. package/dist/models/ListDeposits200Response.js +1 -1
  271. package/dist/models/Model.d.ts +54 -5
  272. package/dist/models/Model.js +21 -2
  273. package/dist/models/ModelList.d.ts +1 -1
  274. package/dist/models/ModelList.js +1 -1
  275. package/dist/models/ModelMetrics.d.ts +101 -0
  276. package/dist/models/ModelMetrics.js +93 -0
  277. package/dist/models/ModelParametersInner.d.ts +1 -1
  278. package/dist/models/ModelParametersInner.js +1 -1
  279. package/dist/models/ModelPricing.d.ts +1 -1
  280. package/dist/models/ModelPricing.js +1 -1
  281. package/dist/models/ModelRate.d.ts +1 -1
  282. package/dist/models/ModelRate.js +1 -1
  283. package/dist/models/OpenAIErrorEnvelope.d.ts +1 -1
  284. package/dist/models/OpenAIErrorEnvelope.js +1 -1
  285. package/dist/models/OpenAIErrorEnvelopeError.d.ts +8 -2
  286. package/dist/models/OpenAIErrorEnvelopeError.js +3 -1
  287. package/dist/models/PeakWindow.d.ts +1 -1
  288. package/dist/models/PeakWindow.js +1 -1
  289. package/dist/models/Problem.d.ts +22 -1
  290. package/dist/models/Problem.js +14 -1
  291. package/dist/models/RefereeStatus.d.ts +1 -1
  292. package/dist/models/RefereeStatus.js +1 -1
  293. package/dist/models/Referral.d.ts +14 -2
  294. package/dist/models/Referral.js +9 -1
  295. package/dist/models/RequestLogEntry.d.ts +210 -0
  296. package/dist/models/RequestLogEntry.js +137 -0
  297. package/dist/models/RequestLogPage.d.ts +45 -0
  298. package/dist/models/RequestLogPage.js +59 -0
  299. package/dist/models/ResponseFormatJSONObject.d.ts +39 -0
  300. package/dist/models/ResponseFormatJSONObject.js +59 -0
  301. package/dist/models/ResponseFormatJSONSchema.d.ts +46 -0
  302. package/dist/models/ResponseFormatJSONSchema.js +64 -0
  303. package/dist/models/ResponseFormatText.d.ts +39 -0
  304. package/dist/models/ResponseFormatText.js +59 -0
  305. package/dist/models/SpendingLimit.d.ts +1 -1
  306. package/dist/models/SpendingLimit.js +1 -1
  307. package/dist/models/StreamOptions.d.ts +1 -1
  308. package/dist/models/StreamOptions.js +1 -1
  309. package/dist/models/Subscription.d.ts +9 -2
  310. package/dist/models/Subscription.js +6 -1
  311. package/dist/models/SubscriptionCheckoutRequest.d.ts +18 -4
  312. package/dist/models/SubscriptionCheckoutRequest.js +11 -1
  313. package/dist/models/SubscriptionCheckoutSession.d.ts +21 -1
  314. package/dist/models/SubscriptionCheckoutSession.js +13 -1
  315. package/dist/models/SubscriptionModelUsage.d.ts +68 -0
  316. package/dist/models/SubscriptionModelUsage.js +74 -0
  317. package/dist/models/SubscriptionPlan.d.ts +4 -4
  318. package/dist/models/SubscriptionPlan.js +1 -1
  319. package/dist/models/SubscriptionPortalRequest.d.ts +1 -1
  320. package/dist/models/SubscriptionPortalRequest.js +1 -1
  321. package/dist/models/SubscriptionPortalSession.d.ts +1 -1
  322. package/dist/models/SubscriptionPortalSession.js +1 -1
  323. package/dist/models/SubscriptionPrice.d.ts +1 -1
  324. package/dist/models/SubscriptionPrice.js +1 -1
  325. package/dist/models/SubscriptionQuota.d.ts +10 -4
  326. package/dist/models/SubscriptionQuota.js +8 -4
  327. package/dist/models/SubscriptionTier.d.ts +53 -0
  328. package/dist/models/SubscriptionTier.js +62 -0
  329. package/dist/models/SubscriptionUpgradeRequest.d.ts +32 -0
  330. package/dist/models/SubscriptionUpgradeRequest.js +50 -0
  331. package/dist/models/SubscriptionUsage.d.ts +28 -3
  332. package/dist/models/SubscriptionUsage.js +15 -4
  333. package/dist/models/Tool.d.ts +46 -0
  334. package/dist/models/Tool.js +64 -0
  335. package/dist/models/ToolCall.d.ts +60 -0
  336. package/dist/models/ToolCall.js +64 -0
  337. package/dist/models/ToolCallFunction.d.ts +39 -0
  338. package/dist/models/ToolCallFunction.js +54 -0
  339. package/dist/models/ToolChoiceFunction.d.ts +46 -0
  340. package/dist/models/ToolChoiceFunction.js +64 -0
  341. package/dist/models/ToolChoiceFunctionFunction.d.ts +32 -0
  342. package/dist/models/ToolChoiceFunctionFunction.js +50 -0
  343. package/dist/models/ToolFunction.d.ts +47 -0
  344. package/dist/models/ToolFunction.js +54 -0
  345. package/dist/models/UpdateSpendingLimitRequest.d.ts +1 -1
  346. package/dist/models/UpdateSpendingLimitRequest.js +1 -1
  347. package/dist/models/Usage.d.ts +29 -1
  348. package/dist/models/Usage.js +12 -1
  349. package/dist/models/UsageBucket.d.ts +1 -1
  350. package/dist/models/UsageBucket.js +1 -1
  351. package/dist/models/UsageCompletionTokensDetails.d.ts +32 -0
  352. package/dist/models/UsageCompletionTokensDetails.js +48 -0
  353. package/dist/models/UsagePage.d.ts +1 -1
  354. package/dist/models/UsagePage.js +1 -1
  355. package/dist/models/UsagePromptTokensDetails.d.ts +33 -0
  356. package/dist/models/UsagePromptTokensDetails.js +48 -0
  357. package/dist/models/VideoCreateRequest.d.ts +1 -1
  358. package/dist/models/VideoCreateRequest.js +1 -1
  359. package/dist/models/VideoJob.d.ts +1 -1
  360. package/dist/models/VideoJob.js +1 -1
  361. package/dist/models/VideoList.d.ts +1 -1
  362. package/dist/models/VideoList.js +1 -1
  363. package/dist/models/WebhookEndpoint.d.ts +5 -1
  364. package/dist/models/WebhookEndpoint.js +6 -2
  365. package/dist/models/WebhookEndpointPage.d.ts +1 -1
  366. package/dist/models/WebhookEndpointPage.js +1 -1
  367. package/dist/models/index.d.ts +30 -0
  368. package/dist/models/index.js +30 -0
  369. package/dist/runtime.d.ts +1 -1
  370. package/dist/runtime.js +2 -2
  371. package/docs/AlertEmailToggles.md +40 -0
  372. package/docs/AlertSettings.md +40 -0
  373. package/docs/AlertSettingsUpdate.md +36 -0
  374. package/docs/AlertsApi.md +151 -0
  375. package/docs/ApiKey.md +65 -0
  376. package/docs/ApiKeyCreate.md +46 -0
  377. package/docs/ApiKeyCreated.md +67 -0
  378. package/docs/ApiKeyList.md +34 -0
  379. package/docs/ApiKeyScopes.md +38 -0
  380. package/docs/ApiKeyUpdate.md +45 -0
  381. package/docs/ApiKeysApi.md +389 -0
  382. package/docs/BillingApi.md +83 -3
  383. package/docs/ChatChoice.md +2 -0
  384. package/docs/ChatCompletionRequest.md +22 -0
  385. package/docs/ChatCompletionRequestResponseFormat.md +37 -0
  386. package/docs/ChatCompletionRequestToolChoice.md +37 -0
  387. package/docs/ChatMessage.md +4 -0
  388. package/docs/CostDetails.md +43 -0
  389. package/docs/InferenceApi.md +94 -71
  390. package/docs/JSONSchemaFormat.md +41 -0
  391. package/docs/Model.md +16 -0
  392. package/docs/ModelMetrics.md +55 -0
  393. package/docs/OpenAIErrorEnvelopeError.md +2 -0
  394. package/docs/Problem.md +4 -0
  395. package/docs/Referral.md +6 -2
  396. package/docs/RequestLogEntry.md +87 -0
  397. package/docs/RequestLogPage.md +38 -0
  398. package/docs/RequestsApi.md +282 -0
  399. package/docs/ResponseFormatJSONObject.md +35 -0
  400. package/docs/ResponseFormatJSONSchema.md +36 -0
  401. package/docs/ResponseFormatText.md +34 -0
  402. package/docs/Subscription.md +3 -1
  403. package/docs/SubscriptionCheckoutRequest.md +2 -0
  404. package/docs/SubscriptionCheckoutSession.md +4 -0
  405. package/docs/SubscriptionModelUsage.md +47 -0
  406. package/docs/SubscriptionPlan.md +1 -1
  407. package/docs/SubscriptionQuota.md +5 -3
  408. package/docs/SubscriptionTier.md +41 -0
  409. package/docs/SubscriptionUpgradeRequest.md +34 -0
  410. package/docs/SubscriptionUsage.md +10 -2
  411. package/docs/Tool.md +36 -0
  412. package/docs/ToolCall.md +41 -0
  413. package/docs/ToolCallFunction.md +36 -0
  414. package/docs/ToolChoiceFunction.md +36 -0
  415. package/docs/ToolChoiceFunctionFunction.md +34 -0
  416. package/docs/ToolFunction.md +38 -0
  417. package/docs/Usage.md +8 -0
  418. package/docs/UsageCompletionTokensDetails.md +34 -0
  419. package/docs/UsagePromptTokensDetails.md +35 -0
  420. package/package.json +1 -1
  421. package/src/apis/AlertsApi.ts +145 -0
  422. package/src/apis/ApiKeysApi.ts +357 -0
  423. package/src/apis/BillingApi.ts +73 -7
  424. package/src/apis/InferenceApi.ts +32 -1
  425. package/src/apis/MetaApi.ts +1 -1
  426. package/src/apis/RequestsApi.ts +335 -0
  427. package/src/apis/UsageApi.ts +1 -1
  428. package/src/apis/WebhooksApi.ts +1 -1
  429. package/src/apis/index.ts +3 -0
  430. package/src/models/AlertEmailToggles.ts +93 -0
  431. package/src/models/AlertSettings.ts +101 -0
  432. package/src/models/AlertSettingsUpdate.ts +83 -0
  433. package/src/models/ApiKey.ts +205 -0
  434. package/src/models/ApiKeyCreate.ts +115 -0
  435. package/src/models/ApiKeyCreated.ts +214 -0
  436. package/src/models/ApiKeyList.ts +74 -0
  437. package/src/models/ApiKeyScopes.ts +106 -0
  438. package/src/models/ApiKeyUpdate.ts +105 -0
  439. package/src/models/Balance.ts +1 -1
  440. package/src/models/ChatChoice.ts +11 -1
  441. package/src/models/ChatCompletionRequest.ts +118 -2
  442. package/src/models/ChatCompletionRequestResponseFormat.ts +84 -0
  443. package/src/models/ChatCompletionRequestToolChoice.ts +70 -0
  444. package/src/models/ChatCompletionResponse.ts +1 -1
  445. package/src/models/ChatMessage.ts +35 -5
  446. package/src/models/CostDetails.ts +105 -0
  447. package/src/models/CreateCryptoDepositRequest.ts +5 -2
  448. package/src/models/CreateWebhookEndpointRequest.ts +6 -2
  449. package/src/models/CryptoDeposit.ts +4 -2
  450. package/src/models/Embedding.ts +1 -1
  451. package/src/models/EmbeddingsRequest.ts +1 -1
  452. package/src/models/EmbeddingsRequestInput.ts +1 -1
  453. package/src/models/EmbeddingsResponse.ts +1 -1
  454. package/src/models/EmbeddingsUsage.ts +1 -1
  455. package/src/models/GetHealth200Response.ts +1 -1
  456. package/src/models/ImagesGenerationsRequest.ts +2 -2
  457. package/src/models/ImagesResponse.ts +1 -1
  458. package/src/models/ImagesResponseDataInner.ts +1 -1
  459. package/src/models/ImagesResponseUsage.ts +1 -1
  460. package/src/models/InferencePreflight.ts +5 -2
  461. package/src/models/JSONSchemaFormat.ts +92 -0
  462. package/src/models/ListDeposits200Response.ts +1 -1
  463. package/src/models/Model.ts +78 -6
  464. package/src/models/ModelList.ts +1 -1
  465. package/src/models/ModelMetrics.ts +165 -0
  466. package/src/models/ModelParametersInner.ts +1 -1
  467. package/src/models/ModelPricing.ts +1 -1
  468. package/src/models/ModelRate.ts +1 -1
  469. package/src/models/OpenAIErrorEnvelope.ts +1 -1
  470. package/src/models/OpenAIErrorEnvelopeError.ts +10 -2
  471. package/src/models/PeakWindow.ts +1 -1
  472. package/src/models/Problem.ts +26 -1
  473. package/src/models/RefereeStatus.ts +1 -1
  474. package/src/models/Referral.ts +20 -2
  475. package/src/models/RequestLogEntry.ts +307 -0
  476. package/src/models/RequestLogPage.ts +92 -0
  477. package/src/models/ResponseFormatJSONObject.ts +78 -0
  478. package/src/models/ResponseFormatJSONSchema.ts +95 -0
  479. package/src/models/ResponseFormatText.ts +78 -0
  480. package/src/models/SpendingLimit.ts +1 -1
  481. package/src/models/StreamOptions.ts +1 -1
  482. package/src/models/Subscription.ts +18 -2
  483. package/src/models/SubscriptionCheckoutRequest.ts +23 -4
  484. package/src/models/SubscriptionCheckoutSession.ts +28 -1
  485. package/src/models/SubscriptionModelUsage.ts +120 -0
  486. package/src/models/SubscriptionPlan.ts +4 -4
  487. package/src/models/SubscriptionPortalRequest.ts +1 -1
  488. package/src/models/SubscriptionPortalSession.ts +1 -1
  489. package/src/models/SubscriptionPrice.ts +1 -1
  490. package/src/models/SubscriptionQuota.ts +16 -7
  491. package/src/models/SubscriptionTier.ts +108 -0
  492. package/src/models/SubscriptionUpgradeRequest.ts +66 -0
  493. package/src/models/SubscriptionUsage.ts +47 -6
  494. package/src/models/Tool.ts +95 -0
  495. package/src/models/ToolCall.ts +110 -0
  496. package/src/models/ToolCallFunction.ts +76 -0
  497. package/src/models/ToolChoiceFunction.ts +95 -0
  498. package/src/models/ToolChoiceFunctionFunction.ts +66 -0
  499. package/src/models/ToolFunction.ts +83 -0
  500. package/src/models/UpdateSpendingLimitRequest.ts +1 -1
  501. package/src/models/Usage.ts +56 -1
  502. package/src/models/UsageBucket.ts +1 -1
  503. package/src/models/UsageCompletionTokensDetails.ts +65 -0
  504. package/src/models/UsagePage.ts +1 -1
  505. package/src/models/UsagePromptTokensDetails.ts +66 -0
  506. package/src/models/VideoCreateRequest.ts +1 -1
  507. package/src/models/VideoJob.ts +1 -1
  508. package/src/models/VideoList.ts +1 -1
  509. package/src/models/WebhookEndpoint.ts +6 -2
  510. package/src/models/WebhookEndpointPage.ts +1 -1
  511. package/src/models/index.ts +30 -0
  512. package/src/runtime.ts +2 -2
@@ -0,0 +1,389 @@
1
+ # ApiKeysApi
2
+
3
+ All URIs are relative to *https://api.deeprelay.ai/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**createApiKey**](ApiKeysApi.md#createapikey) | **POST** /api-keys | Create an API key |
8
+ | [**getApiKey**](ApiKeysApi.md#getapikey) | **GET** /api-keys/{id} | Get an API key |
9
+ | [**listApiKeys**](ApiKeysApi.md#listapikeys) | **GET** /api-keys | List API keys |
10
+ | [**revokeApiKey**](ApiKeysApi.md#revokeapikey) | **DELETE** /api-keys/{id} | Revoke an API key |
11
+ | [**updateApiKey**](ApiKeysApi.md#updateapikey) | **PATCH** /api-keys/{id} | Update an API key\'s name or limits |
12
+
13
+
14
+
15
+ ## createApiKey
16
+
17
+ > ApiKeyCreated createApiKey(apiKeyCreate)
18
+
19
+ Create an API key
20
+
21
+ Mints a key. The response is the only place the secret (`key`) appears; store it then, because it cannot be read again. Requires the `keys:manage` capability: a `full_access` key, or a key whose scopes grant `{\"keys\": \"write\"}`. Any other key gets 403 `keys_manage_required`. A key can never mint a key stronger than itself: scopes it does not hold answer 403 `scope_exceeds_caller`, and a minting key that has a budget, a model allowlist, a rate limit or an expiry passes each down as an upper bound (422 `validation_failed` naming the `field`). Only an org admin can mint a `full_access` key.
22
+
23
+ ### Example
24
+
25
+ ```ts
26
+ import {
27
+ Configuration,
28
+ ApiKeysApi,
29
+ } from '@deeprelay/sdk';
30
+ import type { CreateApiKeyRequest } from '@deeprelay/sdk';
31
+
32
+ async function example() {
33
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
34
+ const config = new Configuration({
35
+ // Configure HTTP bearer authorization: bearerAuth
36
+ accessToken: "YOUR BEARER TOKEN",
37
+ });
38
+ const api = new ApiKeysApi(config);
39
+
40
+ const body = {
41
+ // ApiKeyCreate
42
+ apiKeyCreate: ...,
43
+ } satisfies CreateApiKeyRequest;
44
+
45
+ try {
46
+ const data = await api.createApiKey(body);
47
+ console.log(data);
48
+ } catch (error) {
49
+ console.error(error);
50
+ }
51
+ }
52
+
53
+ // Run the test
54
+ example().catch(console.error);
55
+ ```
56
+
57
+ ### Parameters
58
+
59
+
60
+ | Name | Type | Description | Notes |
61
+ |------------- | ------------- | ------------- | -------------|
62
+ | **apiKeyCreate** | [ApiKeyCreate](ApiKeyCreate.md) | | |
63
+
64
+ ### Return type
65
+
66
+ [**ApiKeyCreated**](ApiKeyCreated.md)
67
+
68
+ ### Authorization
69
+
70
+ [bearerAuth](../README.md#bearerAuth)
71
+
72
+ ### HTTP request headers
73
+
74
+ - **Content-Type**: `application/json`
75
+ - **Accept**: `application/json`, `application/problem+json`
76
+
77
+
78
+ ### HTTP response details
79
+ | Status code | Description | Response headers |
80
+ |-------------|-------------|------------------|
81
+ | **201** | Created. The response is sent with `Cache-Control: no-store`. | - |
82
+ | **400** | Error response (RFC 7807) | - |
83
+ | **403** | `keys_manage_required` (the calling key cannot manage keys), `scope_exceeds_caller` (the requested scopes exceed the calling key\'s own) or `forbidden` (only an org admin can mint a `full_access` key). | - |
84
+ | **422** | Error response (RFC 7807) | - |
85
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
86
+ | **0** | Error response (RFC 7807) | - |
87
+
88
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
89
+
90
+
91
+ ## getApiKey
92
+
93
+ > ApiKey getApiKey(id)
94
+
95
+ Get an API key
96
+
97
+ Returns one key. A key the caller cannot see answers 404. Requires the &#x60;keys:read&#x60; scope.
98
+
99
+ ### Example
100
+
101
+ ```ts
102
+ import {
103
+ Configuration,
104
+ ApiKeysApi,
105
+ } from '@deeprelay/sdk';
106
+ import type { GetApiKeyRequest } from '@deeprelay/sdk';
107
+
108
+ async function example() {
109
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
110
+ const config = new Configuration({
111
+ // Configure HTTP bearer authorization: bearerAuth
112
+ accessToken: "YOUR BEARER TOKEN",
113
+ });
114
+ const api = new ApiKeysApi(config);
115
+
116
+ const body = {
117
+ // string
118
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
119
+ } satisfies GetApiKeyRequest;
120
+
121
+ try {
122
+ const data = await api.getApiKey(body);
123
+ console.log(data);
124
+ } catch (error) {
125
+ console.error(error);
126
+ }
127
+ }
128
+
129
+ // Run the test
130
+ example().catch(console.error);
131
+ ```
132
+
133
+ ### Parameters
134
+
135
+
136
+ | Name | Type | Description | Notes |
137
+ |------------- | ------------- | ------------- | -------------|
138
+ | **id** | `string` | | [Defaults to `undefined`] |
139
+
140
+ ### Return type
141
+
142
+ [**ApiKey**](ApiKey.md)
143
+
144
+ ### Authorization
145
+
146
+ [bearerAuth](../README.md#bearerAuth)
147
+
148
+ ### HTTP request headers
149
+
150
+ - **Content-Type**: Not defined
151
+ - **Accept**: `application/json`, `application/problem+json`
152
+
153
+
154
+ ### HTTP response details
155
+ | Status code | Description | Response headers |
156
+ |-------------|-------------|------------------|
157
+ | **200** | OK | - |
158
+ | **404** | Error response (RFC 7807) | - |
159
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
160
+ | **0** | Error response (RFC 7807) | - |
161
+
162
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
163
+
164
+
165
+ ## listApiKeys
166
+
167
+ > ApiKeyList listApiKeys()
168
+
169
+ List API keys
170
+
171
+ Lists the organization\&#39;s API keys with their limits and current budget use. An org admin\&#39;s key and a &#x60;full_access&#x60; key see every key in the organization; any other key sees only the keys its owner created. The secret is never returned here. Requires the &#x60;keys:read&#x60; scope.
172
+
173
+ ### Example
174
+
175
+ ```ts
176
+ import {
177
+ Configuration,
178
+ ApiKeysApi,
179
+ } from '@deeprelay/sdk';
180
+ import type { ListApiKeysRequest } from '@deeprelay/sdk';
181
+
182
+ async function example() {
183
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
184
+ const config = new Configuration({
185
+ // Configure HTTP bearer authorization: bearerAuth
186
+ accessToken: "YOUR BEARER TOKEN",
187
+ });
188
+ const api = new ApiKeysApi(config);
189
+
190
+ try {
191
+ const data = await api.listApiKeys();
192
+ console.log(data);
193
+ } catch (error) {
194
+ console.error(error);
195
+ }
196
+ }
197
+
198
+ // Run the test
199
+ example().catch(console.error);
200
+ ```
201
+
202
+ ### Parameters
203
+
204
+ This endpoint does not need any parameter.
205
+
206
+ ### Return type
207
+
208
+ [**ApiKeyList**](ApiKeyList.md)
209
+
210
+ ### Authorization
211
+
212
+ [bearerAuth](../README.md#bearerAuth)
213
+
214
+ ### HTTP request headers
215
+
216
+ - **Content-Type**: Not defined
217
+ - **Accept**: `application/json`, `application/problem+json`
218
+
219
+
220
+ ### HTTP response details
221
+ | Status code | Description | Response headers |
222
+ |-------------|-------------|------------------|
223
+ | **200** | OK | - |
224
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
225
+ | **0** | Error response (RFC 7807) | - |
226
+
227
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
228
+
229
+
230
+ ## revokeApiKey
231
+
232
+ > revokeApiKey(id, idempotencyKey)
233
+
234
+ Revoke an API key
235
+
236
+ Revokes the key immediately; it cannot be restored. Requires the &#x60;keys:manage&#x60; capability (403 &#x60;keys_manage_required&#x60; otherwise); a member can only revoke keys they created.
237
+
238
+ ### Example
239
+
240
+ ```ts
241
+ import {
242
+ Configuration,
243
+ ApiKeysApi,
244
+ } from '@deeprelay/sdk';
245
+ import type { RevokeApiKeyRequest } from '@deeprelay/sdk';
246
+
247
+ async function example() {
248
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
249
+ const config = new Configuration({
250
+ // Configure HTTP bearer authorization: bearerAuth
251
+ accessToken: "YOUR BEARER TOKEN",
252
+ });
253
+ const api = new ApiKeysApi(config);
254
+
255
+ const body = {
256
+ // string
257
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
258
+ // string (optional)
259
+ idempotencyKey: idempotencyKey_example,
260
+ } satisfies RevokeApiKeyRequest;
261
+
262
+ try {
263
+ const data = await api.revokeApiKey(body);
264
+ console.log(data);
265
+ } catch (error) {
266
+ console.error(error);
267
+ }
268
+ }
269
+
270
+ // Run the test
271
+ example().catch(console.error);
272
+ ```
273
+
274
+ ### Parameters
275
+
276
+
277
+ | Name | Type | Description | Notes |
278
+ |------------- | ------------- | ------------- | -------------|
279
+ | **id** | `string` | | [Defaults to `undefined`] |
280
+ | **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
281
+
282
+ ### Return type
283
+
284
+ `void` (Empty response body)
285
+
286
+ ### Authorization
287
+
288
+ [bearerAuth](../README.md#bearerAuth)
289
+
290
+ ### HTTP request headers
291
+
292
+ - **Content-Type**: Not defined
293
+ - **Accept**: `application/problem+json`
294
+
295
+
296
+ ### HTTP response details
297
+ | Status code | Description | Response headers |
298
+ |-------------|-------------|------------------|
299
+ | **204** | Revoked | - |
300
+ | **403** | Error response (RFC 7807) | - |
301
+ | **404** | Error response (RFC 7807) | - |
302
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
303
+ | **0** | Error response (RFC 7807) | - |
304
+
305
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
306
+
307
+
308
+ ## updateApiKey
309
+
310
+ > ApiKey updateApiKey(id, apiKeyUpdate, idempotencyKey)
311
+
312
+ Update an API key\&#39;s name or limits
313
+
314
+ Changes a key\&#39;s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit &#x60;null&#x60; clears &#x60;budget_cents&#x60;, &#x60;allowed_models&#x60; or &#x60;expires_at&#x60;. &#x60;scopes&#x60; cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the &#x60;keys:manage&#x60; capability (403 &#x60;keys_manage_required&#x60; otherwise); a member can only change keys they created.
315
+
316
+ ### Example
317
+
318
+ ```ts
319
+ import {
320
+ Configuration,
321
+ ApiKeysApi,
322
+ } from '@deeprelay/sdk';
323
+ import type { UpdateApiKeyRequest } from '@deeprelay/sdk';
324
+
325
+ async function example() {
326
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
327
+ const config = new Configuration({
328
+ // Configure HTTP bearer authorization: bearerAuth
329
+ accessToken: "YOUR BEARER TOKEN",
330
+ });
331
+ const api = new ApiKeysApi(config);
332
+
333
+ const body = {
334
+ // string
335
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
336
+ // ApiKeyUpdate
337
+ apiKeyUpdate: ...,
338
+ // string (optional)
339
+ idempotencyKey: idempotencyKey_example,
340
+ } satisfies UpdateApiKeyRequest;
341
+
342
+ try {
343
+ const data = await api.updateApiKey(body);
344
+ console.log(data);
345
+ } catch (error) {
346
+ console.error(error);
347
+ }
348
+ }
349
+
350
+ // Run the test
351
+ example().catch(console.error);
352
+ ```
353
+
354
+ ### Parameters
355
+
356
+
357
+ | Name | Type | Description | Notes |
358
+ |------------- | ------------- | ------------- | -------------|
359
+ | **id** | `string` | | [Defaults to `undefined`] |
360
+ | **apiKeyUpdate** | [ApiKeyUpdate](ApiKeyUpdate.md) | | |
361
+ | **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
362
+
363
+ ### Return type
364
+
365
+ [**ApiKey**](ApiKey.md)
366
+
367
+ ### Authorization
368
+
369
+ [bearerAuth](../README.md#bearerAuth)
370
+
371
+ ### HTTP request headers
372
+
373
+ - **Content-Type**: `application/json`
374
+ - **Accept**: `application/json`, `application/problem+json`
375
+
376
+
377
+ ### HTTP response details
378
+ | Status code | Description | Response headers |
379
+ |-------------|-------------|------------------|
380
+ | **200** | OK | - |
381
+ | **400** | Error response (RFC 7807) | - |
382
+ | **403** | Error response (RFC 7807) | - |
383
+ | **404** | Error response (RFC 7807) | - |
384
+ | **422** | Error response (RFC 7807) | - |
385
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
386
+ | **0** | Error response (RFC 7807) | - |
387
+
388
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
389
+
@@ -15,6 +15,7 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
15
15
  | [**getSubscription**](BillingApi.md#getsubscription) | **GET** /billing/subscription | Get the org subscription status and quota usage |
16
16
  | [**listDeposits**](BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits |
17
17
  | [**updateSpendingLimit**](BillingApi.md#updatespendinglimitoperation) | **PUT** /billing/spending-limit | Set the org spending limit |
18
+ | [**upgradeSubscription**](BillingApi.md#upgradesubscription) | **POST** /billing/subscription/upgrade | Upgrade the subscription to a bigger plan |
18
19
 
19
20
 
20
21
 
@@ -101,7 +102,7 @@ example().catch(console.error);
101
102
 
102
103
  Start a subscription checkout session
103
104
 
104
- Opens a hosted checkout session for the flat tier and returns its URL. Requires the &#x60;billing:write&#x60; 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\&#39;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 &#x60;/billing/subscription&#x60; to confirm. &#x60;success_url&#x60; and &#x60;cancel_url&#x60; are optional and fall back to the deployment\&#39;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 \&quot;use every default\&quot;. &#x60;plan_key&#x60;, 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.
105
+ Opens a hosted checkout session for a subscription plan and returns its URL. Requires the &#x60;billing:write&#x60; 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\&#39;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 &#x60;/billing/subscription&#x60; to confirm. &#x60;success_url&#x60; and &#x60;cancel_url&#x60; are optional and fall back to the deployment\&#39;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 \&quot;use every default\&quot;. When sent, they must be on the deployment\&#39;s dashboard origin, else 422 &#x60;validation_failed&#x60;. &#x60;plan_key&#x60; names the plan to buy: &#x60;flat&#x60; (Base, the default when the field is omitted) or &#x60;plus&#x60;. It pins the plan the client DISPLAYED — an unknown key, or a plan this deployment does not offer, is a 400 rather than a silent purchase of a different tier. The &#x60;plans&#x60; array on &#x60;/billing/subscription&#x60; lists the accepted keys. One subscription per organization: a second checkout while an entitling subscription exists is a 409. To move an existing subscription to a bigger plan use &#x60;/billing/subscription/upgrade&#x60;. &#x60;method&#x60; picks how the plan is paid: &#x60;card&#x60; (dollars, card or Link; the default) or &#x60;upi&#x60; (rupees, UPI AutoPay, India). On an organization that already subscribes, an explicit &#x60;method&#x60; in the other currency is a switch, not a second subscription: the link saves the new card or UPI AutoPay mandate (nothing is charged), and once that completes the same plan is moved to the new currency, first charged on the current renewal date (that month is already paid). The answer then carries &#x60;switch_to&#x60; and &#x60;first_charge_at&#x60;. A switch is refused (409) within two days of renewal, while the plan is set to cancel, while an upgrade waits on its UPI payment, and in the currency the plan already uses.
105
106
 
106
107
  ### Example
107
108
 
@@ -459,7 +460,7 @@ example().catch(console.error);
459
460
 
460
461
  Get the org referral code, invite link, terms and stats
461
462
 
462
- Returns the organization\&#39;s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\&#39;s stats, and — when this organization itself signed up through someone else\&#39;s link — its own progress toward the referee reward. Requires the &#x60;billing:read&#x60; scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends &#x60;qualify_spend_cents&#x60; on inference, the referrer receives &#x60;reward_cents&#x60; and the friend receives &#x60;referee_reward_cents&#x60;, both as non-withdrawable credit, after a &#x60;hold_days&#x60; chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. &#x60;referred&#x60; is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\&#39;s referral card reads.
463
+ Returns the organization\&#39;s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\&#39;s stats, and — when this organization itself signed up through someone else\&#39;s link — its own progress toward the referee reward. Requires the &#x60;billing:read&#x60; scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; when a friend signs up through it and spends &#x60;qualify_spend_cents&#x60; on inference, the referrer receives &#x60;reward_cents&#x60; and the friend receives &#x60;referee_reward_cents&#x60;, both as non-withdrawable credit, after a &#x60;hold_days&#x60; chargeback hold. The referrer also earns &#x60;commission_pct&#x60; percent of every real deposit the friend makes, credited as spend-only promotional credit when the deposit clears (&#x60;commission_earned_cents&#x60;). Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. &#x60;referred&#x60; is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\&#39;s referral card reads.
463
464
 
464
465
  ### Example
465
466
 
@@ -590,7 +591,7 @@ This endpoint does not need any parameter.
590
591
 
591
592
  Get the org subscription status and quota usage
592
593
 
593
- Returns the organization\&#39;s flat-tier subscription: whether it is entitled, the current billing period, the plan\&#39;s configured quota, and — for an entitled subscription — consumption against the four limits the server enforces on every request. Requires the &#x60;billing:read&#x60; 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 &#x60;subscribed: false&#x60;, &#x60;status: \&quot;none\&quot;&#x60; and the quota the plan would provide, so a client can answer \&quot;what does the plan include\&quot; without a second endpoint and without an error path. Read &#x60;subscribed&#x60;, not &#x60;status&#x60;, to decide whether the plan applies: &#x60;status&#x60; carries the billing provider\&#39;s vocabulary, and the two can disagree — an &#x60;active&#x60; subscription just past its period end still entitles for a short grace window (renewal-webhook lag), while &#x60;past_due&#x60; and &#x60;canceled&#x60; never entitle. &#x60;usage&#x60; is present only for an entitled subscription whose meter could be read. An absent &#x60;usage&#x60; NEVER means \&quot;nothing used\&quot; — reading it as zero would report a full quota to an organization that has none left. This is the plan\&#39;s meter. For pay-as-you-go credit see &#x60;/billing/balance&#x60;, for spend against a self-set cap see &#x60;/billing/spending-limit&#x60;, and for past consumption see &#x60;/usage&#x60;.
594
+ Returns the organization\&#39;s subscription: whether it is entitled, the current billing period, the plan it is on and that plan\&#39;s configured quota, and — for an entitled subscription — consumption against the limits the server enforces on every request. Requires the &#x60;billing:read&#x60; scope. The organization is taken from the authenticated API key, never from a parameter. &#x60;plan&#x60; and &#x60;quota&#x60; describe the plan the organization IS on (the Base plan for an organization that never subscribed). &#x60;plans&#x60; lists every plan this deployment offers — Base, then Plus — each with its price and quota, so a client can render an upgrade offer without a second call. An organization that never subscribed is NOT an error. It gets 200 with &#x60;subscribed: false&#x60;, &#x60;status: \&quot;none\&quot;&#x60; and the quota the Base plan would provide, so a client can answer \&quot;what does the plan include\&quot; without a second endpoint and without an error path. Read &#x60;subscribed&#x60;, not &#x60;status&#x60;, to decide whether the plan applies: &#x60;status&#x60; carries the billing provider\&#39;s vocabulary, and the two can disagree — an &#x60;active&#x60; subscription just past its period end still entitles for a short grace window (renewal-webhook lag), while &#x60;past_due&#x60; and &#x60;canceled&#x60; never entitle. &#x60;usage&#x60; is present only for an entitled subscription whose meter could be read. An absent &#x60;usage&#x60; NEVER means \&quot;nothing used\&quot; — reading it as zero would report a full quota to an organization that has none left. This is the plan\&#39;s meter. For pay-as-you-go credit see &#x60;/billing/balance&#x60;, for spend against a self-set cap see &#x60;/billing/spending-limit&#x60;, and for past consumption see &#x60;/usage&#x60;.
594
595
 
595
596
  ### Example
596
597
 
@@ -789,3 +790,82 @@ example().catch(console.error);
789
790
 
790
791
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
791
792
 
793
+
794
+ ## upgradeSubscription
795
+
796
+ > Subscription upgradeSubscription(subscriptionUpgradeRequest)
797
+
798
+ Upgrade the subscription to a bigger plan
799
+
800
+ Moves the organization\&#39;s EXISTING subscription onto a bigger plan. Requires the &#x60;billing:write&#x60; scope AND organization-admin privileges — an upgrade charges the organization\&#39;s card on file. Unlike checkout, no hosted page is involved: the subscription\&#39;s price is swapped, the new plan\&#39;s FULL price is charged immediately (whenever in the cycle the upgrade happens), and a new billing period starts now. There is no credit for the unused remainder of the old plan\&#39;s period, and the usage meters start from zero on the new plan because every quota window is summed over the current period. The response is the post-upgrade subscription, in the same shape as &#x60;/billing/subscription&#x60;. &#x60;plan_key&#x60; is required and names the target plan (&#x60;plus&#x60;). The target must be bigger than the plan the organization is on: upgrading to the current plan or to a smaller one is a 409 &#x60;not_an_upgrade&#x60; — downgrades go through the billing portal. An organization with no entitling subscription gets 409 &#x60;not_subscribed&#x60; and should use checkout instead. A subscription already set to end at the period close is refused with 409 &#x60;subscription_cancelling&#x60; (the upgrade would start a new period and move that end date); resume it in the portal first. If the charge cannot be collected (card declined, no payment method) the call is a 402 &#x60;payment_failed&#x60; and NOTHING changes — the organization stays on its current plan. Fix the card in the billing portal and retry.
801
+
802
+ ### Example
803
+
804
+ ```ts
805
+ import {
806
+ Configuration,
807
+ BillingApi,
808
+ } from '@deeprelay/sdk';
809
+ import type { UpgradeSubscriptionRequest } from '@deeprelay/sdk';
810
+
811
+ async function example() {
812
+ console.log("🚀 Testing @deeprelay/sdk SDK...");
813
+ const config = new Configuration({
814
+ // Configure HTTP bearer authorization: bearerAuth
815
+ accessToken: "YOUR BEARER TOKEN",
816
+ });
817
+ const api = new BillingApi(config);
818
+
819
+ const body = {
820
+ // SubscriptionUpgradeRequest
821
+ subscriptionUpgradeRequest: ...,
822
+ } satisfies UpgradeSubscriptionRequest;
823
+
824
+ try {
825
+ const data = await api.upgradeSubscription(body);
826
+ console.log(data);
827
+ } catch (error) {
828
+ console.error(error);
829
+ }
830
+ }
831
+
832
+ // Run the test
833
+ example().catch(console.error);
834
+ ```
835
+
836
+ ### Parameters
837
+
838
+
839
+ | Name | Type | Description | Notes |
840
+ |------------- | ------------- | ------------- | -------------|
841
+ | **subscriptionUpgradeRequest** | [SubscriptionUpgradeRequest](SubscriptionUpgradeRequest.md) | | |
842
+
843
+ ### Return type
844
+
845
+ [**Subscription**](Subscription.md)
846
+
847
+ ### Authorization
848
+
849
+ [bearerAuth](../README.md#bearerAuth)
850
+
851
+ ### HTTP request headers
852
+
853
+ - **Content-Type**: `application/json`
854
+ - **Accept**: `application/json`, `application/problem+json`
855
+
856
+
857
+ ### HTTP response details
858
+ | Status code | Description | Response headers |
859
+ |-------------|-------------|------------------|
860
+ | **200** | OK — the subscription after the upgrade | - |
861
+ | **400** | Unknown plan_key, or a plan this deployment does not offer | - |
862
+ | **402** | Payment for the new plan failed; the current plan is unchanged | - |
863
+ | **403** | Not an organization admin | - |
864
+ | **409** | &#x60;not_subscribed&#x60; — no active subscription to upgrade (use checkout); &#x60;not_an_upgrade&#x60; — the target is the current plan or a smaller one; &#x60;subscription_cancelling&#x60; — the subscription is set to end at the period close (resume it in the portal first) | - |
865
+ | **422** | plan_key is missing | - |
866
+ | **503** | Subscription billing is not configured on this deployment | - |
867
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
868
+ | **0** | Error response (RFC 7807) | - |
869
+
870
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
871
+
@@ -9,6 +9,7 @@ Name | Type
9
9
  `index` | number
10
10
  `message` | [ChatMessage](ChatMessage.md)
11
11
  `finishReason` | string
12
+ `logprobs` | { [key: string]: any; }
12
13
 
13
14
  ## Example
14
15
 
@@ -20,6 +21,7 @@ const example = {
20
21
  "index": null,
21
22
  "message": null,
22
23
  "finishReason": null,
24
+ "logprobs": null,
23
25
  } satisfies ChatChoice
24
26
 
25
27
  console.log(example)
@@ -10,8 +10,19 @@ Name | Type
10
10
  `messages` | [Array&lt;ChatMessage&gt;](ChatMessage.md)
11
11
  `temperature` | number
12
12
  `maxTokens` | number
13
+ `maxCompletionTokens` | number
13
14
  `stream` | boolean
14
15
  `streamOptions` | [StreamOptions](StreamOptions.md)
16
+ `tools` | [Array&lt;Tool&gt;](Tool.md)
17
+ `toolChoice` | [ChatCompletionRequestToolChoice](ChatCompletionRequestToolChoice.md)
18
+ `responseFormat` | [ChatCompletionRequestResponseFormat](ChatCompletionRequestResponseFormat.md)
19
+ `reasoningEffort` | string
20
+ `presencePenalty` | number
21
+ `frequencyPenalty` | number
22
+ `seed` | number
23
+ `parallelToolCalls` | boolean
24
+ `logprobs` | boolean
25
+ `topLogprobs` | number
15
26
 
16
27
  ## Example
17
28
 
@@ -24,8 +35,19 @@ const example = {
24
35
  "messages": null,
25
36
  "temperature": null,
26
37
  "maxTokens": null,
38
+ "maxCompletionTokens": null,
27
39
  "stream": null,
28
40
  "streamOptions": null,
41
+ "tools": null,
42
+ "toolChoice": null,
43
+ "responseFormat": null,
44
+ "reasoningEffort": null,
45
+ "presencePenalty": null,
46
+ "frequencyPenalty": null,
47
+ "seed": null,
48
+ "parallelToolCalls": null,
49
+ "logprobs": null,
50
+ "topLogprobs": null,
29
51
  } satisfies ChatCompletionRequest
30
52
 
31
53
  console.log(example)
@@ -0,0 +1,37 @@
1
+
2
+ # ChatCompletionRequestResponseFormat
3
+
4
+ Constrain the reply format. Gated per model: `json_object` needs \"response_format\" in the model\'s supported_parameters, and a strict `json_schema` needs \"structured_outputs\". A model without the capability returns 400 unsupported_parameter naming the models that have it. A non-strict json_schema on a model with only \"response_format\" is served as json_object and reported as `response_format:downgraded` in x-deeprelay-ignored-params. The relay never emulates JSON mode by prompting.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `jsonSchema` | [JSONSchemaFormat](JSONSchemaFormat.md)
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { ChatCompletionRequestResponseFormat } from '@deeprelay/sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "type": null,
21
+ "jsonSchema": null,
22
+ } satisfies ChatCompletionRequestResponseFormat
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as ChatCompletionRequestResponseFormat
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
@@ -0,0 +1,37 @@
1
+
2
+ # ChatCompletionRequestToolChoice
3
+
4
+ How the model should pick a tool: the strings \"none\", \"auto\" or \"required\", or an object naming one function. Requires a non-empty tools array unless it is \"none\".
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `type` | string
11
+ `_function` | [ToolChoiceFunctionFunction](ToolChoiceFunctionFunction.md)
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { ChatCompletionRequestToolChoice } from '@deeprelay/sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "type": null,
21
+ "_function": null,
22
+ } satisfies ChatCompletionRequestToolChoice
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as ChatCompletionRequestToolChoice
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
@@ -8,6 +8,8 @@ Name | Type
8
8
  ------------ | -------------
9
9
  `role` | string
10
10
  `content` | string
11
+ `toolCalls` | [Array&lt;ToolCall&gt;](ToolCall.md)
12
+ `toolCallId` | string
11
13
 
12
14
  ## Example
13
15
 
@@ -18,6 +20,8 @@ import type { ChatMessage } from '@deeprelay/sdk'
18
20
  const example = {
19
21
  "role": null,
20
22
  "content": null,
23
+ "toolCalls": null,
24
+ "toolCallId": null,
21
25
  } satisfies ChatMessage
22
26
 
23
27
  console.log(example)