@deeprelay/sdk 0.4.1 → 0.4.2
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/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/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/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/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/ChatCompletionRequest.md +2 -0
- package/docs/InferenceApi.md +29 -26
- 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/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/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
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { ApiKeyScopes } from './ApiKeyScopes';
|
|
13
|
+
import type { ApiKeyFallbackEntry } from './ApiKeyFallbackEntry';
|
|
13
14
|
/**
|
|
14
15
|
* The new key's metadata plus its secret (`key`), returned exactly once. The same fields as `ApiKey`, plus `key`.
|
|
15
16
|
* @export
|
|
@@ -76,6 +77,24 @@ export interface ApiKeyCreated {
|
|
|
76
77
|
* @memberof ApiKeyCreated
|
|
77
78
|
*/
|
|
78
79
|
staleModels?: Array<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Backup models in priority order, applied to every model this key calls. Null means model fallback is off (the default). If every provider for the requested model fails before the first token with a temporary error, the next entry is tried. Entries are kept when a model leaves the plan roster or the catalog and are skipped at request time; see `fallback_entries`. Not applied to Liquid.
|
|
82
|
+
* @type {Array<string>}
|
|
83
|
+
* @memberof ApiKeyCreated
|
|
84
|
+
*/
|
|
85
|
+
fallbackModels: Array<string> | null;
|
|
86
|
+
/**
|
|
87
|
+
* Present when `fallback_models` is set: one entry per backup, in order, explaining it as of now.
|
|
88
|
+
* @type {Array<ApiKeyFallbackEntry>}
|
|
89
|
+
* @memberof ApiKeyCreated
|
|
90
|
+
*/
|
|
91
|
+
fallbackEntries?: Array<ApiKeyFallbackEntry>;
|
|
92
|
+
/**
|
|
93
|
+
* The model this key requested most over the last 30 days, which `above_primary` is measured against. Present only for a key with `fallback_models` and recent usage.
|
|
94
|
+
* @type {string}
|
|
95
|
+
* @memberof ApiKeyCreated
|
|
96
|
+
*/
|
|
97
|
+
primaryModel?: string;
|
|
79
98
|
/**
|
|
80
99
|
*
|
|
81
100
|
* @type {number}
|
|
@@ -19,6 +19,7 @@ exports.ApiKeyCreatedFromJSONTyped = ApiKeyCreatedFromJSONTyped;
|
|
|
19
19
|
exports.ApiKeyCreatedToJSON = ApiKeyCreatedToJSON;
|
|
20
20
|
exports.ApiKeyCreatedToJSONTyped = ApiKeyCreatedToJSONTyped;
|
|
21
21
|
const ApiKeyScopes_1 = require("./ApiKeyScopes");
|
|
22
|
+
const ApiKeyFallbackEntry_1 = require("./ApiKeyFallbackEntry");
|
|
22
23
|
/**
|
|
23
24
|
* Check if a given object implements the ApiKeyCreated interface.
|
|
24
25
|
*/
|
|
@@ -37,6 +38,8 @@ function instanceOfApiKeyCreated(value) {
|
|
|
37
38
|
return false;
|
|
38
39
|
if ((!('allowedModels' in value) && !('allowed_models' in value)) || (value['allowedModels'] === undefined && value['allowed_models'] === undefined))
|
|
39
40
|
return false;
|
|
41
|
+
if ((!('fallbackModels' in value) && !('fallback_models' in value)) || (value['fallbackModels'] === undefined && value['fallback_models'] === undefined))
|
|
42
|
+
return false;
|
|
40
43
|
if ((!('rateLimitRps' in value) && !('rate_limit_rps' in value)) || (value['rateLimitRps'] === undefined && value['rate_limit_rps'] === undefined))
|
|
41
44
|
return false;
|
|
42
45
|
if ((!('rateLimitBurst' in value) && !('rate_limit_burst' in value)) || (value['rateLimitBurst'] === undefined && value['rate_limit_burst'] === undefined))
|
|
@@ -69,6 +72,9 @@ function ApiKeyCreatedFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
69
72
|
'budgetResetsAt': json['budget_resets_at'] == null ? undefined : (new Date(json['budget_resets_at'])),
|
|
70
73
|
'allowedModels': json['allowed_models'] == null ? null : json['allowed_models'],
|
|
71
74
|
'staleModels': json['stale_models'] == null ? undefined : json['stale_models'],
|
|
75
|
+
'fallbackModels': json['fallback_models'] == null ? null : json['fallback_models'],
|
|
76
|
+
'fallbackEntries': json['fallback_entries'] == null ? undefined : (json['fallback_entries'].map(ApiKeyFallbackEntry_1.ApiKeyFallbackEntryFromJSON)),
|
|
77
|
+
'primaryModel': json['primary_model'] == null ? undefined : json['primary_model'],
|
|
72
78
|
'rateLimitRps': json['rate_limit_rps'],
|
|
73
79
|
'rateLimitBurst': json['rate_limit_burst'],
|
|
74
80
|
'expiresAt': (json['expires_at'] == null ? null : new Date(json['expires_at'])),
|
|
@@ -96,6 +102,9 @@ function ApiKeyCreatedToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
96
102
|
'budget_resets_at': value['budgetResetsAt'] == null ? value['budgetResetsAt'] : value['budgetResetsAt'].toISOString(),
|
|
97
103
|
'allowed_models': value['allowedModels'],
|
|
98
104
|
'stale_models': value['staleModels'],
|
|
105
|
+
'fallback_models': value['fallbackModels'],
|
|
106
|
+
'fallback_entries': value['fallbackEntries'] == null ? undefined : (value['fallbackEntries'].map(ApiKeyFallbackEntry_1.ApiKeyFallbackEntryToJSON)),
|
|
107
|
+
'primary_model': value['primaryModel'],
|
|
99
108
|
'rate_limit_rps': value['rateLimitRps'],
|
|
100
109
|
'rate_limit_burst': value['rateLimitBurst'],
|
|
101
110
|
'expires_at': value['expiresAt'] == null ? value['expiresAt'] : value['expiresAt'].toISOString(),
|
|
@@ -0,0 +1,65 @@
|
|
|
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 backup model on a key, as it stands now.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ApiKeyFallbackEntry
|
|
16
|
+
*/
|
|
17
|
+
export interface ApiKeyFallbackEntry {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof ApiKeyFallbackEntry
|
|
22
|
+
*/
|
|
23
|
+
model: string;
|
|
24
|
+
/**
|
|
25
|
+
* `ok`: usable as a backup. `wallet_only`: the model is not on the subscription plan roster, so it backs up only requests billed to the wallet; a plan-covered request skips it. `unavailable`: the model is no longer in the catalog and is always skipped.
|
|
26
|
+
* @type {ApiKeyFallbackEntryStateEnum}
|
|
27
|
+
* @memberof ApiKeyFallbackEntry
|
|
28
|
+
*/
|
|
29
|
+
state: ApiKeyFallbackEntryStateEnum;
|
|
30
|
+
/**
|
|
31
|
+
* Current input price per 1M tokens, in micro-cents. 0 when unknown or unavailable.
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof ApiKeyFallbackEntry
|
|
34
|
+
*/
|
|
35
|
+
inputPer1mTokensMicrocents: number;
|
|
36
|
+
/**
|
|
37
|
+
* Current output price per 1M tokens, in micro-cents. 0 when unknown or unavailable.
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof ApiKeyFallbackEntry
|
|
40
|
+
*/
|
|
41
|
+
outputPer1mTokensMicrocents: number;
|
|
42
|
+
/**
|
|
43
|
+
* True when this backup's input plus output price is above `primary_model`'s. Pricier backups are allowed; a request served by one is billed at its own price, and the key budget is checked at that price.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @memberof ApiKeyFallbackEntry
|
|
46
|
+
*/
|
|
47
|
+
abovePrimary: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export declare const ApiKeyFallbackEntryStateEnum: {
|
|
53
|
+
readonly Ok: "ok";
|
|
54
|
+
readonly WalletOnly: "wallet_only";
|
|
55
|
+
readonly Unavailable: "unavailable";
|
|
56
|
+
};
|
|
57
|
+
export type ApiKeyFallbackEntryStateEnum = typeof ApiKeyFallbackEntryStateEnum[keyof typeof ApiKeyFallbackEntryStateEnum];
|
|
58
|
+
/**
|
|
59
|
+
* Check if a given object implements the ApiKeyFallbackEntry interface.
|
|
60
|
+
*/
|
|
61
|
+
export declare function instanceOfApiKeyFallbackEntry(value: object): value is ApiKeyFallbackEntry;
|
|
62
|
+
export declare function ApiKeyFallbackEntryFromJSON(json: any): ApiKeyFallbackEntry;
|
|
63
|
+
export declare function ApiKeyFallbackEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKeyFallbackEntry;
|
|
64
|
+
export declare function ApiKeyFallbackEntryToJSON(json: any): ApiKeyFallbackEntry;
|
|
65
|
+
export declare function ApiKeyFallbackEntryToJSONTyped(value?: ApiKeyFallbackEntry | 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.ApiKeyFallbackEntryStateEnum = void 0;
|
|
17
|
+
exports.instanceOfApiKeyFallbackEntry = instanceOfApiKeyFallbackEntry;
|
|
18
|
+
exports.ApiKeyFallbackEntryFromJSON = ApiKeyFallbackEntryFromJSON;
|
|
19
|
+
exports.ApiKeyFallbackEntryFromJSONTyped = ApiKeyFallbackEntryFromJSONTyped;
|
|
20
|
+
exports.ApiKeyFallbackEntryToJSON = ApiKeyFallbackEntryToJSON;
|
|
21
|
+
exports.ApiKeyFallbackEntryToJSONTyped = ApiKeyFallbackEntryToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.ApiKeyFallbackEntryStateEnum = {
|
|
26
|
+
Ok: 'ok',
|
|
27
|
+
WalletOnly: 'wallet_only',
|
|
28
|
+
Unavailable: 'unavailable'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the ApiKeyFallbackEntry interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfApiKeyFallbackEntry(value) {
|
|
34
|
+
if (!('model' in value) || value['model'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (!('state' in value) || value['state'] === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
if ((!('inputPer1mTokensMicrocents' in value) && !('input_per_1m_tokens_microcents' in value)) || (value['inputPer1mTokensMicrocents'] === undefined && value['input_per_1m_tokens_microcents'] === undefined))
|
|
39
|
+
return false;
|
|
40
|
+
if ((!('outputPer1mTokensMicrocents' in value) && !('output_per_1m_tokens_microcents' in value)) || (value['outputPer1mTokensMicrocents'] === undefined && value['output_per_1m_tokens_microcents'] === undefined))
|
|
41
|
+
return false;
|
|
42
|
+
if ((!('abovePrimary' in value) && !('above_primary' in value)) || (value['abovePrimary'] === undefined && value['above_primary'] === undefined))
|
|
43
|
+
return false;
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
function ApiKeyFallbackEntryFromJSON(json) {
|
|
47
|
+
return ApiKeyFallbackEntryFromJSONTyped(json, false);
|
|
48
|
+
}
|
|
49
|
+
function ApiKeyFallbackEntryFromJSONTyped(json, ignoreDiscriminator) {
|
|
50
|
+
if (json == null) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
'model': json['model'],
|
|
55
|
+
'state': json['state'],
|
|
56
|
+
'inputPer1mTokensMicrocents': json['input_per_1m_tokens_microcents'],
|
|
57
|
+
'outputPer1mTokensMicrocents': json['output_per_1m_tokens_microcents'],
|
|
58
|
+
'abovePrimary': json['above_primary'],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function ApiKeyFallbackEntryToJSON(json) {
|
|
62
|
+
return ApiKeyFallbackEntryToJSONTyped(json, false);
|
|
63
|
+
}
|
|
64
|
+
function ApiKeyFallbackEntryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
'model': value['model'],
|
|
70
|
+
'state': value['state'],
|
|
71
|
+
'input_per_1m_tokens_microcents': value['inputPer1mTokensMicrocents'],
|
|
72
|
+
'output_per_1m_tokens_microcents': value['outputPer1mTokensMicrocents'],
|
|
73
|
+
'above_primary': value['abovePrimary'],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
* Send only the fields to change. `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed.
|
|
13
|
+
* Send only the fields to change. `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed.
|
|
14
14
|
* @export
|
|
15
15
|
* @interface ApiKeyUpdate
|
|
16
16
|
*/
|
|
@@ -33,6 +33,12 @@ export interface ApiKeyUpdate {
|
|
|
33
33
|
* @memberof ApiKeyUpdate
|
|
34
34
|
*/
|
|
35
35
|
allowedModels?: Array<string> | null;
|
|
36
|
+
/**
|
|
37
|
+
* Replace the backup list (priority order), or `null` to turn model fallback off. Same rules as on create, judged against the key's allowlist after this update. An empty array is a 422 `validation_failed`; send `null` instead.
|
|
38
|
+
* @type {Array<string>}
|
|
39
|
+
* @memberof ApiKeyUpdate
|
|
40
|
+
*/
|
|
41
|
+
fallbackModels?: Array<string> | null;
|
|
36
42
|
/**
|
|
37
43
|
*
|
|
38
44
|
* @type {number}
|
|
@@ -35,6 +35,7 @@ function ApiKeyUpdateFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
35
35
|
'name': json['name'] == null ? undefined : json['name'],
|
|
36
36
|
'budgetCents': json['budget_cents'] === undefined ? undefined : json['budget_cents'] === null ? null : json['budget_cents'],
|
|
37
37
|
'allowedModels': json['allowed_models'] === undefined ? undefined : json['allowed_models'] === null ? null : json['allowed_models'],
|
|
38
|
+
'fallbackModels': json['fallback_models'] === undefined ? undefined : json['fallback_models'] === null ? null : json['fallback_models'],
|
|
38
39
|
'rateLimitRps': json['rate_limit_rps'] == null ? undefined : json['rate_limit_rps'],
|
|
39
40
|
'rateLimitBurst': json['rate_limit_burst'] == null ? undefined : json['rate_limit_burst'],
|
|
40
41
|
'expiresAt': json['expires_at'] === undefined ? undefined : json['expires_at'] === null ? null : (new Date(json['expires_at'])),
|
|
@@ -51,6 +52,7 @@ function ApiKeyUpdateToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
51
52
|
'name': value['name'],
|
|
52
53
|
'budget_cents': value['budgetCents'],
|
|
53
54
|
'allowed_models': value['allowedModels'],
|
|
55
|
+
'fallback_models': value['fallbackModels'],
|
|
54
56
|
'rate_limit_rps': value['rateLimitRps'],
|
|
55
57
|
'rate_limit_burst': value['rateLimitBurst'],
|
|
56
58
|
'expires_at': value['expiresAt'] == null ? value['expiresAt'] : value['expiresAt'].toISOString(),
|
|
@@ -26,6 +26,12 @@ export interface ChatCompletionRequest {
|
|
|
26
26
|
* @memberof ChatCompletionRequest
|
|
27
27
|
*/
|
|
28
28
|
model: string;
|
|
29
|
+
/**
|
|
30
|
+
* OpenRouter-compatible backup models for this request. `model` is the requested model and `models` lists the backups in priority order; when `model` is empty, the first entry of `models` is the requested model. An entry naming the requested model is ignored. At most 3 backups. The list replaces the API key's `fallback_models` for this request, and an empty array turns model fallback off for this request. Each backup must still pass the key's model allowlist, the request's billing mode and its capability needs, or it is skipped. Sending both `models` and the X-Deeprelay-Fallback-Models header is a 400 `invalid_request`. Chat completions only; on `/messages` and `/responses` use the header.
|
|
31
|
+
* @type {Array<string>}
|
|
32
|
+
* @memberof ChatCompletionRequest
|
|
33
|
+
*/
|
|
34
|
+
models?: Array<string> | null;
|
|
29
35
|
/**
|
|
30
36
|
*
|
|
31
37
|
* @type {Array<ChatMessage>}
|
|
@@ -42,6 +42,7 @@ function ChatCompletionRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
'model': json['model'],
|
|
45
|
+
'models': json['models'] === undefined ? undefined : json['models'] === null ? null : json['models'],
|
|
45
46
|
'messages': (json['messages'].map(ChatMessage_1.ChatMessageFromJSON)),
|
|
46
47
|
'temperature': json['temperature'] == null ? undefined : json['temperature'],
|
|
47
48
|
'maxTokens': json['max_tokens'] == null ? undefined : json['max_tokens'],
|
|
@@ -69,6 +70,7 @@ function ChatCompletionRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
69
70
|
}
|
|
70
71
|
return {
|
|
71
72
|
'model': value['model'],
|
|
73
|
+
'models': value['models'],
|
|
72
74
|
'messages': (value['messages'].map(ChatMessage_1.ChatMessageToJSON)),
|
|
73
75
|
'temperature': value['temperature'],
|
|
74
76
|
'max_tokens': value['maxTokens'],
|
|
@@ -42,6 +42,7 @@ export declare const CreateWebhookEndpointRequestEventTypesEnum: {
|
|
|
42
42
|
readonly SubscriptionQuotaThreshold: "subscription_quota.threshold";
|
|
43
43
|
readonly ApiKeyBudgetThreshold: "api_key_budget.threshold";
|
|
44
44
|
readonly MemberSpendThreshold: "member_spend.threshold";
|
|
45
|
+
readonly PlanRosterModelRemoved: "plan_roster.model_removed";
|
|
45
46
|
};
|
|
46
47
|
export type CreateWebhookEndpointRequestEventTypesEnum = typeof CreateWebhookEndpointRequestEventTypesEnum[keyof typeof CreateWebhookEndpointRequestEventTypesEnum];
|
|
47
48
|
/**
|
|
@@ -32,7 +32,8 @@ exports.CreateWebhookEndpointRequestEventTypesEnum = {
|
|
|
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 CreateWebhookEndpointRequest interface.
|
|
@@ -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.2' }, 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,
|