@openrouter/sdk 1.2.95 → 1.2.97
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/esm/funcs/apiKeysCreate.d.ts +1 -1
- package/esm/funcs/apiKeysCreate.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/openroutermetadata.d.ts +4 -0
- package/esm/models/openroutermetadata.js +2 -0
- package/esm/models/operations/createkeys.d.ts +0 -10
- package/esm/models/operations/createkeys.js +0 -4
- package/esm/sdk/apikeys.d.ts +1 -1
- package/esm/sdk/apikeys.js +1 -1
- package/jsr.json +1 -1
- package/package.json +6 -6
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Create a new API key
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
15
|
+
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
16
16
|
*/
|
|
17
17
|
export declare function apiKeysCreate(client: OpenRouterCore, request: operations.CreateKeysRequest, options?: RequestOptions): APIPromise<Result<operations.CreateKeysResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=apiKeysCreate.d.ts.map
|
|
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
16
16
|
* Create a new API key
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
19
|
+
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
20
20
|
*/
|
|
21
21
|
export function apiKeysCreate(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.2.
|
|
53
|
+
readonly sdkVersion: "1.2.97";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.97 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.2.
|
|
32
|
+
sdkVersion: "1.2.97",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.97 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -10,6 +10,10 @@ export type OpenRouterMetadata = {
|
|
|
10
10
|
attempt: number;
|
|
11
11
|
attempts?: Array<RouterAttempt> | undefined;
|
|
12
12
|
endpoints: EndpointsMetadata;
|
|
13
|
+
/**
|
|
14
|
+
* Milliseconds measured for the generation, from dispatching the upstream request until its response body ended. Divide the completion token count by this for throughput. Absent when no upstream request was dispatched.
|
|
15
|
+
*/
|
|
16
|
+
generationTime?: number | undefined;
|
|
13
17
|
isByok: boolean;
|
|
14
18
|
params?: RouterParams | undefined;
|
|
15
19
|
pipeline?: Array<PipelineStage> | undefined;
|
|
@@ -15,6 +15,7 @@ export const OpenRouterMetadata$inboundSchema = z.object({
|
|
|
15
15
|
attempt: z.int(),
|
|
16
16
|
attempts: z.array(RouterAttempt$inboundSchema).optional(),
|
|
17
17
|
endpoints: EndpointsMetadata$inboundSchema,
|
|
18
|
+
generation_time: z.int().optional(),
|
|
18
19
|
is_byok: z.boolean(),
|
|
19
20
|
params: RouterParams$inboundSchema.optional(),
|
|
20
21
|
pipeline: z.array(PipelineStage$inboundSchema).optional(),
|
|
@@ -24,6 +25,7 @@ export const OpenRouterMetadata$inboundSchema = z.object({
|
|
|
24
25
|
summary: z.string(),
|
|
25
26
|
}).transform((v) => {
|
|
26
27
|
return remap$(v, {
|
|
28
|
+
"generation_time": "generationTime",
|
|
27
29
|
"is_byok": "isByok",
|
|
28
30
|
});
|
|
29
31
|
});
|
|
@@ -44,14 +44,6 @@ export type CreateKeysRequestBody = {
|
|
|
44
44
|
* Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.
|
|
45
45
|
*/
|
|
46
46
|
expiresAt?: Date | null | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Optional partner-supplied API key. Stored as a SHA-256 hash and never returned. Accepted only when authenticating with a Connect client secret; supplying it with a management key is rejected with 403.
|
|
49
|
-
*/
|
|
50
|
-
externalApiKey?: string | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Partner's end-user identifier for attribution, between 1 and 512 characters. Accepted only when authenticating with a Connect client secret, where it is required; supplying it with a management key is rejected with 403.
|
|
53
|
-
*/
|
|
54
|
-
externalUser?: string | undefined;
|
|
55
47
|
/**
|
|
56
48
|
* Whether to include BYOK usage in the limit
|
|
57
49
|
*/
|
|
@@ -207,8 +199,6 @@ export declare const CreateKeysLimitReset$outboundSchema: z.ZodType<string, Crea
|
|
|
207
199
|
export type CreateKeysRequestBody$Outbound = {
|
|
208
200
|
creator_user_id?: string | null | undefined;
|
|
209
201
|
expires_at?: string | null | undefined;
|
|
210
|
-
external_api_key?: string | undefined;
|
|
211
|
-
external_user?: string | undefined;
|
|
212
202
|
include_byok_in_limit?: boolean | undefined;
|
|
213
203
|
limit?: number | null | undefined;
|
|
214
204
|
limit_reset?: string | null | undefined;
|
|
@@ -20,8 +20,6 @@ export const CreateKeysLimitReset$outboundSchema = openEnums.outboundSchema(Crea
|
|
|
20
20
|
export const CreateKeysRequestBody$outboundSchema = z.object({
|
|
21
21
|
creatorUserId: z.nullable(z.string()).optional(),
|
|
22
22
|
expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
23
|
-
externalApiKey: z.string().optional(),
|
|
24
|
-
externalUser: z.string().optional(),
|
|
25
23
|
includeByokInLimit: z.boolean().optional(),
|
|
26
24
|
limit: z.nullable(z.number()).optional(),
|
|
27
25
|
limitReset: z.nullable(CreateKeysLimitReset$outboundSchema).optional(),
|
|
@@ -31,8 +29,6 @@ export const CreateKeysRequestBody$outboundSchema = z.object({
|
|
|
31
29
|
return remap$(v, {
|
|
32
30
|
creatorUserId: "creator_user_id",
|
|
33
31
|
expiresAt: "expires_at",
|
|
34
|
-
externalApiKey: "external_api_key",
|
|
35
|
-
externalUser: "external_user",
|
|
36
32
|
includeByokInLimit: "include_byok_in_limit",
|
|
37
33
|
limitReset: "limit_reset",
|
|
38
34
|
workspaceId: "workspace_id",
|
package/esm/sdk/apikeys.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class APIKeys extends ClientSDK {
|
|
|
19
19
|
* Create a new API key
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
|
-
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
22
|
+
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
23
23
|
*/
|
|
24
24
|
create(request: operations.CreateKeysRequest, options?: RequestOptions): Promise<operations.CreateKeysResponse>;
|
|
25
25
|
/**
|
package/esm/sdk/apikeys.js
CHANGED
|
@@ -33,7 +33,7 @@ export class APIKeys extends ClientSDK {
|
|
|
33
33
|
* Create a new API key
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
|
36
|
-
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
36
|
+
* Create a new API key for the authenticated user. The plaintext `key` is returned only in this response. Treat it as a write-only, sensitive value; it cannot be retrieved later. Authenticate with a [management key](/docs/guides/overview/auth/management-api-keys), or with a Connect client secret.
|
|
37
37
|
*/
|
|
38
38
|
async create(request, options) {
|
|
39
39
|
return unwrapAsync(apiKeysCreate(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.97",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"compile": "tsc",
|
|
77
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
79
|
-
"test:e2e": "vitest --run --project e2e",
|
|
80
|
-
"typecheck:transit": "exit 0",
|
|
81
77
|
"prepare": "npm run build",
|
|
78
|
+
"test:e2e": "vitest --run --project e2e",
|
|
82
79
|
"test:transit": "exit 0",
|
|
83
80
|
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"compile": "tsc",
|
|
83
|
+
"test": "vitest --run --project unit",
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|