@deeprelay/sdk 0.4.1 → 0.4.3
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 +4 -0
- package/README.md +4 -2
- package/dist/apis/ApiKeysApi.d.ts +2 -2
- package/dist/apis/ApiKeysApi.js +2 -2
- package/dist/apis/BillingApi.d.ts +2 -2
- package/dist/apis/BillingApi.js +2 -2
- package/dist/apis/InferenceApi.d.ts +3 -2
- package/dist/apis/InferenceApi.js +5 -2
- package/dist/apis/RequestsApi.d.ts +4 -2
- package/dist/apis/RequestsApi.js +8 -2
- package/dist/esm/apis/ApiKeysApi.d.ts +2 -2
- package/dist/esm/apis/ApiKeysApi.js +2 -2
- package/dist/esm/apis/BillingApi.d.ts +2 -2
- package/dist/esm/apis/BillingApi.js +2 -2
- package/dist/esm/apis/InferenceApi.d.ts +3 -2
- package/dist/esm/apis/InferenceApi.js +5 -2
- package/dist/esm/apis/RequestsApi.d.ts +4 -2
- package/dist/esm/apis/RequestsApi.js +8 -2
- package/dist/esm/models/ApiKey.d.ts +19 -0
- package/dist/esm/models/ApiKey.js +9 -0
- package/dist/esm/models/ApiKeyCreate.d.ts +6 -0
- package/dist/esm/models/ApiKeyCreate.js +2 -0
- package/dist/esm/models/ApiKeyCreated.d.ts +19 -0
- package/dist/esm/models/ApiKeyCreated.js +9 -0
- package/dist/esm/models/ApiKeyFallbackEntry.d.ts +65 -0
- package/dist/esm/models/ApiKeyFallbackEntry.js +67 -0
- package/dist/esm/models/ApiKeyUpdate.d.ts +7 -1
- package/dist/esm/models/ApiKeyUpdate.js +2 -0
- package/dist/esm/models/ChatCompletionRequest.d.ts +6 -0
- package/dist/esm/models/ChatCompletionRequest.js +2 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +1 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.js +2 -1
- package/dist/esm/models/RefereeStatus.d.ts +33 -4
- package/dist/esm/models/RefereeStatus.js +15 -1
- package/dist/esm/models/Referral.d.ts +10 -3
- package/dist/esm/models/Referral.js +2 -0
- package/dist/esm/models/RequestAttempt.d.ts +71 -0
- package/dist/esm/models/RequestAttempt.js +67 -0
- package/dist/esm/models/RequestLogEntry.d.ts +25 -0
- package/dist/esm/models/RequestLogEntry.js +9 -0
- package/dist/esm/models/WebhookEndpoint.d.ts +1 -0
- package/dist/esm/models/WebhookEndpoint.js +2 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/ApiKey.d.ts +19 -0
- package/dist/models/ApiKey.js +9 -0
- package/dist/models/ApiKeyCreate.d.ts +6 -0
- package/dist/models/ApiKeyCreate.js +2 -0
- package/dist/models/ApiKeyCreated.d.ts +19 -0
- package/dist/models/ApiKeyCreated.js +9 -0
- package/dist/models/ApiKeyFallbackEntry.d.ts +65 -0
- package/dist/models/ApiKeyFallbackEntry.js +75 -0
- package/dist/models/ApiKeyUpdate.d.ts +7 -1
- package/dist/models/ApiKeyUpdate.js +2 -0
- package/dist/models/ChatCompletionRequest.d.ts +6 -0
- package/dist/models/ChatCompletionRequest.js +2 -0
- package/dist/models/CreateWebhookEndpointRequest.d.ts +1 -0
- package/dist/models/CreateWebhookEndpointRequest.js +2 -1
- package/dist/models/RefereeStatus.d.ts +33 -4
- package/dist/models/RefereeStatus.js +16 -2
- package/dist/models/Referral.d.ts +10 -3
- package/dist/models/Referral.js +2 -0
- package/dist/models/RequestAttempt.d.ts +71 -0
- package/dist/models/RequestAttempt.js +75 -0
- package/dist/models/RequestLogEntry.d.ts +25 -0
- package/dist/models/RequestLogEntry.js +9 -0
- package/dist/models/WebhookEndpoint.d.ts +1 -0
- package/dist/models/WebhookEndpoint.js +2 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/runtime.js +1 -1
- package/docs/ApiKey.md +6 -0
- package/docs/ApiKeyCreate.md +2 -0
- package/docs/ApiKeyCreated.md +6 -0
- package/docs/ApiKeyFallbackEntry.md +43 -0
- package/docs/ApiKeyUpdate.md +3 -1
- package/docs/ApiKeysApi.md +1 -1
- package/docs/BillingApi.md +1 -1
- package/docs/ChatCompletionRequest.md +2 -0
- package/docs/InferenceApi.md +29 -26
- package/docs/RefereeStatus.md +6 -0
- package/docs/Referral.md +2 -0
- package/docs/RequestAttempt.md +45 -0
- package/docs/RequestLogEntry.md +8 -0
- package/docs/RequestsApi.md +9 -3
- package/package.json +1 -1
- package/src/apis/ApiKeysApi.ts +2 -2
- package/src/apis/BillingApi.ts +2 -2
- package/src/apis/InferenceApi.ts +7 -2
- package/src/apis/RequestsApi.ts +12 -2
- package/src/models/ApiKey.ts +32 -0
- package/src/models/ApiKeyCreate.ts +8 -0
- package/src/models/ApiKeyCreated.ts +32 -0
- package/src/models/ApiKeyFallbackEntry.ts +114 -0
- package/src/models/ApiKeyUpdate.ts +9 -1
- package/src/models/ChatCompletionRequest.ts +8 -0
- package/src/models/CreateWebhookEndpointRequest.ts +2 -1
- package/src/models/RefereeStatus.ts +41 -5
- package/src/models/Referral.ts +12 -3
- package/src/models/RequestAttempt.ts +121 -0
- package/src/models/RequestLogEntry.ts +40 -0
- package/src/models/WebhookEndpoint.ts +2 -1
- package/src/models/index.ts +2 -0
- package/src/runtime.ts +1 -1
|
@@ -17,21 +17,41 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export interface RefereeStatus {
|
|
19
19
|
/**
|
|
20
|
-
* Lifecycle state. `pending` until the
|
|
20
|
+
* Lifecycle state. `pending` until the gate is met; `qualified` inside the hold; `settled` once paid; `reversed` when the qualifying deposit was refunded after payout and both rewards were taken back.
|
|
21
21
|
* @type {RefereeStatusStatusEnum}
|
|
22
22
|
* @memberof RefereeStatus
|
|
23
23
|
*/
|
|
24
24
|
status: RefereeStatusStatusEnum;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* What qualifies this referral. `deposit` (net real deposits) for current referrals; `spend` (inference usage) for referrals made under the earlier program, which keep their original terms.
|
|
27
|
+
* @type {RefereeStatusGateEnum}
|
|
28
|
+
* @memberof RefereeStatus
|
|
29
|
+
*/
|
|
30
|
+
gate?: RefereeStatusGateEnum;
|
|
31
|
+
/**
|
|
32
|
+
* Progress toward the gate so far — net deposits for `deposit`, inference spend for `spend`.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof RefereeStatus
|
|
35
|
+
*/
|
|
36
|
+
progressCents?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The amount that qualifies the referral.
|
|
27
39
|
* @type {number}
|
|
28
40
|
* @memberof RefereeStatus
|
|
29
41
|
*/
|
|
42
|
+
goalCents?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Deprecated alias of `progress_cents`.
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof RefereeStatus
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
30
49
|
spentCents: number;
|
|
31
50
|
/**
|
|
32
|
-
*
|
|
51
|
+
* Deprecated alias of `goal_cents`.
|
|
33
52
|
* @type {number}
|
|
34
53
|
* @memberof RefereeStatus
|
|
54
|
+
* @deprecated
|
|
35
55
|
*/
|
|
36
56
|
qualifySpendCents: number;
|
|
37
57
|
/**
|
|
@@ -41,7 +61,7 @@ export interface RefereeStatus {
|
|
|
41
61
|
*/
|
|
42
62
|
rewardCents: number;
|
|
43
63
|
/**
|
|
44
|
-
* When the
|
|
64
|
+
* When the gate was met. Absent while pending.
|
|
45
65
|
* @type {Date}
|
|
46
66
|
* @memberof RefereeStatus
|
|
47
67
|
*/
|
|
@@ -67,8 +87,17 @@ export declare const RefereeStatusStatusEnum: {
|
|
|
67
87
|
readonly Qualified: "qualified";
|
|
68
88
|
readonly Settled: "settled";
|
|
69
89
|
readonly Rejected: "rejected";
|
|
90
|
+
readonly Reversed: "reversed";
|
|
70
91
|
};
|
|
71
92
|
export type RefereeStatusStatusEnum = typeof RefereeStatusStatusEnum[keyof typeof RefereeStatusStatusEnum];
|
|
93
|
+
/**
|
|
94
|
+
* @export
|
|
95
|
+
*/
|
|
96
|
+
export declare const RefereeStatusGateEnum: {
|
|
97
|
+
readonly Deposit: "deposit";
|
|
98
|
+
readonly Spend: "spend";
|
|
99
|
+
};
|
|
100
|
+
export type RefereeStatusGateEnum = typeof RefereeStatusGateEnum[keyof typeof RefereeStatusGateEnum];
|
|
72
101
|
/**
|
|
73
102
|
* Check if a given object implements the RefereeStatus interface.
|
|
74
103
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Do not edit the class manually.
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.RefereeStatusStatusEnum = void 0;
|
|
16
|
+
exports.RefereeStatusGateEnum = exports.RefereeStatusStatusEnum = void 0;
|
|
17
17
|
exports.instanceOfRefereeStatus = instanceOfRefereeStatus;
|
|
18
18
|
exports.RefereeStatusFromJSON = RefereeStatusFromJSON;
|
|
19
19
|
exports.RefereeStatusFromJSONTyped = RefereeStatusFromJSONTyped;
|
|
@@ -26,7 +26,15 @@ exports.RefereeStatusStatusEnum = {
|
|
|
26
26
|
Pending: 'pending',
|
|
27
27
|
Qualified: 'qualified',
|
|
28
28
|
Settled: 'settled',
|
|
29
|
-
Rejected: 'rejected'
|
|
29
|
+
Rejected: 'rejected',
|
|
30
|
+
Reversed: 'reversed'
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
exports.RefereeStatusGateEnum = {
|
|
36
|
+
Deposit: 'deposit',
|
|
37
|
+
Spend: 'spend'
|
|
30
38
|
};
|
|
31
39
|
/**
|
|
32
40
|
* Check if a given object implements the RefereeStatus interface.
|
|
@@ -51,6 +59,9 @@ function RefereeStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
51
59
|
}
|
|
52
60
|
return {
|
|
53
61
|
'status': json['status'],
|
|
62
|
+
'gate': json['gate'] == null ? undefined : json['gate'],
|
|
63
|
+
'progressCents': json['progress_cents'] == null ? undefined : json['progress_cents'],
|
|
64
|
+
'goalCents': json['goal_cents'] == null ? undefined : json['goal_cents'],
|
|
54
65
|
'spentCents': json['spent_cents'],
|
|
55
66
|
'qualifySpendCents': json['qualify_spend_cents'],
|
|
56
67
|
'rewardCents': json['reward_cents'],
|
|
@@ -68,6 +79,9 @@ function RefereeStatusToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
68
79
|
}
|
|
69
80
|
return {
|
|
70
81
|
'status': value['status'],
|
|
82
|
+
'gate': value['gate'],
|
|
83
|
+
'progress_cents': value['progressCents'],
|
|
84
|
+
'goal_cents': value['goalCents'],
|
|
71
85
|
'spent_cents': value['spentCents'],
|
|
72
86
|
'qualify_spend_cents': value['qualifySpendCents'],
|
|
73
87
|
'reward_cents': value['rewardCents'],
|
|
@@ -30,13 +30,13 @@ export interface Referral {
|
|
|
30
30
|
*/
|
|
31
31
|
inviteUrl: string;
|
|
32
32
|
/**
|
|
33
|
-
* Friends who signed up through the link but have not yet reached the
|
|
33
|
+
* Friends who signed up through the link but have not yet reached the qualifying deposit.
|
|
34
34
|
* @type {number}
|
|
35
35
|
* @memberof Referral
|
|
36
36
|
*/
|
|
37
37
|
pending: number;
|
|
38
38
|
/**
|
|
39
|
-
* Friends past the
|
|
39
|
+
* Friends past the qualifying deposit whose reward is inside the chargeback hold.
|
|
40
40
|
* @type {number}
|
|
41
41
|
* @memberof Referral
|
|
42
42
|
*/
|
|
@@ -72,10 +72,17 @@ export interface Referral {
|
|
|
72
72
|
*/
|
|
73
73
|
refereeRewardCents: number;
|
|
74
74
|
/**
|
|
75
|
-
* The friend's cumulative
|
|
75
|
+
* The friend's cumulative net real deposits (card, auto-pay and crypto, less refunds) that qualify a referral.
|
|
76
76
|
* @type {number}
|
|
77
77
|
* @memberof Referral
|
|
78
78
|
*/
|
|
79
|
+
qualifyDepositCents?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Deprecated — referrals now qualify on deposits. Mirrors `qualify_deposit_cents`.
|
|
82
|
+
* @type {number}
|
|
83
|
+
* @memberof Referral
|
|
84
|
+
* @deprecated
|
|
85
|
+
*/
|
|
79
86
|
qualifySpendCents: number;
|
|
80
87
|
/**
|
|
81
88
|
* Days between qualification and payout (chargeback hold).
|
package/dist/models/Referral.js
CHANGED
|
@@ -66,6 +66,7 @@ function ReferralFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
66
66
|
'commissionEarnedCents': json['commission_earned_cents'],
|
|
67
67
|
'rewardCents': json['reward_cents'],
|
|
68
68
|
'refereeRewardCents': json['referee_reward_cents'],
|
|
69
|
+
'qualifyDepositCents': json['qualify_deposit_cents'] == null ? undefined : json['qualify_deposit_cents'],
|
|
69
70
|
'qualifySpendCents': json['qualify_spend_cents'],
|
|
70
71
|
'holdDays': json['hold_days'],
|
|
71
72
|
'commissionPct': json['commission_pct'],
|
|
@@ -89,6 +90,7 @@ function ReferralToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
89
90
|
'commission_earned_cents': value['commissionEarnedCents'],
|
|
90
91
|
'reward_cents': value['rewardCents'],
|
|
91
92
|
'referee_reward_cents': value['refereeRewardCents'],
|
|
93
|
+
'qualify_deposit_cents': value['qualifyDepositCents'],
|
|
92
94
|
'qualify_spend_cents': value['qualifySpendCents'],
|
|
93
95
|
'hold_days': value['holdDays'],
|
|
94
96
|
'commission_pct': value['commissionPct'],
|
|
@@ -0,0 +1,71 @@
|
|
|
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. Keys minted from the dashboard or `deeprelay login` belong to the Production server, https://api.deeprelay.ai/v1. The Demo server is an internal staging environment with its own key store. Versioning: `/v1` is the API version. `info.version` is the revision of this `/v1` document, not a separate API. OpenAI compatibility: chat completions follow the OpenAI request and response shapes, but not every OpenAI parameter is carried. Some are rejected with 400 `unsupported_parameter` and any parameter not declared in this spec is accepted and ignored. The full table is at https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
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
|
+
* One model in a request's backup-model trail.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface RequestAttempt
|
|
16
|
+
*/
|
|
17
|
+
export interface RequestAttempt {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof RequestAttempt
|
|
22
|
+
*/
|
|
23
|
+
model: string;
|
|
24
|
+
/**
|
|
25
|
+
* `ok`: this model served. `failed`: it was dialled and every provider failed before the first token. `skipped`: it was passed over without being dialled.
|
|
26
|
+
* @type {RequestAttemptOutcomeEnum}
|
|
27
|
+
* @memberof RequestAttempt
|
|
28
|
+
*/
|
|
29
|
+
outcome: RequestAttemptOutcomeEnum;
|
|
30
|
+
/**
|
|
31
|
+
* Why the attempt failed (a public error code such as `upstream_timeout`) or was skipped: `model_not_allowed_for_key`, `subscription_quota_exhausted`, `api_key_budget_exceeded`, `member_spend_limit_reached`, `insufficient_balance`, `daily_limit_reached`, `spending_limit_reached`, `wallet_only` (not on the plan roster, for a plan-covered request), `unavailable`, `capability_mismatch`, `context_window_too_small`, `breaker_open` or `deadline_exhausted` (too little time was left to start another model).
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof RequestAttempt
|
|
34
|
+
*/
|
|
35
|
+
reason?: string;
|
|
36
|
+
/**
|
|
37
|
+
* How long this model's attempt took, in milliseconds.
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof RequestAttempt
|
|
40
|
+
*/
|
|
41
|
+
durationMs: number;
|
|
42
|
+
/**
|
|
43
|
+
* Time to first token, for the model that served a streamed call.
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof RequestAttempt
|
|
46
|
+
*/
|
|
47
|
+
ttftMs?: number;
|
|
48
|
+
/**
|
|
49
|
+
* How many upstream attempts were made for this model. 0 for a skipped model.
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof RequestAttempt
|
|
52
|
+
*/
|
|
53
|
+
tries: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export declare const RequestAttemptOutcomeEnum: {
|
|
59
|
+
readonly Ok: "ok";
|
|
60
|
+
readonly Failed: "failed";
|
|
61
|
+
readonly Skipped: "skipped";
|
|
62
|
+
};
|
|
63
|
+
export type RequestAttemptOutcomeEnum = typeof RequestAttemptOutcomeEnum[keyof typeof RequestAttemptOutcomeEnum];
|
|
64
|
+
/**
|
|
65
|
+
* Check if a given object implements the RequestAttempt interface.
|
|
66
|
+
*/
|
|
67
|
+
export declare function instanceOfRequestAttempt(value: object): value is RequestAttempt;
|
|
68
|
+
export declare function RequestAttemptFromJSON(json: any): RequestAttempt;
|
|
69
|
+
export declare function RequestAttemptFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestAttempt;
|
|
70
|
+
export declare function RequestAttemptToJSON(json: any): RequestAttempt;
|
|
71
|
+
export declare function RequestAttemptToJSONTyped(value?: RequestAttempt | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* deeprelay Public Developer API
|
|
6
|
+
* Programmatic API for deeprelay. Authenticate with API keys minted from the dashboard. See https://deeprelay.ai/docs for details. Keys minted from the dashboard or `deeprelay login` belong to the Production server, https://api.deeprelay.ai/v1. The Demo server is an internal staging environment with its own key store. Versioning: `/v1` is the API version. `info.version` is the revision of this `/v1` document, not a separate API. OpenAI compatibility: chat completions follow the OpenAI request and response shapes, but not every OpenAI parameter is carried. Some are rejected with 400 `unsupported_parameter` and any parameter not declared in this spec is accepted and ignored. The full table is at https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@deeprelay.ai
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.RequestAttemptOutcomeEnum = void 0;
|
|
17
|
+
exports.instanceOfRequestAttempt = instanceOfRequestAttempt;
|
|
18
|
+
exports.RequestAttemptFromJSON = RequestAttemptFromJSON;
|
|
19
|
+
exports.RequestAttemptFromJSONTyped = RequestAttemptFromJSONTyped;
|
|
20
|
+
exports.RequestAttemptToJSON = RequestAttemptToJSON;
|
|
21
|
+
exports.RequestAttemptToJSONTyped = RequestAttemptToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.RequestAttemptOutcomeEnum = {
|
|
26
|
+
Ok: 'ok',
|
|
27
|
+
Failed: 'failed',
|
|
28
|
+
Skipped: 'skipped'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the RequestAttempt interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfRequestAttempt(value) {
|
|
34
|
+
if (!('model' in value) || value['model'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('outcome' in value) || value['outcome'] === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
if ((!('durationMs' in value) && !('duration_ms' in value)) || (value['durationMs'] === undefined && value['duration_ms'] === undefined))
|
|
39
|
+
return false;
|
|
40
|
+
if (!('tries' in value) || value['tries'] === undefined)
|
|
41
|
+
return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
function RequestAttemptFromJSON(json) {
|
|
45
|
+
return RequestAttemptFromJSONTyped(json, false);
|
|
46
|
+
}
|
|
47
|
+
function RequestAttemptFromJSONTyped(json, ignoreDiscriminator) {
|
|
48
|
+
if (json == null) {
|
|
49
|
+
return json;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
'model': json['model'],
|
|
53
|
+
'outcome': json['outcome'],
|
|
54
|
+
'reason': json['reason'] == null ? undefined : json['reason'],
|
|
55
|
+
'durationMs': json['duration_ms'],
|
|
56
|
+
'ttftMs': json['ttft_ms'] == null ? undefined : json['ttft_ms'],
|
|
57
|
+
'tries': json['tries'],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function RequestAttemptToJSON(json) {
|
|
61
|
+
return RequestAttemptToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
function RequestAttemptToJSONTyped(value, ignoreDiscriminator = false) {
|
|
64
|
+
if (value == null) {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
'model': value['model'],
|
|
69
|
+
'outcome': value['outcome'],
|
|
70
|
+
'reason': value['reason'],
|
|
71
|
+
'duration_ms': value['durationMs'],
|
|
72
|
+
'ttft_ms': value['ttftMs'],
|
|
73
|
+
'tries': value['tries'],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import type { RequestAttempt } from './RequestAttempt';
|
|
12
13
|
/**
|
|
13
14
|
* One inference call as the request log records it. Never carries prompt or completion content. Optional numeric fields are omitted when they do not apply (for example token counts on a rejected call).
|
|
14
15
|
* @export
|
|
@@ -177,6 +178,30 @@ export interface RequestLogEntry {
|
|
|
177
178
|
* @memberof RequestLogEntry
|
|
178
179
|
*/
|
|
179
180
|
suppressedCount?: number;
|
|
181
|
+
/**
|
|
182
|
+
* The model the request asked for. Always present; equal to `model` unless a backup model was tried.
|
|
183
|
+
* @type {string}
|
|
184
|
+
* @memberof RequestLogEntry
|
|
185
|
+
*/
|
|
186
|
+
requestedModel?: string;
|
|
187
|
+
/**
|
|
188
|
+
* The model that produced the response. Omitted when no model served (a failed or rejected call). When a backup served, `model` is this model and the row is billed at its price.
|
|
189
|
+
* @type {string}
|
|
190
|
+
* @memberof RequestLogEntry
|
|
191
|
+
*/
|
|
192
|
+
servedModel?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Set when backup models were tried: the requested model's public error code (for example `upstream_timeout`). Rows with it set are the ones `fallback=true` returns.
|
|
195
|
+
* @type {string}
|
|
196
|
+
* @memberof RequestLogEntry
|
|
197
|
+
*/
|
|
198
|
+
fallbackReason?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Present when backup models were tried: every model the request went through, in order, including skipped backups. Upstream providers are never named.
|
|
201
|
+
* @type {Array<RequestAttempt>}
|
|
202
|
+
* @memberof RequestLogEntry
|
|
203
|
+
*/
|
|
204
|
+
attempts?: Array<RequestAttempt>;
|
|
180
205
|
}
|
|
181
206
|
/**
|
|
182
207
|
* @export
|
|
@@ -19,6 +19,7 @@ exports.RequestLogEntryFromJSON = RequestLogEntryFromJSON;
|
|
|
19
19
|
exports.RequestLogEntryFromJSONTyped = RequestLogEntryFromJSONTyped;
|
|
20
20
|
exports.RequestLogEntryToJSON = RequestLogEntryToJSON;
|
|
21
21
|
exports.RequestLogEntryToJSONTyped = RequestLogEntryToJSONTyped;
|
|
22
|
+
const RequestAttempt_1 = require("./RequestAttempt");
|
|
22
23
|
/**
|
|
23
24
|
* @export
|
|
24
25
|
*/
|
|
@@ -96,6 +97,10 @@ function RequestLogEntryFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
96
97
|
'imageCount': json['image_count'] == null ? undefined : json['image_count'],
|
|
97
98
|
'videoSeconds': json['video_seconds'] == null ? undefined : json['video_seconds'],
|
|
98
99
|
'suppressedCount': json['suppressed_count'] == null ? undefined : json['suppressed_count'],
|
|
100
|
+
'requestedModel': json['requested_model'] == null ? undefined : json['requested_model'],
|
|
101
|
+
'servedModel': json['served_model'] == null ? undefined : json['served_model'],
|
|
102
|
+
'fallbackReason': json['fallback_reason'] == null ? undefined : json['fallback_reason'],
|
|
103
|
+
'attempts': json['attempts'] == null ? undefined : (json['attempts'].map(RequestAttempt_1.RequestAttemptFromJSON)),
|
|
99
104
|
};
|
|
100
105
|
}
|
|
101
106
|
function RequestLogEntryToJSON(json) {
|
|
@@ -133,5 +138,9 @@ function RequestLogEntryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
133
138
|
'image_count': value['imageCount'],
|
|
134
139
|
'video_seconds': value['videoSeconds'],
|
|
135
140
|
'suppressed_count': value['suppressedCount'],
|
|
141
|
+
'requested_model': value['requestedModel'],
|
|
142
|
+
'served_model': value['servedModel'],
|
|
143
|
+
'fallback_reason': value['fallbackReason'],
|
|
144
|
+
'attempts': value['attempts'] == null ? undefined : (value['attempts'].map(RequestAttempt_1.RequestAttemptToJSON)),
|
|
136
145
|
};
|
|
137
146
|
}
|
|
@@ -66,6 +66,7 @@ export declare const WebhookEndpointEventTypesEnum: {
|
|
|
66
66
|
readonly SubscriptionQuotaThreshold: "subscription_quota.threshold";
|
|
67
67
|
readonly ApiKeyBudgetThreshold: "api_key_budget.threshold";
|
|
68
68
|
readonly MemberSpendThreshold: "member_spend.threshold";
|
|
69
|
+
readonly PlanRosterModelRemoved: "plan_roster.model_removed";
|
|
69
70
|
};
|
|
70
71
|
export type WebhookEndpointEventTypesEnum = typeof WebhookEndpointEventTypesEnum[keyof typeof WebhookEndpointEventTypesEnum];
|
|
71
72
|
/**
|
|
@@ -32,7 +32,8 @@ exports.WebhookEndpointEventTypesEnum = {
|
|
|
32
32
|
BalanceLow: 'balance.low',
|
|
33
33
|
SubscriptionQuotaThreshold: 'subscription_quota.threshold',
|
|
34
34
|
ApiKeyBudgetThreshold: 'api_key_budget.threshold',
|
|
35
|
-
MemberSpendThreshold: 'member_spend.threshold'
|
|
35
|
+
MemberSpendThreshold: 'member_spend.threshold',
|
|
36
|
+
PlanRosterModelRemoved: 'plan_roster.model_removed'
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
39
|
* Check if a given object implements the WebhookEndpoint interface.
|
package/dist/models/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './AlertSettingsUpdate';
|
|
|
4
4
|
export * from './ApiKey';
|
|
5
5
|
export * from './ApiKeyCreate';
|
|
6
6
|
export * from './ApiKeyCreated';
|
|
7
|
+
export * from './ApiKeyFallbackEntry';
|
|
7
8
|
export * from './ApiKeyList';
|
|
8
9
|
export * from './ApiKeyScopes';
|
|
9
10
|
export * from './ApiKeyUpdate';
|
|
@@ -43,6 +44,7 @@ export * from './PeakWindow';
|
|
|
43
44
|
export * from './Problem';
|
|
44
45
|
export * from './RefereeStatus';
|
|
45
46
|
export * from './Referral';
|
|
47
|
+
export * from './RequestAttempt';
|
|
46
48
|
export * from './RequestLogEntry';
|
|
47
49
|
export * from './RequestLogPage';
|
|
48
50
|
export * from './ResponseFormatJSONObject';
|
package/dist/models/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./AlertSettingsUpdate"), exports);
|
|
|
22
22
|
__exportStar(require("./ApiKey"), exports);
|
|
23
23
|
__exportStar(require("./ApiKeyCreate"), exports);
|
|
24
24
|
__exportStar(require("./ApiKeyCreated"), exports);
|
|
25
|
+
__exportStar(require("./ApiKeyFallbackEntry"), exports);
|
|
25
26
|
__exportStar(require("./ApiKeyList"), exports);
|
|
26
27
|
__exportStar(require("./ApiKeyScopes"), exports);
|
|
27
28
|
__exportStar(require("./ApiKeyUpdate"), exports);
|
|
@@ -61,6 +62,7 @@ __exportStar(require("./PeakWindow"), exports);
|
|
|
61
62
|
__exportStar(require("./Problem"), exports);
|
|
62
63
|
__exportStar(require("./RefereeStatus"), exports);
|
|
63
64
|
__exportStar(require("./Referral"), exports);
|
|
65
|
+
__exportStar(require("./RequestAttempt"), exports);
|
|
64
66
|
__exportStar(require("./RequestLogEntry"), exports);
|
|
65
67
|
__exportStar(require("./RequestLogPage"), exports);
|
|
66
68
|
__exportStar(require("./ResponseFormatJSONObject"), exports);
|
package/dist/runtime.js
CHANGED
|
@@ -69,7 +69,7 @@ class Configuration {
|
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
71
71
|
get headers() {
|
|
72
|
-
return Object.assign({ 'User-Agent': 'deeprelay-sdk-ts/0.4.
|
|
72
|
+
return Object.assign({ 'User-Agent': 'deeprelay-sdk-ts/0.4.3' }, this.configuration.headers);
|
|
73
73
|
}
|
|
74
74
|
get credentials() {
|
|
75
75
|
return this.configuration.credentials;
|
package/docs/ApiKey.md
CHANGED
|
@@ -17,6 +17,9 @@ Name | Type
|
|
|
17
17
|
`budgetResetsAt` | Date
|
|
18
18
|
`allowedModels` | Array<string>
|
|
19
19
|
`staleModels` | Array<string>
|
|
20
|
+
`fallbackModels` | Array<string>
|
|
21
|
+
`fallbackEntries` | [Array<ApiKeyFallbackEntry>](ApiKeyFallbackEntry.md)
|
|
22
|
+
`primaryModel` | string
|
|
20
23
|
`rateLimitRps` | number
|
|
21
24
|
`rateLimitBurst` | number
|
|
22
25
|
`expiresAt` | Date
|
|
@@ -41,6 +44,9 @@ const example = {
|
|
|
41
44
|
"budgetResetsAt": null,
|
|
42
45
|
"allowedModels": null,
|
|
43
46
|
"staleModels": null,
|
|
47
|
+
"fallbackModels": null,
|
|
48
|
+
"fallbackEntries": null,
|
|
49
|
+
"primaryModel": null,
|
|
44
50
|
"rateLimitRps": null,
|
|
45
51
|
"rateLimitBurst": null,
|
|
46
52
|
"expiresAt": null,
|
package/docs/ApiKeyCreate.md
CHANGED
|
@@ -10,6 +10,7 @@ Name | Type
|
|
|
10
10
|
`scopes` | { [key: string]: any; }
|
|
11
11
|
`budgetCents` | number
|
|
12
12
|
`allowedModels` | Array<string>
|
|
13
|
+
`fallbackModels` | Array<string>
|
|
13
14
|
`rateLimitRps` | number
|
|
14
15
|
`rateLimitBurst` | number
|
|
15
16
|
`expiresAt` | Date
|
|
@@ -25,6 +26,7 @@ const example = {
|
|
|
25
26
|
"scopes": null,
|
|
26
27
|
"budgetCents": null,
|
|
27
28
|
"allowedModels": null,
|
|
29
|
+
"fallbackModels": null,
|
|
28
30
|
"rateLimitRps": null,
|
|
29
31
|
"rateLimitBurst": null,
|
|
30
32
|
"expiresAt": null,
|
package/docs/ApiKeyCreated.md
CHANGED
|
@@ -17,6 +17,9 @@ Name | Type
|
|
|
17
17
|
`budgetResetsAt` | Date
|
|
18
18
|
`allowedModels` | Array<string>
|
|
19
19
|
`staleModels` | Array<string>
|
|
20
|
+
`fallbackModels` | Array<string>
|
|
21
|
+
`fallbackEntries` | [Array<ApiKeyFallbackEntry>](ApiKeyFallbackEntry.md)
|
|
22
|
+
`primaryModel` | string
|
|
20
23
|
`rateLimitRps` | number
|
|
21
24
|
`rateLimitBurst` | number
|
|
22
25
|
`expiresAt` | Date
|
|
@@ -42,6 +45,9 @@ const example = {
|
|
|
42
45
|
"budgetResetsAt": null,
|
|
43
46
|
"allowedModels": null,
|
|
44
47
|
"staleModels": null,
|
|
48
|
+
"fallbackModels": null,
|
|
49
|
+
"fallbackEntries": null,
|
|
50
|
+
"primaryModel": null,
|
|
45
51
|
"rateLimitRps": null,
|
|
46
52
|
"rateLimitBurst": null,
|
|
47
53
|
"expiresAt": null,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiKeyFallbackEntry
|
|
3
|
+
|
|
4
|
+
One backup model on a key, as it stands now.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`model` | string
|
|
11
|
+
`state` | string
|
|
12
|
+
`inputPer1mTokensMicrocents` | number
|
|
13
|
+
`outputPer1mTokensMicrocents` | number
|
|
14
|
+
`abovePrimary` | boolean
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { ApiKeyFallbackEntry } from '@deeprelay/sdk'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"model": null,
|
|
24
|
+
"state": null,
|
|
25
|
+
"inputPer1mTokensMicrocents": null,
|
|
26
|
+
"outputPer1mTokensMicrocents": null,
|
|
27
|
+
"abovePrimary": null,
|
|
28
|
+
} satisfies ApiKeyFallbackEntry
|
|
29
|
+
|
|
30
|
+
console.log(example)
|
|
31
|
+
|
|
32
|
+
// Convert the instance to a JSON string
|
|
33
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
34
|
+
console.log(exampleJSON)
|
|
35
|
+
|
|
36
|
+
// Parse the JSON string back to an object
|
|
37
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiKeyFallbackEntry
|
|
38
|
+
console.log(exampleParsed)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
42
|
+
|
|
43
|
+
|
package/docs/ApiKeyUpdate.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# ApiKeyUpdate
|
|
3
3
|
|
|
4
|
-
Send only the fields to change. `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed.
|
|
4
|
+
Send only the fields to change. `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed.
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
@@ -10,6 +10,7 @@ Name | Type
|
|
|
10
10
|
`name` | string
|
|
11
11
|
`budgetCents` | number
|
|
12
12
|
`allowedModels` | Array<string>
|
|
13
|
+
`fallbackModels` | Array<string>
|
|
13
14
|
`rateLimitRps` | number
|
|
14
15
|
`rateLimitBurst` | number
|
|
15
16
|
`expiresAt` | Date
|
|
@@ -24,6 +25,7 @@ const example = {
|
|
|
24
25
|
"name": null,
|
|
25
26
|
"budgetCents": null,
|
|
26
27
|
"allowedModels": null,
|
|
28
|
+
"fallbackModels": null,
|
|
27
29
|
"rateLimitRps": null,
|
|
28
30
|
"rateLimitBurst": null,
|
|
29
31
|
"expiresAt": null,
|
package/docs/ApiKeysApi.md
CHANGED
|
@@ -311,7 +311,7 @@ example().catch(console.error);
|
|
|
311
311
|
|
|
312
312
|
Update an API key\'s name or limits
|
|
313
313
|
|
|
314
|
-
Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
314
|
+
Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
315
315
|
|
|
316
316
|
### Example
|
|
317
317
|
|
package/docs/BillingApi.md
CHANGED
|
@@ -460,7 +460,7 @@ example().catch(console.error);
|
|
|
460
460
|
|
|
461
461
|
Get the org referral code, invite link, terms and stats
|
|
462
462
|
|
|
463
|
-
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;
|
|
463
|
+
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; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. 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.
|
|
464
464
|
|
|
465
465
|
### Example
|
|
466
466
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`model` | string
|
|
10
|
+
`models` | Array<string>
|
|
10
11
|
`messages` | [Array<ChatMessage>](ChatMessage.md)
|
|
11
12
|
`temperature` | number
|
|
12
13
|
`maxTokens` | number
|
|
@@ -32,6 +33,7 @@ import type { ChatCompletionRequest } from '@deeprelay/sdk'
|
|
|
32
33
|
// TODO: Update the object below with actual values
|
|
33
34
|
const example = {
|
|
34
35
|
"model": null,
|
|
36
|
+
"models": null,
|
|
35
37
|
"messages": null,
|
|
36
38
|
"temperature": null,
|
|
37
39
|
"maxTokens": null,
|