@deeprelay/sdk 0.1.1 → 0.2.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 (64) hide show
  1. package/.openapi-generator/FILES +4 -8
  2. package/README.md +6 -6
  3. package/dist/apis/BillingApi.d.ts +29 -0
  4. package/dist/apis/BillingApi.js +88 -0
  5. package/dist/apis/index.d.ts +0 -1
  6. package/dist/apis/index.js +0 -1
  7. package/dist/esm/apis/BillingApi.d.ts +29 -0
  8. package/dist/esm/apis/BillingApi.js +88 -0
  9. package/dist/esm/apis/index.d.ts +0 -1
  10. package/dist/esm/apis/index.js +0 -1
  11. package/dist/esm/models/RefereeStatus.d.ts +79 -0
  12. package/dist/esm/models/RefereeStatus.js +70 -0
  13. package/dist/esm/models/Referral.d.ts +94 -0
  14. package/dist/esm/models/Referral.js +82 -0
  15. package/dist/esm/models/VideoJob.d.ts +6 -0
  16. package/dist/esm/models/VideoJob.js +2 -0
  17. package/dist/esm/models/index.d.ts +2 -3
  18. package/dist/esm/models/index.js +2 -3
  19. package/dist/esm/runtime.js +1 -1
  20. package/dist/models/RefereeStatus.d.ts +79 -0
  21. package/dist/models/RefereeStatus.js +78 -0
  22. package/dist/models/Referral.d.ts +94 -0
  23. package/dist/models/Referral.js +89 -0
  24. package/dist/models/VideoJob.d.ts +6 -0
  25. package/dist/models/VideoJob.js +2 -0
  26. package/dist/models/index.d.ts +2 -3
  27. package/dist/models/index.js +2 -3
  28. package/dist/runtime.js +1 -1
  29. package/docs/BillingApi.md +134 -0
  30. package/docs/RefereeStatus.md +47 -0
  31. package/docs/Referral.md +55 -0
  32. package/docs/VideoJob.md +2 -0
  33. package/package.json +1 -1
  34. package/src/apis/BillingApi.ts +98 -0
  35. package/src/apis/index.ts +0 -1
  36. package/src/models/RefereeStatus.ts +131 -0
  37. package/src/models/Referral.ts +164 -0
  38. package/src/models/VideoJob.ts +8 -0
  39. package/src/models/index.ts +2 -3
  40. package/src/runtime.ts +1 -1
  41. package/dist/apis/OperationsApi.d.ts +0 -33
  42. package/dist/apis/OperationsApi.js +0 -79
  43. package/dist/esm/apis/OperationsApi.d.ts +0 -33
  44. package/dist/esm/apis/OperationsApi.js +0 -75
  45. package/dist/esm/models/Operation.d.ts +0 -107
  46. package/dist/esm/models/Operation.js +0 -86
  47. package/dist/esm/models/OperationError.d.ts +0 -38
  48. package/dist/esm/models/OperationError.js +0 -43
  49. package/dist/esm/models/OperationResult.d.ts +0 -44
  50. package/dist/esm/models/OperationResult.js +0 -45
  51. package/dist/models/Operation.d.ts +0 -107
  52. package/dist/models/Operation.js +0 -94
  53. package/dist/models/OperationError.d.ts +0 -38
  54. package/dist/models/OperationError.js +0 -50
  55. package/dist/models/OperationResult.d.ts +0 -44
  56. package/dist/models/OperationResult.js +0 -52
  57. package/docs/Operation.md +0 -52
  58. package/docs/OperationError.md +0 -36
  59. package/docs/OperationResult.md +0 -39
  60. package/docs/OperationsApi.md +0 -80
  61. package/src/apis/OperationsApi.ts +0 -89
  62. package/src/models/Operation.ts +0 -179
  63. package/src/models/OperationError.ts +0 -73
  64. package/src/models/OperationResult.ts +0 -81
@@ -31,12 +31,10 @@ docs/ModelPricing.md
31
31
  docs/ModelRate.md
32
32
  docs/OpenAIErrorEnvelope.md
33
33
  docs/OpenAIErrorEnvelopeError.md
34
- docs/Operation.md
35
- docs/OperationError.md
36
- docs/OperationResult.md
37
- docs/OperationsApi.md
38
34
  docs/PeakWindow.md
39
35
  docs/Problem.md
36
+ docs/RefereeStatus.md
37
+ docs/Referral.md
40
38
  docs/SpendingLimit.md
41
39
  docs/StreamOptions.md
42
40
  docs/Subscription.md
@@ -63,7 +61,6 @@ package.json
63
61
  src/apis/BillingApi.ts
64
62
  src/apis/InferenceApi.ts
65
63
  src/apis/MetaApi.ts
66
- src/apis/OperationsApi.ts
67
64
  src/apis/UsageApi.ts
68
65
  src/apis/WebhooksApi.ts
69
66
  src/apis/index.ts
@@ -95,11 +92,10 @@ src/models/ModelPricing.ts
95
92
  src/models/ModelRate.ts
96
93
  src/models/OpenAIErrorEnvelope.ts
97
94
  src/models/OpenAIErrorEnvelopeError.ts
98
- src/models/Operation.ts
99
- src/models/OperationError.ts
100
- src/models/OperationResult.ts
101
95
  src/models/PeakWindow.ts
102
96
  src/models/Problem.ts
97
+ src/models/RefereeStatus.ts
98
+ src/models/Referral.ts
103
99
  src/models/SpendingLimit.ts
104
100
  src/models/StreamOptions.ts
105
101
  src/models/Subscription.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @deeprelay/sdk@0.1.1
1
+ # @deeprelay/sdk@0.2.0
2
2
 
3
3
  A TypeScript SDK client for the api.deeprelay.ai API.
4
4
 
@@ -57,8 +57,10 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
57
57
  *BillingApi* | [**createCryptoDeposit**](docs/BillingApi.md#createcryptodepositoperation) | **POST** /billing/deposits/crypto | Create a stablecoin deposit
58
58
  *BillingApi* | [**createSubscriptionCheckout**](docs/BillingApi.md#createsubscriptioncheckout) | **POST** /billing/subscription/checkout | Start a subscription checkout session
59
59
  *BillingApi* | [**createSubscriptionPortal**](docs/BillingApi.md#createsubscriptionportal) | **POST** /billing/subscription/portal | Open the billing portal to cancel or manage the subscription
60
+ *BillingApi* | [**deleteSpendingLimit**](docs/BillingApi.md#deletespendinglimit) | **DELETE** /billing/spending-limit | Clear the org spending limit
60
61
  *BillingApi* | [**getBalance**](docs/BillingApi.md#getbalance) | **GET** /billing/balance | Get the org credit balance
61
62
  *BillingApi* | [**getDeposit**](docs/BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit
63
+ *BillingApi* | [**getReferral**](docs/BillingApi.md#getreferral) | **GET** /referrals | Get the org referral code, invite link, terms and stats
62
64
  *BillingApi* | [**getSpendingLimit**](docs/BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit
63
65
  *BillingApi* | [**getSubscription**](docs/BillingApi.md#getsubscription) | **GET** /billing/subscription | Get the org subscription status and quota usage
64
66
  *BillingApi* | [**listDeposits**](docs/BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits
@@ -76,7 +78,6 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
76
78
  *InferenceApi* | [**listVideos**](docs/InferenceApi.md#listvideos) | **GET** /videos | List video generation jobs
77
79
  *MetaApi* | [**getHealth**](docs/MetaApi.md#gethealth) | **GET** /health | Liveness probe
78
80
  *MetaApi* | [**getOpenApiSpec**](docs/MetaApi.md#getopenapispec) | **GET** /openapi.json | OpenAPI 3.1 specification
79
- *OperationsApi* | [**getOperation**](docs/OperationsApi.md#getoperation) | **GET** /operations/{id} | Get an async operation status
80
81
  *UsageApi* | [**listUsage**](docs/UsageApi.md#listusage) | **GET** /usage | Time-bucketed usage
81
82
  *WebhooksApi* | [**createWebhookEndpoint**](docs/WebhooksApi.md#createwebhookendpointoperation) | **POST** /webhook-endpoints | Create a webhook endpoint
82
83
  *WebhooksApi* | [**deleteWebhookEndpoint**](docs/WebhooksApi.md#deletewebhookendpoint) | **DELETE** /webhook-endpoints/{id} | Delete a webhook endpoint
@@ -113,11 +114,10 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
113
114
  - [ModelRate](docs/ModelRate.md)
114
115
  - [OpenAIErrorEnvelope](docs/OpenAIErrorEnvelope.md)
115
116
  - [OpenAIErrorEnvelopeError](docs/OpenAIErrorEnvelopeError.md)
116
- - [Operation](docs/Operation.md)
117
- - [OperationError](docs/OperationError.md)
118
- - [OperationResult](docs/OperationResult.md)
119
117
  - [PeakWindow](docs/PeakWindow.md)
120
118
  - [Problem](docs/Problem.md)
119
+ - [RefereeStatus](docs/RefereeStatus.md)
120
+ - [Referral](docs/Referral.md)
121
121
  - [SpendingLimit](docs/SpendingLimit.md)
122
122
  - [StreamOptions](docs/StreamOptions.md)
123
123
  - [Subscription](docs/Subscription.md)
@@ -156,7 +156,7 @@ and is automatically generated by the
156
156
  [OpenAPI Generator](https://openapi-generator.tech) project:
157
157
 
158
158
  - API version: `1.0.0`
159
- - Package version: `0.1.1`
159
+ - Package version: `0.2.0`
160
160
  - Generator version: `7.24.0`
161
161
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
162
162
 
@@ -14,6 +14,7 @@ import { type Balance } from '../models/Balance';
14
14
  import { type CreateCryptoDepositRequest } from '../models/CreateCryptoDepositRequest';
15
15
  import { type CryptoDeposit } from '../models/CryptoDeposit';
16
16
  import { type ListDeposits200Response } from '../models/ListDeposits200Response';
17
+ import { type Referral } from '../models/Referral';
17
18
  import { type SpendingLimit } from '../models/SpendingLimit';
18
19
  import { type Subscription } from '../models/Subscription';
19
20
  import { type SubscriptionCheckoutRequest } from '../models/SubscriptionCheckoutRequest';
@@ -82,6 +83,20 @@ export declare class BillingApi extends runtime.BaseAPI {
82
83
  * Open the billing portal to cancel or manage the subscription
83
84
  */
84
85
  createSubscriptionPortal(requestParameters?: CreateSubscriptionPortalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPortalSession>;
86
+ /**
87
+ * Creates request options for deleteSpendingLimit without sending the request
88
+ */
89
+ deleteSpendingLimitRequestOpts(): Promise<runtime.RequestOpts>;
90
+ /**
91
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
92
+ * Clear the org spending limit
93
+ */
94
+ deleteSpendingLimitRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
95
+ /**
96
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
97
+ * Clear the org spending limit
98
+ */
99
+ deleteSpendingLimit(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
85
100
  /**
86
101
  * Creates request options for getBalance without sending the request
87
102
  */
@@ -110,6 +125,20 @@ export declare class BillingApi extends runtime.BaseAPI {
110
125
  * Get one stablecoin deposit
111
126
  */
112
127
  getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
128
+ /**
129
+ * Creates request options for getReferral without sending the request
130
+ */
131
+ getReferralRequestOpts(): Promise<runtime.RequestOpts>;
132
+ /**
133
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
134
+ * Get the org referral code, invite link, terms and stats
135
+ */
136
+ getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>>;
137
+ /**
138
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
139
+ * Get the org referral code, invite link, terms and stats
140
+ */
141
+ getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral>;
113
142
  /**
114
143
  * Creates request options for getSpendingLimit without sending the request
115
144
  */
@@ -28,6 +28,7 @@ const Balance_1 = require("../models/Balance");
28
28
  const CreateCryptoDepositRequest_1 = require("../models/CreateCryptoDepositRequest");
29
29
  const CryptoDeposit_1 = require("../models/CryptoDeposit");
30
30
  const ListDeposits200Response_1 = require("../models/ListDeposits200Response");
31
+ const Referral_1 = require("../models/Referral");
31
32
  const SpendingLimit_1 = require("../models/SpendingLimit");
32
33
  const Subscription_1 = require("../models/Subscription");
33
34
  const SubscriptionCheckoutRequest_1 = require("../models/SubscriptionCheckoutRequest");
@@ -180,6 +181,49 @@ class BillingApi extends runtime.BaseAPI {
180
181
  return yield response.value();
181
182
  });
182
183
  }
184
+ /**
185
+ * Creates request options for deleteSpendingLimit without sending the request
186
+ */
187
+ deleteSpendingLimitRequestOpts() {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ const queryParameters = {};
190
+ const headerParameters = {};
191
+ if (this.configuration && this.configuration.accessToken) {
192
+ const token = this.configuration.accessToken;
193
+ const tokenString = yield token("bearerAuth", []);
194
+ if (tokenString) {
195
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
196
+ }
197
+ }
198
+ let urlPath = `/billing/spending-limit`;
199
+ return {
200
+ path: urlPath,
201
+ method: 'DELETE',
202
+ headers: headerParameters,
203
+ query: queryParameters,
204
+ };
205
+ });
206
+ }
207
+ /**
208
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
209
+ * Clear the org spending limit
210
+ */
211
+ deleteSpendingLimitRaw(initOverrides) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ const requestOptions = yield this.deleteSpendingLimitRequestOpts();
214
+ const response = yield this.request(requestOptions, initOverrides);
215
+ return new runtime.VoidApiResponse(response);
216
+ });
217
+ }
218
+ /**
219
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
220
+ * Clear the org spending limit
221
+ */
222
+ deleteSpendingLimit(initOverrides) {
223
+ return __awaiter(this, void 0, void 0, function* () {
224
+ yield this.deleteSpendingLimitRaw(initOverrides);
225
+ });
226
+ }
183
227
  /**
184
228
  * Creates request options for getBalance without sending the request
185
229
  */
@@ -272,6 +316,50 @@ class BillingApi extends runtime.BaseAPI {
272
316
  return yield response.value();
273
317
  });
274
318
  }
319
+ /**
320
+ * Creates request options for getReferral without sending the request
321
+ */
322
+ getReferralRequestOpts() {
323
+ return __awaiter(this, void 0, void 0, function* () {
324
+ const queryParameters = {};
325
+ const headerParameters = {};
326
+ if (this.configuration && this.configuration.accessToken) {
327
+ const token = this.configuration.accessToken;
328
+ const tokenString = yield token("bearerAuth", []);
329
+ if (tokenString) {
330
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
331
+ }
332
+ }
333
+ let urlPath = `/referrals`;
334
+ return {
335
+ path: urlPath,
336
+ method: 'GET',
337
+ headers: headerParameters,
338
+ query: queryParameters,
339
+ };
340
+ });
341
+ }
342
+ /**
343
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
344
+ * Get the org referral code, invite link, terms and stats
345
+ */
346
+ getReferralRaw(initOverrides) {
347
+ return __awaiter(this, void 0, void 0, function* () {
348
+ const requestOptions = yield this.getReferralRequestOpts();
349
+ const response = yield this.request(requestOptions, initOverrides);
350
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Referral_1.ReferralFromJSON)(jsonValue));
351
+ });
352
+ }
353
+ /**
354
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
355
+ * Get the org referral code, invite link, terms and stats
356
+ */
357
+ getReferral(initOverrides) {
358
+ return __awaiter(this, void 0, void 0, function* () {
359
+ const response = yield this.getReferralRaw(initOverrides);
360
+ return yield response.value();
361
+ });
362
+ }
275
363
  /**
276
364
  * Creates request options for getSpendingLimit without sending the request
277
365
  */
@@ -1,6 +1,5 @@
1
1
  export * from './BillingApi';
2
2
  export * from './InferenceApi';
3
3
  export * from './MetaApi';
4
- export * from './OperationsApi';
5
4
  export * from './UsageApi';
6
5
  export * from './WebhooksApi';
@@ -19,6 +19,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./BillingApi"), exports);
20
20
  __exportStar(require("./InferenceApi"), exports);
21
21
  __exportStar(require("./MetaApi"), exports);
22
- __exportStar(require("./OperationsApi"), exports);
23
22
  __exportStar(require("./UsageApi"), exports);
24
23
  __exportStar(require("./WebhooksApi"), exports);
@@ -14,6 +14,7 @@ import { type Balance } from '../models/Balance';
14
14
  import { type CreateCryptoDepositRequest } from '../models/CreateCryptoDepositRequest';
15
15
  import { type CryptoDeposit } from '../models/CryptoDeposit';
16
16
  import { type ListDeposits200Response } from '../models/ListDeposits200Response';
17
+ import { type Referral } from '../models/Referral';
17
18
  import { type SpendingLimit } from '../models/SpendingLimit';
18
19
  import { type Subscription } from '../models/Subscription';
19
20
  import { type SubscriptionCheckoutRequest } from '../models/SubscriptionCheckoutRequest';
@@ -82,6 +83,20 @@ export declare class BillingApi extends runtime.BaseAPI {
82
83
  * Open the billing portal to cancel or manage the subscription
83
84
  */
84
85
  createSubscriptionPortal(requestParameters?: CreateSubscriptionPortalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPortalSession>;
86
+ /**
87
+ * Creates request options for deleteSpendingLimit without sending the request
88
+ */
89
+ deleteSpendingLimitRequestOpts(): Promise<runtime.RequestOpts>;
90
+ /**
91
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
92
+ * Clear the org spending limit
93
+ */
94
+ deleteSpendingLimitRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
95
+ /**
96
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
97
+ * Clear the org spending limit
98
+ */
99
+ deleteSpendingLimit(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
85
100
  /**
86
101
  * Creates request options for getBalance without sending the request
87
102
  */
@@ -110,6 +125,20 @@ export declare class BillingApi extends runtime.BaseAPI {
110
125
  * Get one stablecoin deposit
111
126
  */
112
127
  getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
128
+ /**
129
+ * Creates request options for getReferral without sending the request
130
+ */
131
+ getReferralRequestOpts(): Promise<runtime.RequestOpts>;
132
+ /**
133
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
134
+ * Get the org referral code, invite link, terms and stats
135
+ */
136
+ getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>>;
137
+ /**
138
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
139
+ * Get the org referral code, invite link, terms and stats
140
+ */
141
+ getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral>;
113
142
  /**
114
143
  * Creates request options for getSpendingLimit without sending the request
115
144
  */
@@ -25,6 +25,7 @@ import { BalanceFromJSON, } from '../models/Balance';
25
25
  import { CreateCryptoDepositRequestToJSON, } from '../models/CreateCryptoDepositRequest';
26
26
  import { CryptoDepositFromJSON, } from '../models/CryptoDeposit';
27
27
  import { ListDeposits200ResponseFromJSON, } from '../models/ListDeposits200Response';
28
+ import { ReferralFromJSON, } from '../models/Referral';
28
29
  import { SpendingLimitFromJSON, } from '../models/SpendingLimit';
29
30
  import { SubscriptionFromJSON, } from '../models/Subscription';
30
31
  import { SubscriptionCheckoutRequestToJSON, } from '../models/SubscriptionCheckoutRequest';
@@ -177,6 +178,49 @@ export class BillingApi extends runtime.BaseAPI {
177
178
  return yield response.value();
178
179
  });
179
180
  }
181
+ /**
182
+ * Creates request options for deleteSpendingLimit without sending the request
183
+ */
184
+ deleteSpendingLimitRequestOpts() {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ const queryParameters = {};
187
+ const headerParameters = {};
188
+ if (this.configuration && this.configuration.accessToken) {
189
+ const token = this.configuration.accessToken;
190
+ const tokenString = yield token("bearerAuth", []);
191
+ if (tokenString) {
192
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
193
+ }
194
+ }
195
+ let urlPath = `/billing/spending-limit`;
196
+ return {
197
+ path: urlPath,
198
+ method: 'DELETE',
199
+ headers: headerParameters,
200
+ query: queryParameters,
201
+ };
202
+ });
203
+ }
204
+ /**
205
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
206
+ * Clear the org spending limit
207
+ */
208
+ deleteSpendingLimitRaw(initOverrides) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ const requestOptions = yield this.deleteSpendingLimitRequestOpts();
211
+ const response = yield this.request(requestOptions, initOverrides);
212
+ return new runtime.VoidApiResponse(response);
213
+ });
214
+ }
215
+ /**
216
+ * Removes the organization\'s monthly spending limit and daily spend cap entirely. Requires the `billing:write` scope AND org-admin privileges (a non-admin member gets 403). Returns 404 when no limit is configured. This is the only way to remove a limit through the API, because `PUT` floors `monthly_limit_dollars` at 1.00 and so cannot express \"no limit\".
217
+ * Clear the org spending limit
218
+ */
219
+ deleteSpendingLimit(initOverrides) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ yield this.deleteSpendingLimitRaw(initOverrides);
222
+ });
223
+ }
180
224
  /**
181
225
  * Creates request options for getBalance without sending the request
182
226
  */
@@ -269,6 +313,50 @@ export class BillingApi extends runtime.BaseAPI {
269
313
  return yield response.value();
270
314
  });
271
315
  }
316
+ /**
317
+ * Creates request options for getReferral without sending the request
318
+ */
319
+ getReferralRequestOpts() {
320
+ return __awaiter(this, void 0, void 0, function* () {
321
+ const queryParameters = {};
322
+ const headerParameters = {};
323
+ if (this.configuration && this.configuration.accessToken) {
324
+ const token = this.configuration.accessToken;
325
+ const tokenString = yield token("bearerAuth", []);
326
+ if (tokenString) {
327
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
328
+ }
329
+ }
330
+ let urlPath = `/referrals`;
331
+ return {
332
+ path: urlPath,
333
+ method: 'GET',
334
+ headers: headerParameters,
335
+ query: queryParameters,
336
+ };
337
+ });
338
+ }
339
+ /**
340
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
341
+ * Get the org referral code, invite link, terms and stats
342
+ */
343
+ getReferralRaw(initOverrides) {
344
+ return __awaiter(this, void 0, void 0, function* () {
345
+ const requestOptions = yield this.getReferralRequestOpts();
346
+ const response = yield this.request(requestOptions, initOverrides);
347
+ return new runtime.JSONApiResponse(response, (jsonValue) => ReferralFromJSON(jsonValue));
348
+ });
349
+ }
350
+ /**
351
+ * Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` 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 `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
352
+ * Get the org referral code, invite link, terms and stats
353
+ */
354
+ getReferral(initOverrides) {
355
+ return __awaiter(this, void 0, void 0, function* () {
356
+ const response = yield this.getReferralRaw(initOverrides);
357
+ return yield response.value();
358
+ });
359
+ }
272
360
  /**
273
361
  * Creates request options for getSpendingLimit without sending the request
274
362
  */
@@ -1,6 +1,5 @@
1
1
  export * from './BillingApi';
2
2
  export * from './InferenceApi';
3
3
  export * from './MetaApi';
4
- export * from './OperationsApi';
5
4
  export * from './UsageApi';
6
5
  export * from './WebhooksApi';
@@ -3,6 +3,5 @@
3
3
  export * from './BillingApi';
4
4
  export * from './InferenceApi';
5
5
  export * from './MetaApi';
6
- export * from './OperationsApi';
7
6
  export * from './UsageApi';
8
7
  export * from './WebhooksApi';
@@ -0,0 +1,79 @@
1
+ /**
2
+ * deeprelay Public Developer API
3
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@deeprelay.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Present only when the organization signed up through someone else's invite link: where that referral sits and how far the organization is from unlocking its own reward.
14
+ *
15
+ * @export
16
+ * @interface RefereeStatus
17
+ */
18
+ export interface RefereeStatus {
19
+ /**
20
+ * Lifecycle state. `pending` until the spend gate is met; `qualified` inside the hold; `settled` once paid.
21
+ * @type {RefereeStatusStatusEnum}
22
+ * @memberof RefereeStatus
23
+ */
24
+ status: RefereeStatusStatusEnum;
25
+ /**
26
+ * Cumulative inference spend so far.
27
+ * @type {number}
28
+ * @memberof RefereeStatus
29
+ */
30
+ spentCents: number;
31
+ /**
32
+ * The spend that qualifies the referral.
33
+ * @type {number}
34
+ * @memberof RefereeStatus
35
+ */
36
+ qualifySpendCents: number;
37
+ /**
38
+ * What this organization receives on settlement.
39
+ * @type {number}
40
+ * @memberof RefereeStatus
41
+ */
42
+ rewardCents: number;
43
+ /**
44
+ * When the spend gate was met. Absent while pending.
45
+ * @type {Date}
46
+ * @memberof RefereeStatus
47
+ */
48
+ qualifiedAt?: Date;
49
+ /**
50
+ * When the hold ends and both halves pay out. Absent while pending.
51
+ * @type {Date}
52
+ * @memberof RefereeStatus
53
+ */
54
+ holdUntil?: Date;
55
+ /**
56
+ * When the reward was paid. Absent until settled.
57
+ * @type {Date}
58
+ * @memberof RefereeStatus
59
+ */
60
+ settledAt?: Date;
61
+ }
62
+ /**
63
+ * @export
64
+ */
65
+ export declare const RefereeStatusStatusEnum: {
66
+ readonly Pending: "pending";
67
+ readonly Qualified: "qualified";
68
+ readonly Settled: "settled";
69
+ readonly Rejected: "rejected";
70
+ };
71
+ export type RefereeStatusStatusEnum = typeof RefereeStatusStatusEnum[keyof typeof RefereeStatusStatusEnum];
72
+ /**
73
+ * Check if a given object implements the RefereeStatus interface.
74
+ */
75
+ export declare function instanceOfRefereeStatus(value: object): value is RefereeStatus;
76
+ export declare function RefereeStatusFromJSON(json: any): RefereeStatus;
77
+ export declare function RefereeStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): RefereeStatus;
78
+ export declare function RefereeStatusToJSON(json: any): RefereeStatus;
79
+ export declare function RefereeStatusToJSONTyped(value?: RefereeStatus | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,70 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * @export
16
+ */
17
+ export const RefereeStatusStatusEnum = {
18
+ Pending: 'pending',
19
+ Qualified: 'qualified',
20
+ Settled: 'settled',
21
+ Rejected: 'rejected'
22
+ };
23
+ /**
24
+ * Check if a given object implements the RefereeStatus interface.
25
+ */
26
+ export function instanceOfRefereeStatus(value) {
27
+ if (!('status' in value) || value['status'] === undefined)
28
+ return false;
29
+ if ((!('spentCents' in value) && !('spent_cents' in value)) || (value['spentCents'] === undefined && value['spent_cents'] === undefined))
30
+ return false;
31
+ if ((!('qualifySpendCents' in value) && !('qualify_spend_cents' in value)) || (value['qualifySpendCents'] === undefined && value['qualify_spend_cents'] === undefined))
32
+ return false;
33
+ if ((!('rewardCents' in value) && !('reward_cents' in value)) || (value['rewardCents'] === undefined && value['reward_cents'] === undefined))
34
+ return false;
35
+ return true;
36
+ }
37
+ export function RefereeStatusFromJSON(json) {
38
+ return RefereeStatusFromJSONTyped(json, false);
39
+ }
40
+ export function RefereeStatusFromJSONTyped(json, ignoreDiscriminator) {
41
+ if (json == null) {
42
+ return json;
43
+ }
44
+ return {
45
+ 'status': json['status'],
46
+ 'spentCents': json['spent_cents'],
47
+ 'qualifySpendCents': json['qualify_spend_cents'],
48
+ 'rewardCents': json['reward_cents'],
49
+ 'qualifiedAt': json['qualified_at'] == null ? undefined : (new Date(json['qualified_at'])),
50
+ 'holdUntil': json['hold_until'] == null ? undefined : (new Date(json['hold_until'])),
51
+ 'settledAt': json['settled_at'] == null ? undefined : (new Date(json['settled_at'])),
52
+ };
53
+ }
54
+ export function RefereeStatusToJSON(json) {
55
+ return RefereeStatusToJSONTyped(json, false);
56
+ }
57
+ export function RefereeStatusToJSONTyped(value, ignoreDiscriminator = false) {
58
+ if (value == null) {
59
+ return value;
60
+ }
61
+ return {
62
+ 'status': value['status'],
63
+ 'spent_cents': value['spentCents'],
64
+ 'qualify_spend_cents': value['qualifySpendCents'],
65
+ 'reward_cents': value['rewardCents'],
66
+ 'qualified_at': value['qualifiedAt'] == null ? value['qualifiedAt'] : value['qualifiedAt'].toISOString(),
67
+ 'hold_until': value['holdUntil'] == null ? value['holdUntil'] : value['holdUntil'].toISOString(),
68
+ 'settled_at': value['settledAt'] == null ? value['settledAt'] : value['settledAt'].toISOString(),
69
+ };
70
+ }