@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.
- package/.openapi-generator/FILES +126 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +24 -0
- package/LICENSE +204 -0
- package/README.md +197 -4
- package/dist/apis/BillingApi.d.ts +169 -0
- package/dist/apis/BillingApi.js +457 -0
- package/dist/apis/InferenceApi.d.ts +217 -0
- package/dist/apis/InferenceApi.js +582 -0
- package/dist/apis/MetaApi.d.ts +44 -0
- package/dist/apis/MetaApi.js +105 -0
- package/dist/apis/OperationsApi.d.ts +33 -0
- package/dist/apis/OperationsApi.js +79 -0
- package/dist/apis/UsageApi.d.ts +56 -0
- package/dist/apis/UsageApi.js +109 -0
- package/dist/apis/WebhooksApi.d.ts +82 -0
- package/dist/apis/WebhooksApi.js +224 -0
- package/dist/apis/index.d.ts +6 -0
- package/dist/apis/index.js +24 -0
- package/dist/esm/apis/BillingApi.d.ts +169 -0
- package/dist/esm/apis/BillingApi.js +453 -0
- package/dist/esm/apis/InferenceApi.d.ts +217 -0
- package/dist/esm/apis/InferenceApi.js +578 -0
- package/dist/esm/apis/MetaApi.d.ts +44 -0
- package/dist/esm/apis/MetaApi.js +101 -0
- package/dist/esm/apis/OperationsApi.d.ts +33 -0
- package/dist/esm/apis/OperationsApi.js +75 -0
- package/dist/esm/apis/UsageApi.d.ts +56 -0
- package/dist/esm/apis/UsageApi.js +105 -0
- package/dist/esm/apis/WebhooksApi.d.ts +82 -0
- package/dist/esm/apis/WebhooksApi.js +220 -0
- package/dist/esm/apis/index.d.ts +6 -0
- package/dist/esm/apis/index.js +8 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/Balance.d.ts +65 -0
- package/dist/esm/models/Balance.js +63 -0
- package/dist/esm/models/ChatChoice.d.ts +55 -0
- package/dist/esm/models/ChatChoice.js +55 -0
- package/dist/esm/models/ChatCompletionRequest.d.ts +64 -0
- package/dist/esm/models/ChatCompletionRequest.js +57 -0
- package/dist/esm/models/ChatCompletionResponse.d.ts +71 -0
- package/dist/esm/models/ChatCompletionResponse.js +73 -0
- package/dist/esm/models/ChatMessage.d.ts +47 -0
- package/dist/esm/models/ChatMessage.js +55 -0
- package/dist/esm/models/CreateCryptoDepositRequest.d.ts +64 -0
- package/dist/esm/models/CreateCryptoDepositRequest.js +68 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +50 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.js +58 -0
- package/dist/esm/models/CryptoDeposit.d.ts +114 -0
- package/dist/esm/models/CryptoDeposit.js +90 -0
- package/dist/esm/models/Embedding.d.ts +51 -0
- package/dist/esm/models/Embedding.js +59 -0
- package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/esm/models/EmbeddingsRequest.js +60 -0
- package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
- package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/esm/models/EmbeddingsResponse.js +65 -0
- package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/esm/models/EmbeddingsUsage.js +47 -0
- package/dist/esm/models/GetHealth200Response.d.ts +39 -0
- package/dist/esm/models/GetHealth200Response.js +47 -0
- package/dist/esm/models/ImagesGenerationsRequest.d.ts +63 -0
- package/dist/esm/models/ImagesGenerationsRequest.js +59 -0
- package/dist/esm/models/ImagesResponse.d.ts +46 -0
- package/dist/esm/models/ImagesResponse.js +53 -0
- package/dist/esm/models/ImagesResponseDataInner.d.ts +32 -0
- package/dist/esm/models/ImagesResponseDataInner.js +43 -0
- package/dist/esm/models/ImagesResponseUsage.d.ts +32 -0
- package/dist/esm/models/ImagesResponseUsage.js +43 -0
- package/dist/esm/models/InferencePreflight.d.ts +92 -0
- package/dist/esm/models/InferencePreflight.js +86 -0
- package/dist/esm/models/ListDeposits200Response.d.ts +39 -0
- package/dist/esm/models/ListDeposits200Response.js +48 -0
- package/dist/esm/models/Model.d.ts +152 -0
- package/dist/esm/models/Model.js +110 -0
- package/dist/esm/models/ModelList.d.ts +46 -0
- package/dist/esm/models/ModelList.js +56 -0
- package/dist/esm/models/ModelParametersInner.d.ts +72 -0
- package/dist/esm/models/ModelParametersInner.js +64 -0
- package/dist/esm/models/ModelPricing.d.ts +126 -0
- package/dist/esm/models/ModelPricing.js +78 -0
- package/dist/esm/models/ModelRate.d.ts +62 -0
- package/dist/esm/models/ModelRate.js +51 -0
- package/dist/esm/models/OpenAIErrorEnvelope.d.ts +33 -0
- package/dist/esm/models/OpenAIErrorEnvelope.js +44 -0
- package/dist/esm/models/OpenAIErrorEnvelopeError.d.ts +50 -0
- package/dist/esm/models/OpenAIErrorEnvelopeError.js +53 -0
- package/dist/esm/models/Operation.d.ts +107 -0
- package/dist/esm/models/Operation.js +86 -0
- package/dist/esm/models/OperationError.d.ts +38 -0
- package/dist/esm/models/OperationError.js +43 -0
- package/dist/esm/models/OperationResult.d.ts +44 -0
- package/dist/esm/models/OperationResult.js +45 -0
- package/dist/esm/models/PeakWindow.d.ts +38 -0
- package/dist/esm/models/PeakWindow.js +47 -0
- package/dist/esm/models/Problem.d.ts +87 -0
- package/dist/esm/models/Problem.js +87 -0
- package/dist/esm/models/SpendingLimit.d.ts +101 -0
- package/dist/esm/models/SpendingLimit.js +85 -0
- package/dist/esm/models/StreamOptions.d.ts +32 -0
- package/dist/esm/models/StreamOptions.js +41 -0
- package/dist/esm/models/Subscription.d.ts +78 -0
- package/dist/esm/models/Subscription.js +68 -0
- package/dist/esm/models/SubscriptionCheckoutRequest.d.ts +45 -0
- package/dist/esm/models/SubscriptionCheckoutRequest.js +45 -0
- package/dist/esm/models/SubscriptionCheckoutSession.d.ts +45 -0
- package/dist/esm/models/SubscriptionCheckoutSession.js +52 -0
- package/dist/esm/models/SubscriptionPlan.d.ts +46 -0
- package/dist/esm/models/SubscriptionPlan.js +50 -0
- package/dist/esm/models/SubscriptionPortalRequest.d.ts +32 -0
- package/dist/esm/models/SubscriptionPortalRequest.js +41 -0
- package/dist/esm/models/SubscriptionPortalSession.d.ts +32 -0
- package/dist/esm/models/SubscriptionPortalSession.js +43 -0
- package/dist/esm/models/SubscriptionPrice.d.ts +53 -0
- package/dist/esm/models/SubscriptionPrice.js +55 -0
- package/dist/esm/models/SubscriptionQuota.d.ts +60 -0
- package/dist/esm/models/SubscriptionQuota.js +59 -0
- package/dist/esm/models/SubscriptionUsage.d.ts +65 -0
- package/dist/esm/models/SubscriptionUsage.js +63 -0
- package/dist/esm/models/UpdateSpendingLimitRequest.d.ts +59 -0
- package/dist/esm/models/UpdateSpendingLimitRequest.js +57 -0
- package/dist/esm/models/Usage.d.ts +44 -0
- package/dist/esm/models/Usage.js +51 -0
- package/dist/esm/models/UsageBucket.d.ts +56 -0
- package/dist/esm/models/UsageBucket.js +55 -0
- package/dist/esm/models/UsagePage.d.ts +39 -0
- package/dist/esm/models/UsagePage.js +48 -0
- package/dist/esm/models/VideoCreateRequest.d.ts +50 -0
- package/dist/esm/models/VideoCreateRequest.js +51 -0
- package/dist/esm/models/VideoJob.d.ts +117 -0
- package/dist/esm/models/VideoJob.js +94 -0
- package/dist/esm/models/VideoList.d.ts +52 -0
- package/dist/esm/models/VideoList.js +60 -0
- package/dist/esm/models/WebhookEndpoint.d.ts +74 -0
- package/dist/esm/models/WebhookEndpoint.js +72 -0
- package/dist/esm/models/WebhookEndpointPage.d.ts +39 -0
- package/dist/esm/models/WebhookEndpointPage.js +48 -0
- package/dist/esm/models/index.d.ts +52 -0
- package/dist/esm/models/index.js +54 -0
- package/dist/esm/runtime.d.ts +185 -0
- package/dist/esm/runtime.js +354 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Balance.d.ts +65 -0
- package/dist/models/Balance.js +70 -0
- package/dist/models/ChatChoice.d.ts +55 -0
- package/dist/models/ChatChoice.js +63 -0
- package/dist/models/ChatCompletionRequest.d.ts +64 -0
- package/dist/models/ChatCompletionRequest.js +64 -0
- package/dist/models/ChatCompletionResponse.d.ts +71 -0
- package/dist/models/ChatCompletionResponse.js +81 -0
- package/dist/models/ChatMessage.d.ts +47 -0
- package/dist/models/ChatMessage.js +63 -0
- package/dist/models/CreateCryptoDepositRequest.d.ts +64 -0
- package/dist/models/CreateCryptoDepositRequest.js +76 -0
- package/dist/models/CreateWebhookEndpointRequest.d.ts +50 -0
- package/dist/models/CreateWebhookEndpointRequest.js +66 -0
- package/dist/models/CryptoDeposit.d.ts +114 -0
- package/dist/models/CryptoDeposit.js +98 -0
- package/dist/models/Embedding.d.ts +51 -0
- package/dist/models/Embedding.js +67 -0
- package/dist/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/models/EmbeddingsRequest.js +68 -0
- package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/models/EmbeddingsRequestInput.js +53 -0
- package/dist/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/models/EmbeddingsResponse.js +73 -0
- package/dist/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/models/EmbeddingsUsage.js +54 -0
- package/dist/models/GetHealth200Response.d.ts +39 -0
- package/dist/models/GetHealth200Response.js +55 -0
- package/dist/models/ImagesGenerationsRequest.d.ts +63 -0
- package/dist/models/ImagesGenerationsRequest.js +67 -0
- package/dist/models/ImagesResponse.d.ts +46 -0
- package/dist/models/ImagesResponse.js +60 -0
- package/dist/models/ImagesResponseDataInner.d.ts +32 -0
- package/dist/models/ImagesResponseDataInner.js +50 -0
- package/dist/models/ImagesResponseUsage.d.ts +32 -0
- package/dist/models/ImagesResponseUsage.js +50 -0
- package/dist/models/InferencePreflight.d.ts +92 -0
- package/dist/models/InferencePreflight.js +94 -0
- package/dist/models/ListDeposits200Response.d.ts +39 -0
- package/dist/models/ListDeposits200Response.js +55 -0
- package/dist/models/Model.d.ts +152 -0
- package/dist/models/Model.js +118 -0
- package/dist/models/ModelList.d.ts +46 -0
- package/dist/models/ModelList.js +64 -0
- package/dist/models/ModelParametersInner.d.ts +72 -0
- package/dist/models/ModelParametersInner.js +72 -0
- package/dist/models/ModelPricing.d.ts +126 -0
- package/dist/models/ModelPricing.js +86 -0
- package/dist/models/ModelRate.d.ts +62 -0
- package/dist/models/ModelRate.js +58 -0
- package/dist/models/OpenAIErrorEnvelope.d.ts +33 -0
- package/dist/models/OpenAIErrorEnvelope.js +51 -0
- package/dist/models/OpenAIErrorEnvelopeError.d.ts +50 -0
- package/dist/models/OpenAIErrorEnvelopeError.js +60 -0
- package/dist/models/Operation.d.ts +107 -0
- package/dist/models/Operation.js +94 -0
- package/dist/models/OperationError.d.ts +38 -0
- package/dist/models/OperationError.js +50 -0
- package/dist/models/OperationResult.d.ts +44 -0
- package/dist/models/OperationResult.js +52 -0
- package/dist/models/PeakWindow.d.ts +38 -0
- package/dist/models/PeakWindow.js +54 -0
- package/dist/models/Problem.d.ts +87 -0
- package/dist/models/Problem.js +95 -0
- package/dist/models/SpendingLimit.d.ts +101 -0
- package/dist/models/SpendingLimit.js +93 -0
- package/dist/models/StreamOptions.d.ts +32 -0
- package/dist/models/StreamOptions.js +48 -0
- package/dist/models/Subscription.d.ts +78 -0
- package/dist/models/Subscription.js +75 -0
- package/dist/models/SubscriptionCheckoutRequest.d.ts +45 -0
- package/dist/models/SubscriptionCheckoutRequest.js +52 -0
- package/dist/models/SubscriptionCheckoutSession.d.ts +45 -0
- package/dist/models/SubscriptionCheckoutSession.js +59 -0
- package/dist/models/SubscriptionPlan.d.ts +46 -0
- package/dist/models/SubscriptionPlan.js +57 -0
- package/dist/models/SubscriptionPortalRequest.d.ts +32 -0
- package/dist/models/SubscriptionPortalRequest.js +48 -0
- package/dist/models/SubscriptionPortalSession.d.ts +32 -0
- package/dist/models/SubscriptionPortalSession.js +50 -0
- package/dist/models/SubscriptionPrice.d.ts +53 -0
- package/dist/models/SubscriptionPrice.js +62 -0
- package/dist/models/SubscriptionQuota.d.ts +60 -0
- package/dist/models/SubscriptionQuota.js +66 -0
- package/dist/models/SubscriptionUsage.d.ts +65 -0
- package/dist/models/SubscriptionUsage.js +70 -0
- package/dist/models/UpdateSpendingLimitRequest.d.ts +59 -0
- package/dist/models/UpdateSpendingLimitRequest.js +65 -0
- package/dist/models/Usage.d.ts +44 -0
- package/dist/models/Usage.js +58 -0
- package/dist/models/UsageBucket.d.ts +56 -0
- package/dist/models/UsageBucket.js +62 -0
- package/dist/models/UsagePage.d.ts +39 -0
- package/dist/models/UsagePage.js +55 -0
- package/dist/models/VideoCreateRequest.d.ts +50 -0
- package/dist/models/VideoCreateRequest.js +58 -0
- package/dist/models/VideoJob.d.ts +117 -0
- package/dist/models/VideoJob.js +102 -0
- package/dist/models/VideoList.d.ts +52 -0
- package/dist/models/VideoList.js +68 -0
- package/dist/models/WebhookEndpoint.d.ts +74 -0
- package/dist/models/WebhookEndpoint.js +80 -0
- package/dist/models/WebhookEndpointPage.d.ts +39 -0
- package/dist/models/WebhookEndpointPage.js +55 -0
- package/dist/models/index.d.ts +52 -0
- package/dist/models/index.js +70 -0
- package/dist/runtime.d.ts +185 -0
- package/dist/runtime.js +371 -0
- package/docs/Balance.md +45 -0
- package/docs/BillingApi.md +657 -0
- package/docs/ChatChoice.md +38 -0
- package/docs/ChatCompletionRequest.md +44 -0
- package/docs/ChatCompletionResponse.md +44 -0
- package/docs/ChatMessage.md +36 -0
- package/docs/CreateCryptoDepositRequest.md +38 -0
- package/docs/CreateWebhookEndpointRequest.md +36 -0
- package/docs/CryptoDeposit.md +55 -0
- package/docs/Embedding.md +38 -0
- package/docs/EmbeddingsRequest.md +42 -0
- package/docs/EmbeddingsRequestInput.md +33 -0
- package/docs/EmbeddingsResponse.md +40 -0
- package/docs/EmbeddingsUsage.md +37 -0
- package/docs/GetHealth200Response.md +34 -0
- package/docs/ImagesGenerationsRequest.md +42 -0
- package/docs/ImagesResponse.md +38 -0
- package/docs/ImagesResponseDataInner.md +34 -0
- package/docs/ImagesResponseUsage.md +34 -0
- package/docs/InferenceApi.md +861 -0
- package/docs/InferencePreflight.md +47 -0
- package/docs/ListDeposits200Response.md +36 -0
- package/docs/MetaApi.md +126 -0
- package/docs/Model.md +64 -0
- package/docs/ModelList.md +36 -0
- package/docs/ModelParametersInner.md +44 -0
- package/docs/ModelPricing.md +62 -0
- package/docs/ModelRate.md +45 -0
- package/docs/OpenAIErrorEnvelope.md +34 -0
- package/docs/OpenAIErrorEnvelopeError.md +40 -0
- package/docs/Operation.md +52 -0
- package/docs/OperationError.md +36 -0
- package/docs/OperationResult.md +39 -0
- package/docs/OperationsApi.md +80 -0
- package/docs/PeakWindow.md +37 -0
- package/docs/Problem.md +44 -0
- package/docs/SpendingLimit.md +54 -0
- package/docs/StreamOptions.md +34 -0
- package/docs/Subscription.md +49 -0
- package/docs/SubscriptionCheckoutRequest.md +39 -0
- package/docs/SubscriptionCheckoutSession.md +38 -0
- package/docs/SubscriptionPlan.md +39 -0
- package/docs/SubscriptionPortalRequest.md +35 -0
- package/docs/SubscriptionPortalSession.md +34 -0
- package/docs/SubscriptionPrice.md +41 -0
- package/docs/SubscriptionQuota.md +43 -0
- package/docs/SubscriptionUsage.md +45 -0
- package/docs/UpdateSpendingLimitRequest.md +40 -0
- package/docs/Usage.md +38 -0
- package/docs/UsageApi.md +95 -0
- package/docs/UsageBucket.md +42 -0
- package/docs/UsagePage.md +36 -0
- package/docs/VideoCreateRequest.md +40 -0
- package/docs/VideoJob.md +56 -0
- package/docs/VideoList.md +38 -0
- package/docs/WebhookEndpoint.md +44 -0
- package/docs/WebhookEndpointPage.md +36 -0
- package/docs/WebhooksApi.md +302 -0
- package/package.json +16 -7
- package/src/apis/BillingApi.ts +559 -0
- package/src/apis/InferenceApi.ts +753 -0
- package/src/apis/MetaApi.ts +103 -0
- package/src/apis/OperationsApi.ts +89 -0
- package/src/apis/UsageApi.ts +129 -0
- package/src/apis/WebhooksApi.ts +277 -0
- package/src/apis/index.ts +8 -0
- package/src/index.ts +5 -0
- package/src/models/Balance.ts +114 -0
- package/src/models/ChatChoice.ts +102 -0
- package/src/models/ChatCompletionRequest.ts +122 -0
- package/src/models/ChatCompletionResponse.ts +138 -0
- package/src/models/ChatMessage.ts +87 -0
- package/src/models/CreateCryptoDepositRequest.ts +108 -0
- package/src/models/CreateWebhookEndpointRequest.ts +90 -0
- package/src/models/CryptoDeposit.ts +177 -0
- package/src/models/Embedding.ts +96 -0
- package/src/models/EmbeddingsRequest.ts +117 -0
- package/src/models/EmbeddingsRequestInput.ts +59 -0
- package/src/models/EmbeddingsResponse.ts +120 -0
- package/src/models/EmbeddingsUsage.ts +75 -0
- package/src/models/GetHealth200Response.ts +75 -0
- package/src/models/ImagesGenerationsRequest.ts +109 -0
- package/src/models/ImagesResponse.ts +99 -0
- package/src/models/ImagesResponseDataInner.ts +66 -0
- package/src/models/ImagesResponseUsage.ts +66 -0
- package/src/models/InferencePreflight.ts +147 -0
- package/src/models/ListDeposits200Response.ts +83 -0
- package/src/models/Model.ts +241 -0
- package/src/models/ModelList.ts +95 -0
- package/src/models/ModelParametersInner.ts +120 -0
- package/src/models/ModelPricing.ts +203 -0
- package/src/models/ModelRate.ts +105 -0
- package/src/models/OpenAIErrorEnvelope.ts +74 -0
- package/src/models/OpenAIErrorEnvelopeError.ts +92 -0
- package/src/models/Operation.ts +179 -0
- package/src/models/OperationError.ts +73 -0
- package/src/models/OperationResult.ts +81 -0
- package/src/models/PeakWindow.ts +75 -0
- package/src/models/Problem.ts +139 -0
- package/src/models/SpendingLimit.ts +165 -0
- package/src/models/StreamOptions.ts +65 -0
- package/src/models/Subscription.ts +149 -0
- package/src/models/SubscriptionCheckoutRequest.ts +82 -0
- package/src/models/SubscriptionCheckoutSession.ts +92 -0
- package/src/models/SubscriptionPlan.ts +92 -0
- package/src/models/SubscriptionPortalRequest.ts +65 -0
- package/src/models/SubscriptionPortalSession.ts +66 -0
- package/src/models/SubscriptionPrice.ts +96 -0
- package/src/models/SubscriptionQuota.ts +106 -0
- package/src/models/SubscriptionUsage.ts +114 -0
- package/src/models/UpdateSpendingLimitRequest.ts +102 -0
- package/src/models/Usage.ts +84 -0
- package/src/models/UsageBucket.ts +100 -0
- package/src/models/UsagePage.ts +83 -0
- package/src/models/VideoCreateRequest.ts +91 -0
- package/src/models/VideoJob.ts +184 -0
- package/src/models/VideoList.ts +104 -0
- package/src/models/WebhookEndpoint.ts +125 -0
- package/src/models/WebhookEndpointPage.ts +83 -0
- package/src/models/index.ts +54 -0
- package/src/runtime.ts +454 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
# BillingApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.deeprelay.ai/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createCryptoDeposit**](BillingApi.md#createcryptodepositoperation) | **POST** /billing/deposits/crypto | Create a stablecoin deposit |
|
|
8
|
+
| [**createSubscriptionCheckout**](BillingApi.md#createsubscriptioncheckout) | **POST** /billing/subscription/checkout | Start a subscription checkout session |
|
|
9
|
+
| [**createSubscriptionPortal**](BillingApi.md#createsubscriptionportal) | **POST** /billing/subscription/portal | Open the billing portal to cancel or manage the subscription |
|
|
10
|
+
| [**getBalance**](BillingApi.md#getbalance) | **GET** /billing/balance | Get the org credit balance |
|
|
11
|
+
| [**getDeposit**](BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit |
|
|
12
|
+
| [**getSpendingLimit**](BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit |
|
|
13
|
+
| [**getSubscription**](BillingApi.md#getsubscription) | **GET** /billing/subscription | Get the org subscription status and quota usage |
|
|
14
|
+
| [**listDeposits**](BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits |
|
|
15
|
+
| [**updateSpendingLimit**](BillingApi.md#updatespendinglimitoperation) | **PUT** /billing/spending-limit | Set the org spending limit |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## createCryptoDeposit
|
|
20
|
+
|
|
21
|
+
> CryptoDeposit createCryptoDeposit(createCryptoDepositRequest)
|
|
22
|
+
|
|
23
|
+
Create a stablecoin deposit
|
|
24
|
+
|
|
25
|
+
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.
|
|
26
|
+
|
|
27
|
+
### Example
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import {
|
|
31
|
+
Configuration,
|
|
32
|
+
BillingApi,
|
|
33
|
+
} from '@deeprelay/sdk';
|
|
34
|
+
import type { CreateCryptoDepositOperationRequest } from '@deeprelay/sdk';
|
|
35
|
+
|
|
36
|
+
async function example() {
|
|
37
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
38
|
+
const config = new Configuration({
|
|
39
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
40
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
41
|
+
});
|
|
42
|
+
const api = new BillingApi(config);
|
|
43
|
+
|
|
44
|
+
const body = {
|
|
45
|
+
// CreateCryptoDepositRequest
|
|
46
|
+
createCryptoDepositRequest: ...,
|
|
47
|
+
} satisfies CreateCryptoDepositOperationRequest;
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const data = await api.createCryptoDeposit(body);
|
|
51
|
+
console.log(data);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error(error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Run the test
|
|
58
|
+
example().catch(console.error);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Parameters
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
| Name | Type | Description | Notes |
|
|
65
|
+
|------------- | ------------- | ------------- | -------------|
|
|
66
|
+
| **createCryptoDepositRequest** | [CreateCryptoDepositRequest](CreateCryptoDepositRequest.md) | | |
|
|
67
|
+
|
|
68
|
+
### Return type
|
|
69
|
+
|
|
70
|
+
[**CryptoDeposit**](CryptoDeposit.md)
|
|
71
|
+
|
|
72
|
+
### Authorization
|
|
73
|
+
|
|
74
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
75
|
+
|
|
76
|
+
### HTTP request headers
|
|
77
|
+
|
|
78
|
+
- **Content-Type**: `application/json`
|
|
79
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### HTTP response details
|
|
83
|
+
| Status code | Description | Response headers |
|
|
84
|
+
|-------------|-------------|------------------|
|
|
85
|
+
| **201** | Created | - |
|
|
86
|
+
| **400** | `validation-error` — `amount_cents` is below the configured minimum. `unsupported-chain-asset` — the chain/asset pair is not available. `invalid-request` — malformed JSON body. | - |
|
|
87
|
+
| **403** | `org-frozen` — the organization cannot add funds; contact support. | - |
|
|
88
|
+
| **404** | Error response (RFC 7807) | - |
|
|
89
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
90
|
+
| **503** | `payment-source-unavailable` — deposits are temporarily unavailable; retry shortly. | - |
|
|
91
|
+
| **0** | Error response (RFC 7807) | - |
|
|
92
|
+
|
|
93
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## createSubscriptionCheckout
|
|
97
|
+
|
|
98
|
+
> SubscriptionCheckoutSession createSubscriptionCheckout(subscriptionCheckoutRequest)
|
|
99
|
+
|
|
100
|
+
Start a subscription checkout session
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
104
|
+
### Example
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import {
|
|
108
|
+
Configuration,
|
|
109
|
+
BillingApi,
|
|
110
|
+
} from '@deeprelay/sdk';
|
|
111
|
+
import type { CreateSubscriptionCheckoutRequest } from '@deeprelay/sdk';
|
|
112
|
+
|
|
113
|
+
async function example() {
|
|
114
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
115
|
+
const config = new Configuration({
|
|
116
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
117
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
118
|
+
});
|
|
119
|
+
const api = new BillingApi(config);
|
|
120
|
+
|
|
121
|
+
const body = {
|
|
122
|
+
// SubscriptionCheckoutRequest (optional)
|
|
123
|
+
subscriptionCheckoutRequest: ...,
|
|
124
|
+
} satisfies CreateSubscriptionCheckoutRequest;
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
const data = await api.createSubscriptionCheckout(body);
|
|
128
|
+
console.log(data);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.error(error);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Run the test
|
|
135
|
+
example().catch(console.error);
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Parameters
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
| Name | Type | Description | Notes |
|
|
142
|
+
|------------- | ------------- | ------------- | -------------|
|
|
143
|
+
| **subscriptionCheckoutRequest** | [SubscriptionCheckoutRequest](SubscriptionCheckoutRequest.md) | | [Optional] |
|
|
144
|
+
|
|
145
|
+
### Return type
|
|
146
|
+
|
|
147
|
+
[**SubscriptionCheckoutSession**](SubscriptionCheckoutSession.md)
|
|
148
|
+
|
|
149
|
+
### Authorization
|
|
150
|
+
|
|
151
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
152
|
+
|
|
153
|
+
### HTTP request headers
|
|
154
|
+
|
|
155
|
+
- **Content-Type**: `application/json`
|
|
156
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### HTTP response details
|
|
160
|
+
| Status code | Description | Response headers |
|
|
161
|
+
|-------------|-------------|------------------|
|
|
162
|
+
| **200** | OK | - |
|
|
163
|
+
| **403** | Not an organization admin | - |
|
|
164
|
+
| **409** | The organization already has an active subscription | - |
|
|
165
|
+
| **503** | Subscription billing is not configured on this deployment | - |
|
|
166
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
167
|
+
| **0** | Error response (RFC 7807) | - |
|
|
168
|
+
|
|
169
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## createSubscriptionPortal
|
|
173
|
+
|
|
174
|
+
> SubscriptionPortalSession createSubscriptionPortal(subscriptionPortalRequest)
|
|
175
|
+
|
|
176
|
+
Open the billing portal to cancel or manage the subscription
|
|
177
|
+
|
|
178
|
+
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.
|
|
179
|
+
|
|
180
|
+
### Example
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import {
|
|
184
|
+
Configuration,
|
|
185
|
+
BillingApi,
|
|
186
|
+
} from '@deeprelay/sdk';
|
|
187
|
+
import type { CreateSubscriptionPortalRequest } from '@deeprelay/sdk';
|
|
188
|
+
|
|
189
|
+
async function example() {
|
|
190
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
191
|
+
const config = new Configuration({
|
|
192
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
193
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
194
|
+
});
|
|
195
|
+
const api = new BillingApi(config);
|
|
196
|
+
|
|
197
|
+
const body = {
|
|
198
|
+
// SubscriptionPortalRequest (optional)
|
|
199
|
+
subscriptionPortalRequest: ...,
|
|
200
|
+
} satisfies CreateSubscriptionPortalRequest;
|
|
201
|
+
|
|
202
|
+
try {
|
|
203
|
+
const data = await api.createSubscriptionPortal(body);
|
|
204
|
+
console.log(data);
|
|
205
|
+
} catch (error) {
|
|
206
|
+
console.error(error);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Run the test
|
|
211
|
+
example().catch(console.error);
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Parameters
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
| Name | Type | Description | Notes |
|
|
218
|
+
|------------- | ------------- | ------------- | -------------|
|
|
219
|
+
| **subscriptionPortalRequest** | [SubscriptionPortalRequest](SubscriptionPortalRequest.md) | | [Optional] |
|
|
220
|
+
|
|
221
|
+
### Return type
|
|
222
|
+
|
|
223
|
+
[**SubscriptionPortalSession**](SubscriptionPortalSession.md)
|
|
224
|
+
|
|
225
|
+
### Authorization
|
|
226
|
+
|
|
227
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
228
|
+
|
|
229
|
+
### HTTP request headers
|
|
230
|
+
|
|
231
|
+
- **Content-Type**: `application/json`
|
|
232
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
### HTTP response details
|
|
236
|
+
| Status code | Description | Response headers |
|
|
237
|
+
|-------------|-------------|------------------|
|
|
238
|
+
| **200** | OK | - |
|
|
239
|
+
| **403** | Not an organization admin | - |
|
|
240
|
+
| **404** | The organization has no billing account yet | - |
|
|
241
|
+
| **503** | Subscription billing is not configured on this deployment | - |
|
|
242
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
243
|
+
| **0** | Error response (RFC 7807) | - |
|
|
244
|
+
|
|
245
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
## getBalance
|
|
249
|
+
|
|
250
|
+
> Balance getBalance()
|
|
251
|
+
|
|
252
|
+
Get the org credit balance
|
|
253
|
+
|
|
254
|
+
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`.
|
|
255
|
+
|
|
256
|
+
### Example
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
import {
|
|
260
|
+
Configuration,
|
|
261
|
+
BillingApi,
|
|
262
|
+
} from '@deeprelay/sdk';
|
|
263
|
+
import type { GetBalanceRequest } from '@deeprelay/sdk';
|
|
264
|
+
|
|
265
|
+
async function example() {
|
|
266
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
267
|
+
const config = new Configuration({
|
|
268
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
269
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
270
|
+
});
|
|
271
|
+
const api = new BillingApi(config);
|
|
272
|
+
|
|
273
|
+
try {
|
|
274
|
+
const data = await api.getBalance();
|
|
275
|
+
console.log(data);
|
|
276
|
+
} catch (error) {
|
|
277
|
+
console.error(error);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Run the test
|
|
282
|
+
example().catch(console.error);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Parameters
|
|
286
|
+
|
|
287
|
+
This endpoint does not need any parameter.
|
|
288
|
+
|
|
289
|
+
### Return type
|
|
290
|
+
|
|
291
|
+
[**Balance**](Balance.md)
|
|
292
|
+
|
|
293
|
+
### Authorization
|
|
294
|
+
|
|
295
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
296
|
+
|
|
297
|
+
### HTTP request headers
|
|
298
|
+
|
|
299
|
+
- **Content-Type**: Not defined
|
|
300
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
### HTTP response details
|
|
304
|
+
| Status code | Description | Response headers |
|
|
305
|
+
|-------------|-------------|------------------|
|
|
306
|
+
| **200** | OK | - |
|
|
307
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
308
|
+
| **0** | Error response (RFC 7807) | - |
|
|
309
|
+
|
|
310
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
## getDeposit
|
|
314
|
+
|
|
315
|
+
> CryptoDeposit getDeposit(id)
|
|
316
|
+
|
|
317
|
+
Get one stablecoin deposit
|
|
318
|
+
|
|
319
|
+
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.
|
|
320
|
+
|
|
321
|
+
### Example
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
import {
|
|
325
|
+
Configuration,
|
|
326
|
+
BillingApi,
|
|
327
|
+
} from '@deeprelay/sdk';
|
|
328
|
+
import type { GetDepositRequest } from '@deeprelay/sdk';
|
|
329
|
+
|
|
330
|
+
async function example() {
|
|
331
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
332
|
+
const config = new Configuration({
|
|
333
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
334
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
335
|
+
});
|
|
336
|
+
const api = new BillingApi(config);
|
|
337
|
+
|
|
338
|
+
const body = {
|
|
339
|
+
// string | The deposit id.
|
|
340
|
+
id: id_example,
|
|
341
|
+
} satisfies GetDepositRequest;
|
|
342
|
+
|
|
343
|
+
try {
|
|
344
|
+
const data = await api.getDeposit(body);
|
|
345
|
+
console.log(data);
|
|
346
|
+
} catch (error) {
|
|
347
|
+
console.error(error);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Run the test
|
|
352
|
+
example().catch(console.error);
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Parameters
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
| Name | Type | Description | Notes |
|
|
359
|
+
|------------- | ------------- | ------------- | -------------|
|
|
360
|
+
| **id** | `string` | The deposit id. | [Defaults to `undefined`] |
|
|
361
|
+
|
|
362
|
+
### Return type
|
|
363
|
+
|
|
364
|
+
[**CryptoDeposit**](CryptoDeposit.md)
|
|
365
|
+
|
|
366
|
+
### Authorization
|
|
367
|
+
|
|
368
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
369
|
+
|
|
370
|
+
### HTTP request headers
|
|
371
|
+
|
|
372
|
+
- **Content-Type**: Not defined
|
|
373
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
### HTTP response details
|
|
377
|
+
| Status code | Description | Response headers |
|
|
378
|
+
|-------------|-------------|------------------|
|
|
379
|
+
| **200** | OK | - |
|
|
380
|
+
| **404** | `deposit-not-found` — no such deposit, or it belongs to another organization. `not-found` — the feature is not enabled. | - |
|
|
381
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
382
|
+
| **0** | Error response (RFC 7807) | - |
|
|
383
|
+
|
|
384
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
## getSpendingLimit
|
|
388
|
+
|
|
389
|
+
> SpendingLimit getSpendingLimit()
|
|
390
|
+
|
|
391
|
+
Get the org spending limit
|
|
392
|
+
|
|
393
|
+
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.
|
|
394
|
+
|
|
395
|
+
### Example
|
|
396
|
+
|
|
397
|
+
```ts
|
|
398
|
+
import {
|
|
399
|
+
Configuration,
|
|
400
|
+
BillingApi,
|
|
401
|
+
} from '@deeprelay/sdk';
|
|
402
|
+
import type { GetSpendingLimitRequest } from '@deeprelay/sdk';
|
|
403
|
+
|
|
404
|
+
async function example() {
|
|
405
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
406
|
+
const config = new Configuration({
|
|
407
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
408
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
409
|
+
});
|
|
410
|
+
const api = new BillingApi(config);
|
|
411
|
+
|
|
412
|
+
try {
|
|
413
|
+
const data = await api.getSpendingLimit();
|
|
414
|
+
console.log(data);
|
|
415
|
+
} catch (error) {
|
|
416
|
+
console.error(error);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Run the test
|
|
421
|
+
example().catch(console.error);
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Parameters
|
|
425
|
+
|
|
426
|
+
This endpoint does not need any parameter.
|
|
427
|
+
|
|
428
|
+
### Return type
|
|
429
|
+
|
|
430
|
+
[**SpendingLimit**](SpendingLimit.md)
|
|
431
|
+
|
|
432
|
+
### Authorization
|
|
433
|
+
|
|
434
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
435
|
+
|
|
436
|
+
### HTTP request headers
|
|
437
|
+
|
|
438
|
+
- **Content-Type**: Not defined
|
|
439
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
### HTTP response details
|
|
443
|
+
| Status code | Description | Response headers |
|
|
444
|
+
|-------------|-------------|------------------|
|
|
445
|
+
| **200** | OK | - |
|
|
446
|
+
| **404** | Error response (RFC 7807) | - |
|
|
447
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
448
|
+
| **0** | Error response (RFC 7807) | - |
|
|
449
|
+
|
|
450
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
## getSubscription
|
|
454
|
+
|
|
455
|
+
> Subscription getSubscription()
|
|
456
|
+
|
|
457
|
+
Get the org subscription status and quota usage
|
|
458
|
+
|
|
459
|
+
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`.
|
|
460
|
+
|
|
461
|
+
### Example
|
|
462
|
+
|
|
463
|
+
```ts
|
|
464
|
+
import {
|
|
465
|
+
Configuration,
|
|
466
|
+
BillingApi,
|
|
467
|
+
} from '@deeprelay/sdk';
|
|
468
|
+
import type { GetSubscriptionRequest } from '@deeprelay/sdk';
|
|
469
|
+
|
|
470
|
+
async function example() {
|
|
471
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
472
|
+
const config = new Configuration({
|
|
473
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
474
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
475
|
+
});
|
|
476
|
+
const api = new BillingApi(config);
|
|
477
|
+
|
|
478
|
+
try {
|
|
479
|
+
const data = await api.getSubscription();
|
|
480
|
+
console.log(data);
|
|
481
|
+
} catch (error) {
|
|
482
|
+
console.error(error);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// Run the test
|
|
487
|
+
example().catch(console.error);
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### Parameters
|
|
491
|
+
|
|
492
|
+
This endpoint does not need any parameter.
|
|
493
|
+
|
|
494
|
+
### Return type
|
|
495
|
+
|
|
496
|
+
[**Subscription**](Subscription.md)
|
|
497
|
+
|
|
498
|
+
### Authorization
|
|
499
|
+
|
|
500
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
501
|
+
|
|
502
|
+
### HTTP request headers
|
|
503
|
+
|
|
504
|
+
- **Content-Type**: Not defined
|
|
505
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
### HTTP response details
|
|
509
|
+
| Status code | Description | Response headers |
|
|
510
|
+
|-------------|-------------|------------------|
|
|
511
|
+
| **200** | OK | - |
|
|
512
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
513
|
+
| **0** | Error response (RFC 7807) | - |
|
|
514
|
+
|
|
515
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
## listDeposits
|
|
519
|
+
|
|
520
|
+
> ListDeposits200Response listDeposits()
|
|
521
|
+
|
|
522
|
+
List stablecoin deposits
|
|
523
|
+
|
|
524
|
+
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.
|
|
525
|
+
|
|
526
|
+
### Example
|
|
527
|
+
|
|
528
|
+
```ts
|
|
529
|
+
import {
|
|
530
|
+
Configuration,
|
|
531
|
+
BillingApi,
|
|
532
|
+
} from '@deeprelay/sdk';
|
|
533
|
+
import type { ListDepositsRequest } from '@deeprelay/sdk';
|
|
534
|
+
|
|
535
|
+
async function example() {
|
|
536
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
537
|
+
const config = new Configuration({
|
|
538
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
539
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
540
|
+
});
|
|
541
|
+
const api = new BillingApi(config);
|
|
542
|
+
|
|
543
|
+
try {
|
|
544
|
+
const data = await api.listDeposits();
|
|
545
|
+
console.log(data);
|
|
546
|
+
} catch (error) {
|
|
547
|
+
console.error(error);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// Run the test
|
|
552
|
+
example().catch(console.error);
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### Parameters
|
|
556
|
+
|
|
557
|
+
This endpoint does not need any parameter.
|
|
558
|
+
|
|
559
|
+
### Return type
|
|
560
|
+
|
|
561
|
+
[**ListDeposits200Response**](ListDeposits200Response.md)
|
|
562
|
+
|
|
563
|
+
### Authorization
|
|
564
|
+
|
|
565
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
566
|
+
|
|
567
|
+
### HTTP request headers
|
|
568
|
+
|
|
569
|
+
- **Content-Type**: Not defined
|
|
570
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
### HTTP response details
|
|
574
|
+
| Status code | Description | Response headers |
|
|
575
|
+
|-------------|-------------|------------------|
|
|
576
|
+
| **200** | OK | - |
|
|
577
|
+
| **404** | Error response (RFC 7807) | - |
|
|
578
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
579
|
+
| **0** | Error response (RFC 7807) | - |
|
|
580
|
+
|
|
581
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
## updateSpendingLimit
|
|
585
|
+
|
|
586
|
+
> SpendingLimit updateSpendingLimit(updateSpendingLimitRequest)
|
|
587
|
+
|
|
588
|
+
Set the org spending limit
|
|
589
|
+
|
|
590
|
+
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.
|
|
591
|
+
|
|
592
|
+
### Example
|
|
593
|
+
|
|
594
|
+
```ts
|
|
595
|
+
import {
|
|
596
|
+
Configuration,
|
|
597
|
+
BillingApi,
|
|
598
|
+
} from '@deeprelay/sdk';
|
|
599
|
+
import type { UpdateSpendingLimitOperationRequest } from '@deeprelay/sdk';
|
|
600
|
+
|
|
601
|
+
async function example() {
|
|
602
|
+
console.log("🚀 Testing @deeprelay/sdk SDK...");
|
|
603
|
+
const config = new Configuration({
|
|
604
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
605
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
606
|
+
});
|
|
607
|
+
const api = new BillingApi(config);
|
|
608
|
+
|
|
609
|
+
const body = {
|
|
610
|
+
// UpdateSpendingLimitRequest
|
|
611
|
+
updateSpendingLimitRequest: ...,
|
|
612
|
+
} satisfies UpdateSpendingLimitOperationRequest;
|
|
613
|
+
|
|
614
|
+
try {
|
|
615
|
+
const data = await api.updateSpendingLimit(body);
|
|
616
|
+
console.log(data);
|
|
617
|
+
} catch (error) {
|
|
618
|
+
console.error(error);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Run the test
|
|
623
|
+
example().catch(console.error);
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
### Parameters
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
| Name | Type | Description | Notes |
|
|
630
|
+
|------------- | ------------- | ------------- | -------------|
|
|
631
|
+
| **updateSpendingLimitRequest** | [UpdateSpendingLimitRequest](UpdateSpendingLimitRequest.md) | | |
|
|
632
|
+
|
|
633
|
+
### Return type
|
|
634
|
+
|
|
635
|
+
[**SpendingLimit**](SpendingLimit.md)
|
|
636
|
+
|
|
637
|
+
### Authorization
|
|
638
|
+
|
|
639
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
640
|
+
|
|
641
|
+
### HTTP request headers
|
|
642
|
+
|
|
643
|
+
- **Content-Type**: `application/json`
|
|
644
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
### HTTP response details
|
|
648
|
+
| Status code | Description | Response headers |
|
|
649
|
+
|-------------|-------------|------------------|
|
|
650
|
+
| **200** | OK | - |
|
|
651
|
+
| **403** | Error response (RFC 7807) | - |
|
|
652
|
+
| **422** | Error response (RFC 7807) | - |
|
|
653
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
654
|
+
| **0** | Error response (RFC 7807) | - |
|
|
655
|
+
|
|
656
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
657
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatChoice
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`index` | number
|
|
10
|
+
`message` | [ChatMessage](ChatMessage.md)
|
|
11
|
+
`finishReason` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChatChoice } from '@deeprelay/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"index": null,
|
|
21
|
+
"message": null,
|
|
22
|
+
"finishReason": null,
|
|
23
|
+
} satisfies ChatChoice
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatChoice
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|