@deeprelay/sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +10 -2
  3. package/dist/apis/BillingApi.d.ts +38 -0
  4. package/dist/apis/BillingApi.js +96 -0
  5. package/dist/apis/InferenceApi.d.ts +18 -0
  6. package/dist/apis/InferenceApi.js +51 -0
  7. package/dist/esm/apis/BillingApi.d.ts +38 -0
  8. package/dist/esm/apis/BillingApi.js +96 -0
  9. package/dist/esm/apis/InferenceApi.d.ts +18 -0
  10. package/dist/esm/apis/InferenceApi.js +51 -0
  11. package/dist/esm/models/InferencePreflight.d.ts +92 -0
  12. package/dist/esm/models/InferencePreflight.js +86 -0
  13. package/dist/esm/models/SubscriptionCheckoutRequest.d.ts +45 -0
  14. package/dist/esm/models/SubscriptionCheckoutRequest.js +45 -0
  15. package/dist/esm/models/SubscriptionCheckoutSession.d.ts +45 -0
  16. package/dist/esm/models/SubscriptionCheckoutSession.js +52 -0
  17. package/dist/esm/models/SubscriptionPortalRequest.d.ts +32 -0
  18. package/dist/esm/models/SubscriptionPortalRequest.js +41 -0
  19. package/dist/esm/models/SubscriptionPortalSession.d.ts +32 -0
  20. package/dist/esm/models/SubscriptionPortalSession.js +43 -0
  21. package/dist/esm/models/index.d.ts +5 -0
  22. package/dist/esm/models/index.js +5 -0
  23. package/dist/esm/runtime.js +1 -1
  24. package/dist/models/InferencePreflight.d.ts +92 -0
  25. package/dist/models/InferencePreflight.js +94 -0
  26. package/dist/models/SubscriptionCheckoutRequest.d.ts +45 -0
  27. package/dist/models/SubscriptionCheckoutRequest.js +52 -0
  28. package/dist/models/SubscriptionCheckoutSession.d.ts +45 -0
  29. package/dist/models/SubscriptionCheckoutSession.js +59 -0
  30. package/dist/models/SubscriptionPortalRequest.d.ts +32 -0
  31. package/dist/models/SubscriptionPortalRequest.js +48 -0
  32. package/dist/models/SubscriptionPortalSession.d.ts +32 -0
  33. package/dist/models/SubscriptionPortalSession.js +50 -0
  34. package/dist/models/index.d.ts +5 -0
  35. package/dist/models/index.js +5 -0
  36. package/dist/runtime.js +1 -1
  37. package/docs/BillingApi.md +154 -0
  38. package/docs/InferenceApi.md +74 -0
  39. package/docs/InferencePreflight.md +47 -0
  40. package/docs/SubscriptionCheckoutRequest.md +39 -0
  41. package/docs/SubscriptionCheckoutSession.md +38 -0
  42. package/docs/SubscriptionPortalRequest.md +35 -0
  43. package/docs/SubscriptionPortalSession.md +34 -0
  44. package/package.json +1 -1
  45. package/src/apis/BillingApi.ts +128 -0
  46. package/src/apis/InferenceApi.ts +67 -0
  47. package/src/models/InferencePreflight.ts +147 -0
  48. package/src/models/SubscriptionCheckoutRequest.ts +82 -0
  49. package/src/models/SubscriptionCheckoutSession.ts +92 -0
  50. package/src/models/SubscriptionPortalRequest.ts +65 -0
  51. package/src/models/SubscriptionPortalSession.ts +66 -0
  52. package/src/models/index.ts +5 -0
  53. package/src/runtime.ts +1 -1
@@ -43,6 +43,11 @@ import {
43
43
  ImagesResponseFromJSON,
44
44
  ImagesResponseToJSON,
45
45
  } from '../models/ImagesResponse';
46
+ import {
47
+ type InferencePreflight,
48
+ InferencePreflightFromJSON,
49
+ InferencePreflightToJSON,
50
+ } from '../models/InferencePreflight';
46
51
  import {
47
52
  type Model,
48
53
  ModelFromJSON,
@@ -108,6 +113,10 @@ export interface GetVideoContentRequest {
108
113
  id: string;
109
114
  }
110
115
 
116
+ export interface InferencePreflightRequest {
117
+ model: string;
118
+ }
119
+
111
120
  export interface ListModelsRequest {
112
121
  modality?: ListModelsModalityEnum;
113
122
  }
@@ -570,6 +579,64 @@ export class InferenceApi extends runtime.BaseAPI {
570
579
  return await response.value();
571
580
  }
572
581
 
582
+ /**
583
+ * Creates request options for inferencePreflight without sending the request
584
+ */
585
+ async inferencePreflightRequestOpts(requestParameters: InferencePreflightRequest): Promise<runtime.RequestOpts> {
586
+ if (requestParameters['model'] == null) {
587
+ throw new runtime.RequiredError(
588
+ 'model',
589
+ 'Required parameter "model" was null or undefined when calling inferencePreflight().'
590
+ );
591
+ }
592
+
593
+ const queryParameters: any = {};
594
+
595
+ if (requestParameters['model'] != null) {
596
+ queryParameters['model'] = requestParameters['model'];
597
+ }
598
+
599
+ const headerParameters: runtime.HTTPHeaders = {};
600
+
601
+ if (this.configuration && this.configuration.accessToken) {
602
+ const token = this.configuration.accessToken;
603
+ const tokenString = await token("bearerAuth", []);
604
+
605
+ if (tokenString) {
606
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
607
+ }
608
+ }
609
+
610
+ let urlPath = `/inference/preflight`;
611
+
612
+ return {
613
+ path: urlPath,
614
+ method: 'GET',
615
+ headers: headerParameters,
616
+ query: queryParameters,
617
+ };
618
+ }
619
+
620
+ /**
621
+ * Answers \"what happens if I call this model right now?\" before the call is made: whether the plan covers the model, whether the organization is subscribed, and whether there is credit to pay if it is not covered. Requires the `serverless:read` scope. Nothing is sent, counted, charged, or reserved. The verdict is computed from the state of the SAME gates that judge the real request — plan coverage, subscription entitlement, remaining plan quota, credit balance and self-set spending caps — so the advice cannot drift from enforcement. It is deliberately NOT a dry run: no per-request cost estimate is quoted, because that figure changes with every prompt and quoting it would invite clients to cache it. The gates consulted depend on the model\'s MODALITY, because the endpoints do not all meet the same ones. Chat, embeddings and image requests meet the full gate (balance, then the organization\'s opt-in daily cap, then its monthly cap). Video creation meets only the balance check, so an organization past its own spending cap but holding credit is reported as fundable for video — which is what the video endpoint will in fact do. Predicting the strictest gate rather than the applicable one would make this endpoint refuse requests the API accepts. The same is true of the plan: video creation does not run the subscription gate, so `plan_covered` is false for a video model even if an operator has placed it on the plan\'s covered list. That is a deliberate divergence from the same-named field on `/v1/models`, which reports the platform\'s configuration. Here it means \"the plan covers this REQUEST\" — describing what will happen is the entire job of a preflight. One caveat on \"read-only\": resolving the balance creates the organization\'s balance row if it has never had one (idempotent, org-scoped, and the same row the first real request would create). Nothing else is written. The case this exists for is `warn` / `not_plan_covered`. A subscriber calling a model outside the plan IS served and IS charged pay-as-you-go, and nothing in the response to that request says so — the first signal used to be the invoice. `funded` is a boolean and never a figure. This route is on the inference read scope, so it must not disclose the organization\'s balance; use `/billing/balance` for the number. Failure posture is the opposite of the request gate\'s: any gate that cannot be read degrades the verdict toward `ok`, never toward `block`. A false `block` would stop a customer whose request would have succeeded, while a false `ok` costs them one honest error from the real call.
622
+ * Check whether a model request would be served, and at whose expense
623
+ */
624
+ async inferencePreflightRaw(requestParameters: InferencePreflightRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InferencePreflight>> {
625
+ const requestOptions = await this.inferencePreflightRequestOpts(requestParameters);
626
+ const response = await this.request(requestOptions, initOverrides);
627
+
628
+ return new runtime.JSONApiResponse(response, (jsonValue) => InferencePreflightFromJSON(jsonValue));
629
+ }
630
+
631
+ /**
632
+ * Answers \"what happens if I call this model right now?\" before the call is made: whether the plan covers the model, whether the organization is subscribed, and whether there is credit to pay if it is not covered. Requires the `serverless:read` scope. Nothing is sent, counted, charged, or reserved. The verdict is computed from the state of the SAME gates that judge the real request — plan coverage, subscription entitlement, remaining plan quota, credit balance and self-set spending caps — so the advice cannot drift from enforcement. It is deliberately NOT a dry run: no per-request cost estimate is quoted, because that figure changes with every prompt and quoting it would invite clients to cache it. The gates consulted depend on the model\'s MODALITY, because the endpoints do not all meet the same ones. Chat, embeddings and image requests meet the full gate (balance, then the organization\'s opt-in daily cap, then its monthly cap). Video creation meets only the balance check, so an organization past its own spending cap but holding credit is reported as fundable for video — which is what the video endpoint will in fact do. Predicting the strictest gate rather than the applicable one would make this endpoint refuse requests the API accepts. The same is true of the plan: video creation does not run the subscription gate, so `plan_covered` is false for a video model even if an operator has placed it on the plan\'s covered list. That is a deliberate divergence from the same-named field on `/v1/models`, which reports the platform\'s configuration. Here it means \"the plan covers this REQUEST\" — describing what will happen is the entire job of a preflight. One caveat on \"read-only\": resolving the balance creates the organization\'s balance row if it has never had one (idempotent, org-scoped, and the same row the first real request would create). Nothing else is written. The case this exists for is `warn` / `not_plan_covered`. A subscriber calling a model outside the plan IS served and IS charged pay-as-you-go, and nothing in the response to that request says so — the first signal used to be the invoice. `funded` is a boolean and never a figure. This route is on the inference read scope, so it must not disclose the organization\'s balance; use `/billing/balance` for the number. Failure posture is the opposite of the request gate\'s: any gate that cannot be read degrades the verdict toward `ok`, never toward `block`. A false `block` would stop a customer whose request would have succeeded, while a false `ok` costs them one honest error from the real call.
633
+ * Check whether a model request would be served, and at whose expense
634
+ */
635
+ async inferencePreflight(requestParameters: InferencePreflightRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InferencePreflight> {
636
+ const response = await this.inferencePreflightRaw(requestParameters, initOverrides);
637
+ return await response.value();
638
+ }
639
+
573
640
  /**
574
641
  * Creates request options for listModels without sending the request
575
642
  */
@@ -0,0 +1,147 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * The verdict for one (organization, model) pair: what would happen if the model were invoked right now.
18
+ *
19
+ * @export
20
+ * @interface InferencePreflight
21
+ */
22
+ export interface InferencePreflight {
23
+ /**
24
+ * The canonical catalog id the request resolved to.
25
+ * @type {string}
26
+ * @memberof InferencePreflight
27
+ */
28
+ model: string;
29
+ /**
30
+ * `ok` — the request will be served (covered by the plan, or payable). `warn` — it will be served AND charged in a way the caller may not expect. `block` — it will be refused (402 or 429).
31
+ * @type {InferencePreflightVerdictEnum}
32
+ * @memberof InferencePreflight
33
+ */
34
+ verdict: InferencePreflightVerdictEnum;
35
+ /**
36
+ * Stable code explaining the verdict, for clients that need their own wording. Absent on a plain `ok` that needs no explanation.
37
+ * @type {InferencePreflightReasonEnum}
38
+ * @memberof InferencePreflight
39
+ */
40
+ reason?: InferencePreflightReasonEnum;
41
+ /**
42
+ * A ready-to-print sentence, phrased for this exact plan/credit combination. Prefer it over composing one from verdict and reason: it improves without a client release.
43
+ * @type {string}
44
+ * @memberof InferencePreflight
45
+ */
46
+ message: string;
47
+ /**
48
+ * Whether the subscription tier covers this model. A property of the PLATFORM, not of the caller — it stays true for an organization that has no subscription, which is what makes the "this is included in the plan" upsell honest.
49
+ * @type {boolean}
50
+ * @memberof InferencePreflight
51
+ */
52
+ planCovered: boolean;
53
+ /**
54
+ * Whether the organization is entitled to the plan right now.
55
+ * @type {boolean}
56
+ * @memberof InferencePreflight
57
+ */
58
+ subscribed: boolean;
59
+ /**
60
+ * Whether a pay-as-you-go request could be paid for right now: a positive credit balance AND no self-set spending cap already at its limit. A boolean and never a figure — this route is on the inference read scope and must not disclose the balance.
61
+ * @type {boolean}
62
+ * @memberof InferencePreflight
63
+ */
64
+ funded: boolean;
65
+ }
66
+
67
+
68
+ /**
69
+ * @export
70
+ */
71
+ export const InferencePreflightVerdictEnum = {
72
+ Ok: 'ok',
73
+ Warn: 'warn',
74
+ Block: 'block'
75
+ } as const;
76
+ export type InferencePreflightVerdictEnum = typeof InferencePreflightVerdictEnum[keyof typeof InferencePreflightVerdictEnum];
77
+
78
+ /**
79
+ * @export
80
+ */
81
+ export const InferencePreflightReasonEnum = {
82
+ PlanCovered: 'plan_covered',
83
+ Payg: 'payg',
84
+ NotPlanCovered: 'not_plan_covered',
85
+ SubscriptionQuotaExhausted: 'subscription_quota_exhausted',
86
+ InsufficientBalance: 'insufficient_balance',
87
+ DailyLimitReached: 'daily_limit_reached',
88
+ MonthlyLimitReached: 'monthly_limit_reached',
89
+ PreflightUnavailable: 'preflight_unavailable'
90
+ } as const;
91
+ export type InferencePreflightReasonEnum = typeof InferencePreflightReasonEnum[keyof typeof InferencePreflightReasonEnum];
92
+
93
+
94
+ /**
95
+ * Check if a given object implements the InferencePreflight interface.
96
+ */
97
+ export function instanceOfInferencePreflight(value: object): value is InferencePreflight {
98
+ if (!('model' in value) || value['model'] === undefined) return false;
99
+ if (!('verdict' in value) || value['verdict'] === undefined) return false;
100
+ if (!('message' in value) || value['message'] === undefined) return false;
101
+ if ((!('planCovered' in (value as Record<string, any>)) && !('plan_covered' in (value as Record<string, any>))) || ((value as Record<string, any>)['planCovered'] === undefined && (value as Record<string, any>)['plan_covered'] === undefined)) return false;
102
+ if (!('subscribed' in value) || value['subscribed'] === undefined) return false;
103
+ if (!('funded' in value) || value['funded'] === undefined) return false;
104
+ return true;
105
+ }
106
+
107
+ export function InferencePreflightFromJSON(json: any): InferencePreflight {
108
+ return InferencePreflightFromJSONTyped(json, false);
109
+ }
110
+
111
+ export function InferencePreflightFromJSONTyped(json: any, ignoreDiscriminator: boolean): InferencePreflight {
112
+ if (json == null) {
113
+ return json;
114
+ }
115
+ return {
116
+
117
+ 'model': json['model'],
118
+ 'verdict': json['verdict'],
119
+ 'reason': json['reason'] == null ? undefined : json['reason'],
120
+ 'message': json['message'],
121
+ 'planCovered': json['plan_covered'],
122
+ 'subscribed': json['subscribed'],
123
+ 'funded': json['funded'],
124
+ };
125
+ }
126
+
127
+ export function InferencePreflightToJSON(json: any): InferencePreflight {
128
+ return InferencePreflightToJSONTyped(json, false);
129
+ }
130
+
131
+ export function InferencePreflightToJSONTyped(value?: InferencePreflight | null, ignoreDiscriminator: boolean = false): any {
132
+ if (value == null) {
133
+ return value;
134
+ }
135
+
136
+ return {
137
+
138
+ 'model': value['model'],
139
+ 'verdict': value['verdict'],
140
+ 'reason': value['reason'],
141
+ 'message': value['message'],
142
+ 'plan_covered': value['planCovered'],
143
+ 'subscribed': value['subscribed'],
144
+ 'funded': value['funded'],
145
+ };
146
+ }
147
+
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Optional overrides for a checkout mint. Every field has a deployment default, so an empty body is the normal call.
18
+ *
19
+ * @export
20
+ * @interface SubscriptionCheckoutRequest
21
+ */
22
+ export interface SubscriptionCheckoutRequest {
23
+ /**
24
+ * Where the provider returns after a completed payment. Defaults to the deployment's configured URL.
25
+ * @type {string}
26
+ * @memberof SubscriptionCheckoutRequest
27
+ */
28
+ successUrl?: string;
29
+ /**
30
+ * Where the provider returns if checkout is abandoned. Defaults to the deployment's configured URL.
31
+ * @type {string}
32
+ * @memberof SubscriptionCheckoutRequest
33
+ */
34
+ cancelUrl?: string;
35
+ /**
36
+ * Pins the plan the client displayed. An unknown key is a 400 rather than a silent purchase of a different tier.
37
+ * @type {string}
38
+ * @memberof SubscriptionCheckoutRequest
39
+ */
40
+ planKey?: string;
41
+ }
42
+
43
+ /**
44
+ * Check if a given object implements the SubscriptionCheckoutRequest interface.
45
+ */
46
+ export function instanceOfSubscriptionCheckoutRequest(value: object): value is SubscriptionCheckoutRequest {
47
+ return true;
48
+ }
49
+
50
+ export function SubscriptionCheckoutRequestFromJSON(json: any): SubscriptionCheckoutRequest {
51
+ return SubscriptionCheckoutRequestFromJSONTyped(json, false);
52
+ }
53
+
54
+ export function SubscriptionCheckoutRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionCheckoutRequest {
55
+ if (json == null) {
56
+ return json;
57
+ }
58
+ return {
59
+
60
+ 'successUrl': json['success_url'] == null ? undefined : json['success_url'],
61
+ 'cancelUrl': json['cancel_url'] == null ? undefined : json['cancel_url'],
62
+ 'planKey': json['plan_key'] == null ? undefined : json['plan_key'],
63
+ };
64
+ }
65
+
66
+ export function SubscriptionCheckoutRequestToJSON(json: any): SubscriptionCheckoutRequest {
67
+ return SubscriptionCheckoutRequestToJSONTyped(json, false);
68
+ }
69
+
70
+ export function SubscriptionCheckoutRequestToJSONTyped(value?: SubscriptionCheckoutRequest | null, ignoreDiscriminator: boolean = false): any {
71
+ if (value == null) {
72
+ return value;
73
+ }
74
+
75
+ return {
76
+
77
+ 'success_url': value['successUrl'],
78
+ 'cancel_url': value['cancelUrl'],
79
+ 'plan_key': value['planKey'],
80
+ };
81
+ }
82
+
@@ -0,0 +1,92 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { SubscriptionPlan } from './SubscriptionPlan';
17
+ import {
18
+ SubscriptionPlanFromJSON,
19
+ SubscriptionPlanFromJSONTyped,
20
+ SubscriptionPlanToJSON,
21
+ SubscriptionPlanToJSONTyped,
22
+ } from './SubscriptionPlan';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface SubscriptionCheckoutSession
28
+ */
29
+ export interface SubscriptionCheckoutSession {
30
+ /**
31
+ * The hosted page the customer must open to pay.
32
+ * @type {string}
33
+ * @memberof SubscriptionCheckoutSession
34
+ */
35
+ checkoutUrl: string;
36
+ /**
37
+ * Checkout session id, for support correlation.
38
+ * @type {string}
39
+ * @memberof SubscriptionCheckoutSession
40
+ */
41
+ sessionId: string;
42
+ /**
43
+ *
44
+ * @type {SubscriptionPlan}
45
+ * @memberof SubscriptionCheckoutSession
46
+ */
47
+ plan: SubscriptionPlan;
48
+ }
49
+
50
+ /**
51
+ * Check if a given object implements the SubscriptionCheckoutSession interface.
52
+ */
53
+ export function instanceOfSubscriptionCheckoutSession(value: object): value is SubscriptionCheckoutSession {
54
+ if ((!('checkoutUrl' in (value as Record<string, any>)) && !('checkout_url' in (value as Record<string, any>))) || ((value as Record<string, any>)['checkoutUrl'] === undefined && (value as Record<string, any>)['checkout_url'] === undefined)) return false;
55
+ if ((!('sessionId' in (value as Record<string, any>)) && !('session_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['sessionId'] === undefined && (value as Record<string, any>)['session_id'] === undefined)) return false;
56
+ if (!('plan' in value) || value['plan'] === undefined) return false;
57
+ return true;
58
+ }
59
+
60
+ export function SubscriptionCheckoutSessionFromJSON(json: any): SubscriptionCheckoutSession {
61
+ return SubscriptionCheckoutSessionFromJSONTyped(json, false);
62
+ }
63
+
64
+ export function SubscriptionCheckoutSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionCheckoutSession {
65
+ if (json == null) {
66
+ return json;
67
+ }
68
+ return {
69
+
70
+ 'checkoutUrl': json['checkout_url'],
71
+ 'sessionId': json['session_id'],
72
+ 'plan': SubscriptionPlanFromJSON(json['plan']),
73
+ };
74
+ }
75
+
76
+ export function SubscriptionCheckoutSessionToJSON(json: any): SubscriptionCheckoutSession {
77
+ return SubscriptionCheckoutSessionToJSONTyped(json, false);
78
+ }
79
+
80
+ export function SubscriptionCheckoutSessionToJSONTyped(value?: SubscriptionCheckoutSession | null, ignoreDiscriminator: boolean = false): any {
81
+ if (value == null) {
82
+ return value;
83
+ }
84
+
85
+ return {
86
+
87
+ 'checkout_url': value['checkoutUrl'],
88
+ 'session_id': value['sessionId'],
89
+ 'plan': SubscriptionPlanToJSON(value['plan']),
90
+ };
91
+ }
92
+
@@ -0,0 +1,65 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Optional overrides for a billing-portal mint.
18
+ * @export
19
+ * @interface SubscriptionPortalRequest
20
+ */
21
+ export interface SubscriptionPortalRequest {
22
+ /**
23
+ * Where the provider returns when the customer leaves the portal. Defaults to the deployment's configured URL.
24
+ * @type {string}
25
+ * @memberof SubscriptionPortalRequest
26
+ */
27
+ returnUrl?: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the SubscriptionPortalRequest interface.
32
+ */
33
+ export function instanceOfSubscriptionPortalRequest(value: object): value is SubscriptionPortalRequest {
34
+ return true;
35
+ }
36
+
37
+ export function SubscriptionPortalRequestFromJSON(json: any): SubscriptionPortalRequest {
38
+ return SubscriptionPortalRequestFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function SubscriptionPortalRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionPortalRequest {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+
47
+ 'returnUrl': json['return_url'] == null ? undefined : json['return_url'],
48
+ };
49
+ }
50
+
51
+ export function SubscriptionPortalRequestToJSON(json: any): SubscriptionPortalRequest {
52
+ return SubscriptionPortalRequestToJSONTyped(json, false);
53
+ }
54
+
55
+ export function SubscriptionPortalRequestToJSONTyped(value?: SubscriptionPortalRequest | null, ignoreDiscriminator: boolean = false): any {
56
+ if (value == null) {
57
+ return value;
58
+ }
59
+
60
+ return {
61
+
62
+ 'return_url': value['returnUrl'],
63
+ };
64
+ }
65
+
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * deeprelay Public Developer API
5
+ * Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@deeprelay.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface SubscriptionPortalSession
20
+ */
21
+ export interface SubscriptionPortalSession {
22
+ /**
23
+ * The hosted billing portal — cancel, resume, change payment method, download invoices.
24
+ * @type {string}
25
+ * @memberof SubscriptionPortalSession
26
+ */
27
+ portalUrl: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the SubscriptionPortalSession interface.
32
+ */
33
+ export function instanceOfSubscriptionPortalSession(value: object): value is SubscriptionPortalSession {
34
+ if ((!('portalUrl' in (value as Record<string, any>)) && !('portal_url' in (value as Record<string, any>))) || ((value as Record<string, any>)['portalUrl'] === undefined && (value as Record<string, any>)['portal_url'] === undefined)) return false;
35
+ return true;
36
+ }
37
+
38
+ export function SubscriptionPortalSessionFromJSON(json: any): SubscriptionPortalSession {
39
+ return SubscriptionPortalSessionFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function SubscriptionPortalSessionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionPortalSession {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'portalUrl': json['portal_url'],
49
+ };
50
+ }
51
+
52
+ export function SubscriptionPortalSessionToJSON(json: any): SubscriptionPortalSession {
53
+ return SubscriptionPortalSessionToJSONTyped(json, false);
54
+ }
55
+
56
+ export function SubscriptionPortalSessionToJSONTyped(value?: SubscriptionPortalSession | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'portal_url': value['portalUrl'],
64
+ };
65
+ }
66
+
@@ -18,6 +18,7 @@ export * from './ImagesGenerationsRequest';
18
18
  export * from './ImagesResponse';
19
19
  export * from './ImagesResponseDataInner';
20
20
  export * from './ImagesResponseUsage';
21
+ export * from './InferencePreflight';
21
22
  export * from './ListDeposits200Response';
22
23
  export * from './Model';
23
24
  export * from './ModelList';
@@ -34,7 +35,11 @@ export * from './Problem';
34
35
  export * from './SpendingLimit';
35
36
  export * from './StreamOptions';
36
37
  export * from './Subscription';
38
+ export * from './SubscriptionCheckoutRequest';
39
+ export * from './SubscriptionCheckoutSession';
37
40
  export * from './SubscriptionPlan';
41
+ export * from './SubscriptionPortalRequest';
42
+ export * from './SubscriptionPortalSession';
38
43
  export * from './SubscriptionPrice';
39
44
  export * from './SubscriptionQuota';
40
45
  export * from './SubscriptionUsage';
package/src/runtime.ts CHANGED
@@ -75,7 +75,7 @@ export class Configuration {
75
75
  }
76
76
 
77
77
  get headers(): HTTPHeaders | undefined {
78
- return { 'User-Agent': 'deeprelay-sdk-ts/0.1.0', ...this.configuration.headers };
78
+ return { 'User-Agent': 'deeprelay-sdk-ts/0.1.1', ...this.configuration.headers };
79
79
  }
80
80
 
81
81
  get credentials(): RequestCredentials | undefined {