@onlist/sdk 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -2
- package/dist/index.cjs +276 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +401 -11
- package/dist/index.d.ts +401 -11
- package/dist/index.js +266 -37
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,370 @@
|
|
|
1
1
|
import OpenAI, { ClientOptions } from 'openai';
|
|
2
2
|
|
|
3
|
+
/** Shared options for the REST resources (marketplace and account). */
|
|
4
|
+
interface RequestOptions {
|
|
5
|
+
apiKey?: string | null;
|
|
6
|
+
baseURL: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
/** Maximum retry attempts for failed requests. Defaults to 2. */
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Response types for the account API (`/api/v1/*`).
|
|
14
|
+
*
|
|
15
|
+
* Field names mirror the wire format one-for-one, which is OpenRouter's, so
|
|
16
|
+
* code written against OpenRouter's responses reads the same fields here.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The deprecated per-key rate limit descriptor on {@link CurrentKey}.
|
|
20
|
+
*
|
|
21
|
+
* Onlist has no per-key request-rate limit — only spend budgets — so
|
|
22
|
+
* `requests` is always `-1`. Do not use it to drive client-side throttling.
|
|
23
|
+
*/
|
|
24
|
+
interface RateLimit {
|
|
25
|
+
requests: number;
|
|
26
|
+
interval: string;
|
|
27
|
+
note: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An inference key (`sk-...`) as returned by the `apiKeys` resource.
|
|
31
|
+
*
|
|
32
|
+
* `limit`, `limit_remaining` and `limit_reset` move together: either all
|
|
33
|
+
* three are set, or all three are `null` (no spend budget). Amounts are USD.
|
|
34
|
+
* `created_at` / `expires_at` are RFC 3339 UTC strings, or `null` for
|
|
35
|
+
* "never".
|
|
36
|
+
*/
|
|
37
|
+
interface APIKey {
|
|
38
|
+
hash: string;
|
|
39
|
+
name: string;
|
|
40
|
+
label: string;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
limit: number | null;
|
|
43
|
+
limit_remaining: number | null;
|
|
44
|
+
limit_reset: string | null;
|
|
45
|
+
include_byok_in_limit: boolean;
|
|
46
|
+
usage: number;
|
|
47
|
+
usage_daily: number;
|
|
48
|
+
usage_weekly: number;
|
|
49
|
+
usage_monthly: number;
|
|
50
|
+
byok_usage: number;
|
|
51
|
+
byok_usage_daily: number;
|
|
52
|
+
byok_usage_weekly: number;
|
|
53
|
+
byok_usage_monthly: number;
|
|
54
|
+
created_at: string | null;
|
|
55
|
+
updated_at: string | null;
|
|
56
|
+
expires_at: string | null;
|
|
57
|
+
external_user: string | null;
|
|
58
|
+
creator_user_id: string | null;
|
|
59
|
+
workspace_id: string | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The credential used for the request, from `apiKeys.current()`.
|
|
63
|
+
*
|
|
64
|
+
* Every field is optional because the endpoint answers for both credential
|
|
65
|
+
* types and they carry different information: a management key has no usage
|
|
66
|
+
* and no budget (reporting `0` would read as "an inference key that has
|
|
67
|
+
* never spent"), so those fields are simply absent from its projection.
|
|
68
|
+
* Branch on `is_management_key`.
|
|
69
|
+
*/
|
|
70
|
+
interface CurrentKey extends Partial<APIKey> {
|
|
71
|
+
is_free_tier?: boolean;
|
|
72
|
+
is_management_key?: boolean;
|
|
73
|
+
is_provisioning_key?: boolean;
|
|
74
|
+
rate_limit?: RateLimit;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The result of `apiKeys.create()`.
|
|
78
|
+
*
|
|
79
|
+
* `key` is the full secret in plaintext and is returned **only here, only
|
|
80
|
+
* once** — the server keeps a hash. Store it before discarding this object.
|
|
81
|
+
* `data` is the same key object later reads return.
|
|
82
|
+
*/
|
|
83
|
+
interface CreatedKey {
|
|
84
|
+
key: string;
|
|
85
|
+
data: APIKey;
|
|
86
|
+
}
|
|
87
|
+
/** Parameters for `apiKeys.create()`. */
|
|
88
|
+
interface CreateKeyParams {
|
|
89
|
+
/** Spend budget in USD. Omit for no budget. */
|
|
90
|
+
limit?: number;
|
|
91
|
+
/** `"daily"`, `"weekly"`, or omitted for a lifetime total. `"monthly"` is rejected. */
|
|
92
|
+
limit_reset?: string;
|
|
93
|
+
/** Expiry as a Unix timestamp. Omit to never expire. */
|
|
94
|
+
expires_at?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Patch for `apiKeys.update()`.
|
|
98
|
+
*
|
|
99
|
+
* Three states: an omitted (or `undefined`) field is left unchanged, and an
|
|
100
|
+
* explicit `null` clears the value. `name` and `disabled` therefore accept
|
|
101
|
+
* no `null` — the server reads `{"name": null}` as an empty name (400) and
|
|
102
|
+
* `{"disabled": null}` as `false`, which would silently re-enable a key you
|
|
103
|
+
* only meant to leave alone.
|
|
104
|
+
*/
|
|
105
|
+
interface UpdateKeyParams {
|
|
106
|
+
name?: string;
|
|
107
|
+
disabled?: boolean;
|
|
108
|
+
limit?: number | null;
|
|
109
|
+
limit_reset?: string | null;
|
|
110
|
+
expires_at?: number | null;
|
|
111
|
+
}
|
|
112
|
+
/** Parameters for `apiKeys.list()`. */
|
|
113
|
+
interface ListKeysParams {
|
|
114
|
+
/** Number of keys to skip. Pages are a fixed 100 and no total is returned. */
|
|
115
|
+
offset?: number;
|
|
116
|
+
/** Include disabled keys in the result. */
|
|
117
|
+
include_disabled?: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Account balance, in USD.
|
|
121
|
+
*
|
|
122
|
+
* Remaining balance is `total_credits - total_usage`: the endpoint reports
|
|
123
|
+
* lifetime totals rather than a single "balance" number, matching
|
|
124
|
+
* OpenRouter.
|
|
125
|
+
*/
|
|
126
|
+
interface Credits {
|
|
127
|
+
total_credits: number;
|
|
128
|
+
total_usage: number;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Cost and timing for a single completed call, from `generations.get()`.
|
|
132
|
+
*
|
|
133
|
+
* Fields Onlist has no data for are `null` rather than `0`: `upstream_id`,
|
|
134
|
+
* `http_referer`, `user_agent`, `origin`, `api_type`, `cache_discount` and
|
|
135
|
+
* `native_tokens_reasoning`. For reconciliation, "not measured" and
|
|
136
|
+
* "measured as zero" are different statements.
|
|
137
|
+
*
|
|
138
|
+
* `latency` is time-to-first-token in milliseconds and is `null` for
|
|
139
|
+
* non-streamed calls, which never measure it. `generation_time` is total
|
|
140
|
+
* wall time in milliseconds. `total_cost` and `usage` are the same USD
|
|
141
|
+
* amount under both of OpenRouter's names.
|
|
142
|
+
*/
|
|
143
|
+
interface Generation {
|
|
144
|
+
id: string;
|
|
145
|
+
model: string;
|
|
146
|
+
provider_name: string | null;
|
|
147
|
+
streamed: boolean;
|
|
148
|
+
latency: number | null;
|
|
149
|
+
generation_time: number;
|
|
150
|
+
created_at: string | null;
|
|
151
|
+
tokens_prompt: number;
|
|
152
|
+
tokens_completion: number;
|
|
153
|
+
native_tokens_prompt: number;
|
|
154
|
+
native_tokens_completion: number;
|
|
155
|
+
native_tokens_cached: number | null;
|
|
156
|
+
native_tokens_reasoning: number | null;
|
|
157
|
+
total_cost: number;
|
|
158
|
+
usage: number;
|
|
159
|
+
cache_discount: number | null;
|
|
160
|
+
finish_reason: string | null;
|
|
161
|
+
native_finish_reason: string | null;
|
|
162
|
+
is_byok: boolean;
|
|
163
|
+
upstream_id: string | null;
|
|
164
|
+
http_referer: string | null;
|
|
165
|
+
user_agent: string | null;
|
|
166
|
+
origin: string | null;
|
|
167
|
+
api_type: string | null;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* One day × model × provider bucket from `activity.list()`.
|
|
171
|
+
*
|
|
172
|
+
* `date` is a `YYYY-MM-DD` UTC day and `usage` is USD. Only complete days
|
|
173
|
+
* appear — today is still accumulating, and this endpoint exists for
|
|
174
|
+
* reconciliation.
|
|
175
|
+
*/
|
|
176
|
+
interface ActivityRow {
|
|
177
|
+
date: string;
|
|
178
|
+
model: string;
|
|
179
|
+
model_permaslug: string;
|
|
180
|
+
endpoint_id: string;
|
|
181
|
+
provider_name: string | null;
|
|
182
|
+
usage: number;
|
|
183
|
+
byok_usage_inference: number;
|
|
184
|
+
requests: number;
|
|
185
|
+
prompt_tokens: number;
|
|
186
|
+
completion_tokens: number;
|
|
187
|
+
reasoning_tokens: number;
|
|
188
|
+
}
|
|
189
|
+
/** Parameters for `activity.list()`. */
|
|
190
|
+
interface ActivityParams {
|
|
191
|
+
/** Restrict to one `YYYY-MM-DD` UTC day inside the 30-day window. */
|
|
192
|
+
date?: string;
|
|
193
|
+
/** Restrict to one inference key. A hash from another account yields an empty list. */
|
|
194
|
+
api_key_hash?: string;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The result of `oauth.exchange()`.
|
|
198
|
+
*
|
|
199
|
+
* `key` is a new inference key in plaintext, returned once. `user_id` is
|
|
200
|
+
* always `null` on Onlist: on OpenRouter it carries the calling
|
|
201
|
+
* application's own external user identifier, which Onlist has no concept
|
|
202
|
+
* of.
|
|
203
|
+
*/
|
|
204
|
+
interface ExchangedKey {
|
|
205
|
+
key: string;
|
|
206
|
+
user_id: string | null;
|
|
207
|
+
}
|
|
208
|
+
/** An S256 PKCE pair from `generatePkce()`. */
|
|
209
|
+
interface PkcePair {
|
|
210
|
+
/** Kept in memory and passed back to `oauth.exchange()`. */
|
|
211
|
+
verifier: string;
|
|
212
|
+
/** Sent to `/auth` when opening the browser flow. */
|
|
213
|
+
challenge: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Account resources — the OpenRouter-compatible `/api/v1/*` face.
|
|
218
|
+
*
|
|
219
|
+
* Namespaces follow the wire path segments (`credits`, `generations`,
|
|
220
|
+
* `apiKeys`, `activity`) and methods use a fixed verb set
|
|
221
|
+
* (`list`/`get`/`create`/`update`/`delete`). Two departures, both forced:
|
|
222
|
+
* `GET /api/v1/key` has no matching verb so it is `apiKeys.current()`, and
|
|
223
|
+
* `/api/v1/auth/*` would read as client authentication config so the
|
|
224
|
+
* namespace is `oauth`.
|
|
225
|
+
*
|
|
226
|
+
* Most of these endpoints require a **management key** (`mgmt_...`). The SDK
|
|
227
|
+
* does not inspect key prefixes locally — it sends whatever credential it
|
|
228
|
+
* was given and surfaces the server's 403 as `PermissionDeniedError`.
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
/** Options for creating the account resources. */
|
|
232
|
+
type AccountOptions = RequestOptions;
|
|
233
|
+
/**
|
|
234
|
+
* Generate an S256 PKCE `{verifier, challenge}` pair.
|
|
235
|
+
*
|
|
236
|
+
* Send the challenge to `/auth` when starting the browser flow, keep the
|
|
237
|
+
* verifier in memory, and pass it back to `oauth.exchange()`:
|
|
238
|
+
*
|
|
239
|
+
* ```typescript
|
|
240
|
+
* const { verifier, challenge } = await generatePkce();
|
|
241
|
+
* window.location.href =
|
|
242
|
+
* `https://onlist.io/auth?callback_url=${cb}` +
|
|
243
|
+
* `&code_challenge=${challenge}&code_challenge_method=S256`;
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
declare function generatePkce(): Promise<PkcePair>;
|
|
247
|
+
/**
|
|
248
|
+
* Exchange a PKCE authorization code for an inference key, with no client.
|
|
249
|
+
*
|
|
250
|
+
* `client.oauth.exchange()` does the same thing, but constructing an
|
|
251
|
+
* {@link Onlist} requires an API key — and an app running the "Sign in with
|
|
252
|
+
* Onlist" flow does not have one yet. That is the entire point of the flow,
|
|
253
|
+
* so it gets a credential-free entry point:
|
|
254
|
+
*
|
|
255
|
+
* ```typescript
|
|
256
|
+
* const { verifier, challenge } = await generatePkce();
|
|
257
|
+
* // ...user approves in the browser, your callback receives ?code=...
|
|
258
|
+
* const result = await exchangeAuthCode(code, { codeVerifier: verifier });
|
|
259
|
+
* const client = new Onlist({ apiKey: result.key });
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* Single-use: the code is consumed even when the verifier turns out to be
|
|
263
|
+
* wrong, so a failure means restarting the browser flow.
|
|
264
|
+
*/
|
|
265
|
+
declare function exchangeAuthCode(code: string, opts?: {
|
|
266
|
+
codeVerifier?: string;
|
|
267
|
+
baseURL?: string;
|
|
268
|
+
timeout?: number;
|
|
269
|
+
}): Promise<ExchangedKey>;
|
|
270
|
+
/** Account balance. Requires a management key. */
|
|
271
|
+
declare class AccountCredits {
|
|
272
|
+
private readonly _opts;
|
|
273
|
+
constructor(_opts: AccountOptions);
|
|
274
|
+
/** Get lifetime credits purchased and credits used, in USD. */
|
|
275
|
+
get(): Promise<Credits>;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Per-call cost and timing.
|
|
279
|
+
*
|
|
280
|
+
* Accepts either credential type: an inference key can look up only the
|
|
281
|
+
* calls it made, a management key any call on the account.
|
|
282
|
+
*/
|
|
283
|
+
declare class AccountGenerations {
|
|
284
|
+
private readonly _opts;
|
|
285
|
+
constructor(_opts: AccountOptions);
|
|
286
|
+
/**
|
|
287
|
+
* Look up one call by request ID.
|
|
288
|
+
*
|
|
289
|
+
* @param requestId The value of the `X-Oneapi-Request-Id` response header
|
|
290
|
+
* from the original call.
|
|
291
|
+
*/
|
|
292
|
+
get(requestId: string): Promise<Generation>;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Manage inference keys (`sk-...`). Requires a management key.
|
|
296
|
+
*
|
|
297
|
+
* The exception is {@link current}, which answers for whichever credential
|
|
298
|
+
* made the request.
|
|
299
|
+
*/
|
|
300
|
+
declare class AccountApiKeys {
|
|
301
|
+
private readonly _opts;
|
|
302
|
+
constructor(_opts: AccountOptions);
|
|
303
|
+
/** Describe the credential this client is using. */
|
|
304
|
+
current(): Promise<CurrentKey>;
|
|
305
|
+
/**
|
|
306
|
+
* List inference keys.
|
|
307
|
+
*
|
|
308
|
+
* Pages are a fixed 100 keys and no total is returned: request
|
|
309
|
+
* `offset += 100` until you get a short page.
|
|
310
|
+
*/
|
|
311
|
+
list(params?: ListKeysParams): Promise<APIKey[]>;
|
|
312
|
+
/**
|
|
313
|
+
* Create an inference key.
|
|
314
|
+
*
|
|
315
|
+
* The plaintext secret is on `.key` of the result and is never retrievable
|
|
316
|
+
* again.
|
|
317
|
+
*
|
|
318
|
+
* @param name Display name for the key. Required.
|
|
319
|
+
*/
|
|
320
|
+
create(name: string, params?: CreateKeyParams): Promise<CreatedKey>;
|
|
321
|
+
/** Get one inference key by its `hash`. */
|
|
322
|
+
get(hash: string): Promise<APIKey>;
|
|
323
|
+
/**
|
|
324
|
+
* Update an inference key. Omitted fields are left unchanged.
|
|
325
|
+
*
|
|
326
|
+
* For `limit`, `limit_reset` and `expires_at`, passing `null` clears the
|
|
327
|
+
* value; leaving the field out leaves it alone.
|
|
328
|
+
*/
|
|
329
|
+
update(hash: string, patch: UpdateKeyParams): Promise<APIKey>;
|
|
330
|
+
/** Delete an inference key. Resolves to `true` on success. */
|
|
331
|
+
delete(hash: string): Promise<boolean>;
|
|
332
|
+
}
|
|
333
|
+
/** Daily usage rollups. Requires a management key. */
|
|
334
|
+
declare class AccountActivity {
|
|
335
|
+
private readonly _opts;
|
|
336
|
+
constructor(_opts: AccountOptions);
|
|
337
|
+
/**
|
|
338
|
+
* List usage grouped by day, model and provider.
|
|
339
|
+
*
|
|
340
|
+
* Covers the last 30 complete UTC days; today is excluded.
|
|
341
|
+
*/
|
|
342
|
+
list(params?: ActivityParams): Promise<ActivityRow[]>;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Sign in with Onlist — the PKCE authorization-code exchange.
|
|
346
|
+
*
|
|
347
|
+
* Only the exchange lives here. The authorization step itself happens in the
|
|
348
|
+
* user's browser at `https://onlist.io/auth`; there is no SDK call for it,
|
|
349
|
+
* because the SDK has no session to authorize with.
|
|
350
|
+
*/
|
|
351
|
+
declare class AccountOAuth {
|
|
352
|
+
private readonly _opts;
|
|
353
|
+
constructor(_opts: AccountOptions);
|
|
354
|
+
/**
|
|
355
|
+
* Exchange an authorization code for a new inference key.
|
|
356
|
+
*
|
|
357
|
+
* Unauthenticated, and single-use: the code is consumed even when the
|
|
358
|
+
* verifier turns out to be wrong, so a failure means restarting the
|
|
359
|
+
* browser flow.
|
|
360
|
+
*
|
|
361
|
+
* @param code The `code` query parameter from the callback URL.
|
|
362
|
+
* @param codeVerifier The verifier from {@link generatePkce}. Required
|
|
363
|
+
* whenever the authorization request carried a challenge.
|
|
364
|
+
*/
|
|
365
|
+
exchange(code: string, codeVerifier?: string): Promise<ExchangedKey>;
|
|
366
|
+
}
|
|
367
|
+
|
|
3
368
|
/** Model pricing in USD per million tokens. */
|
|
4
369
|
interface Pricing {
|
|
5
370
|
prompt: string;
|
|
@@ -164,13 +529,7 @@ interface AppRankingsParams {
|
|
|
164
529
|
}
|
|
165
530
|
|
|
166
531
|
/** Options for creating a Marketplace client. */
|
|
167
|
-
|
|
168
|
-
apiKey?: string | null;
|
|
169
|
-
baseURL: string;
|
|
170
|
-
timeout?: number;
|
|
171
|
-
/** Maximum retry attempts for failed requests. Defaults to 2. */
|
|
172
|
-
maxRetries?: number;
|
|
173
|
-
}
|
|
532
|
+
type MarketplaceOptions = RequestOptions;
|
|
174
533
|
/** Access to marketplace model data. */
|
|
175
534
|
declare class MarketplaceModels {
|
|
176
535
|
private readonly _opts;
|
|
@@ -220,15 +579,32 @@ declare class Marketplace {
|
|
|
220
579
|
interface OnlistOptions extends Omit<ClientOptions, "apiKey" | "baseURL"> {
|
|
221
580
|
/** API key. Falls back to ONLIST_API_KEY then OPENAI_API_KEY env vars. */
|
|
222
581
|
apiKey?: string | null;
|
|
582
|
+
/**
|
|
583
|
+
* Management key (`mgmt_...`) for the account API. Falls back to
|
|
584
|
+
* ONLIST_MANAGEMENT_KEY, then to the API key.
|
|
585
|
+
*/
|
|
586
|
+
managementKey?: string | null;
|
|
223
587
|
/** Base URL for the API. Defaults to https://onlist.io/v1. */
|
|
224
588
|
baseURL?: string | null;
|
|
225
|
-
/** Maximum retry attempts for marketplace API calls. Defaults to 2. */
|
|
589
|
+
/** Maximum retry attempts for marketplace and account API calls. Defaults to 2. */
|
|
226
590
|
maxRetries?: number;
|
|
227
591
|
}
|
|
228
|
-
/** Onlist API client, extending the OpenAI SDK with marketplace features. */
|
|
592
|
+
/** Onlist API client, extending the OpenAI SDK with marketplace and account features. */
|
|
229
593
|
declare class Onlist extends OpenAI {
|
|
230
594
|
/** Access to marketplace data: models, providers, and rankings. */
|
|
231
595
|
readonly marketplace: Marketplace;
|
|
596
|
+
/** Account balance. */
|
|
597
|
+
readonly credits: AccountCredits;
|
|
598
|
+
/** Cost and timing for individual calls. */
|
|
599
|
+
readonly generations: AccountGenerations;
|
|
600
|
+
/** Inference key management. */
|
|
601
|
+
readonly apiKeys: AccountApiKeys;
|
|
602
|
+
/** Daily usage rollups. */
|
|
603
|
+
readonly activity: AccountActivity;
|
|
604
|
+
/** Sign in with Onlist — the PKCE code exchange. */
|
|
605
|
+
readonly oauth: AccountOAuth;
|
|
606
|
+
/** The credential the account API is using. */
|
|
607
|
+
readonly managementKey: string | undefined;
|
|
232
608
|
constructor(opts?: OnlistOptions);
|
|
233
609
|
}
|
|
234
610
|
|
|
@@ -271,6 +647,20 @@ declare class ProviderError extends APIError {
|
|
|
271
647
|
declare class NotFoundError extends APIError {
|
|
272
648
|
constructor(message?: string, opts?: Partial<ConstructorParameters<typeof APIError>[1]>);
|
|
273
649
|
}
|
|
650
|
+
/** Error thrown when the request is malformed or its parameters are rejected. */
|
|
651
|
+
declare class BadRequestError extends APIError {
|
|
652
|
+
constructor(message?: string, opts?: Partial<ConstructorParameters<typeof APIError>[1]>);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Error thrown when the credential is valid but not allowed here.
|
|
656
|
+
*
|
|
657
|
+
* Most commonly: an inference key (`sk-...`) was used on an endpoint that
|
|
658
|
+
* only accepts a management key (`mgmt_...`). The server's message is passed
|
|
659
|
+
* through unchanged.
|
|
660
|
+
*/
|
|
661
|
+
declare class PermissionDeniedError extends APIError {
|
|
662
|
+
constructor(message?: string, opts?: Partial<ConstructorParameters<typeof APIError>[1]>);
|
|
663
|
+
}
|
|
274
664
|
|
|
275
665
|
/** Maximum price limits per token type (USD per million tokens). */
|
|
276
666
|
interface MaxPrice {
|
|
@@ -295,6 +685,6 @@ declare module "openai/resources/chat/completions/completions" {
|
|
|
295
685
|
}
|
|
296
686
|
}
|
|
297
687
|
|
|
298
|
-
declare const VERSION = "0.
|
|
688
|
+
declare const VERSION = "0.3.0";
|
|
299
689
|
|
|
300
|
-
export { APIError, type AppRanking, type AppRankingsParams, type AppRankingsResponse, type Architecture, AuthenticationError, InsufficientBalanceError, Marketplace, MarketplaceModels, type MarketplaceOptions, MarketplaceProviders, MarketplaceRankings, type MaxPrice, type Model, type ModelDetail, type ModelListResponse, type ModelRanking, type ModelRankingsParams, type ModelRankingsResponse, type ModelSeriesPoint, NotFoundError, Onlist, OnlistError, type OnlistOptions, type Pricing, type Provider, type ProviderDetail, ProviderError, type ProviderListResponse, type ProviderOffer, type ProviderRouting, RateLimitError, type TopProvider, VERSION };
|
|
690
|
+
export { APIError, type APIKey, AccountActivity, AccountApiKeys, AccountCredits, AccountGenerations, AccountOAuth, type AccountOptions, type ActivityParams, type ActivityRow, type AppRanking, type AppRankingsParams, type AppRankingsResponse, type Architecture, AuthenticationError, BadRequestError, type CreateKeyParams, type CreatedKey, type Credits, type CurrentKey, type ExchangedKey, type Generation, InsufficientBalanceError, type ListKeysParams, Marketplace, MarketplaceModels, type MarketplaceOptions, MarketplaceProviders, MarketplaceRankings, type MaxPrice, type Model, type ModelDetail, type ModelListResponse, type ModelRanking, type ModelRankingsParams, type ModelRankingsResponse, type ModelSeriesPoint, NotFoundError, Onlist, OnlistError, type OnlistOptions, PermissionDeniedError, type PkcePair, type Pricing, type Provider, type ProviderDetail, ProviderError, type ProviderListResponse, type ProviderOffer, type ProviderRouting, type RateLimit, RateLimitError, type TopProvider, type UpdateKeyParams, VERSION, exchangeAuthCode, generatePkce };
|