@openrouter/sdk 0.1.8 → 0.1.9

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.
@@ -37,8 +37,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
37
37
  export declare const SDK_METADATA: {
38
38
  readonly language: "typescript";
39
39
  readonly openapiDocVersion: "1.0.0";
40
- readonly sdkVersion: "0.1.8";
40
+ readonly sdkVersion: "0.1.9";
41
41
  readonly genVersion: "2.748.0";
42
- readonly userAgent: "speakeasy-sdk/typescript 0.1.8 2.748.0 1.0.0 @openrouter/sdk";
42
+ readonly userAgent: "speakeasy-sdk/typescript 0.1.9 2.748.0 1.0.0 @openrouter/sdk";
43
43
  };
44
44
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
25
25
  export const SDK_METADATA = {
26
26
  language: "typescript",
27
27
  openapiDocVersion: "1.0.0",
28
- sdkVersion: "0.1.8",
28
+ sdkVersion: "0.1.9",
29
29
  genVersion: "2.748.0",
30
- userAgent: "speakeasy-sdk/typescript 0.1.8 2.748.0 1.0.0 @openrouter/sdk",
30
+ userAgent: "speakeasy-sdk/typescript 0.1.9 2.748.0 1.0.0 @openrouter/sdk",
31
31
  };
32
32
  //# sourceMappingURL=config.js.map
@@ -31,6 +31,10 @@ export type CreateKeysRequest = {
31
31
  * Whether to include BYOK usage in the limit
32
32
  */
33
33
  includeByokInLimit?: boolean | undefined;
34
+ /**
35
+ * Optional ISO 8601 timestamp with timezone when the API key should expire
36
+ */
37
+ expiresAt?: Date | null | undefined;
34
38
  };
35
39
  /**
36
40
  * The created API key information
@@ -108,6 +112,10 @@ export type CreateKeysData = {
108
112
  * ISO 8601 timestamp of when the API key was last updated
109
113
  */
110
114
  updatedAt: string | null;
115
+ /**
116
+ * ISO 8601 UTC timestamp when the API key expires, or null if no expiration
117
+ */
118
+ expiresAt?: Date | null | undefined;
111
119
  };
112
120
  /**
113
121
  * API key created successfully
@@ -130,6 +138,7 @@ export type CreateKeysRequest$Outbound = {
130
138
  limit?: number | null | undefined;
131
139
  limit_reset?: string | null | undefined;
132
140
  include_byok_in_limit?: boolean | undefined;
141
+ expires_at?: string | null | undefined;
133
142
  };
134
143
  /** @internal */
135
144
  export declare const CreateKeysRequest$outboundSchema: z.ZodType<CreateKeysRequest$Outbound, CreateKeysRequest>;
@@ -23,10 +23,12 @@ export const CreateKeysRequest$outboundSchema = z.object({
23
23
  limit: z.nullable(z.number()).optional(),
24
24
  limitReset: z.nullable(CreateKeysLimitReset$outboundSchema).optional(),
25
25
  includeByokInLimit: z.boolean().optional(),
26
+ expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
26
27
  }).transform((v) => {
27
28
  return remap$(v, {
28
29
  limitReset: "limit_reset",
29
30
  includeByokInLimit: "include_byok_in_limit",
31
+ expiresAt: "expires_at",
30
32
  });
31
33
  });
32
34
  export function createKeysRequestToJSON(createKeysRequest) {
@@ -52,6 +54,7 @@ export const CreateKeysData$inboundSchema = z.object({
52
54
  byok_usage_monthly: z.number(),
53
55
  created_at: z.string(),
54
56
  updated_at: z.nullable(z.string()),
57
+ expires_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
55
58
  }).transform((v) => {
56
59
  return remap$(v, {
57
60
  "limit_remaining": "limitRemaining",
@@ -66,6 +69,7 @@ export const CreateKeysData$inboundSchema = z.object({
66
69
  "byok_usage_monthly": "byokUsageMonthly",
67
70
  "created_at": "createdAt",
68
71
  "updated_at": "updatedAt",
72
+ "expires_at": "expiresAt",
69
73
  });
70
74
  });
71
75
  export function createKeysDataFromJSON(jsonString) {
@@ -83,6 +83,10 @@ export type GetKeyData = {
83
83
  * ISO 8601 timestamp of when the API key was last updated
84
84
  */
85
85
  updatedAt: string | null;
86
+ /**
87
+ * ISO 8601 UTC timestamp when the API key expires, or null if no expiration
88
+ */
89
+ expiresAt?: Date | null | undefined;
86
90
  };
87
91
  /**
88
92
  * API key details
@@ -32,6 +32,7 @@ export const GetKeyData$inboundSchema = z
32
32
  byok_usage_monthly: z.number(),
33
33
  created_at: z.string(),
34
34
  updated_at: z.nullable(z.string()),
35
+ expires_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
35
36
  }).transform((v) => {
36
37
  return remap$(v, {
37
38
  "limit_remaining": "limitRemaining",
@@ -46,6 +47,7 @@ export const GetKeyData$inboundSchema = z
46
47
  "byok_usage_monthly": "byokUsageMonthly",
47
48
  "created_at": "createdAt",
48
49
  "updated_at": "updatedAt",
50
+ "expires_at": "expiresAt",
49
51
  });
50
52
  });
51
53
  export function getKeyDataFromJSON(jsonString) {
@@ -84,6 +84,10 @@ export type ListData = {
84
84
  * ISO 8601 timestamp of when the API key was last updated
85
85
  */
86
86
  updatedAt: string | null;
87
+ /**
88
+ * ISO 8601 UTC timestamp when the API key expires, or null if no expiration
89
+ */
90
+ expiresAt?: Date | null | undefined;
87
91
  };
88
92
  /**
89
93
  * List of API keys
@@ -36,6 +36,7 @@ export const ListData$inboundSchema = z.object({
36
36
  byok_usage_monthly: z.number(),
37
37
  created_at: z.string(),
38
38
  updated_at: z.nullable(z.string()),
39
+ expires_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
39
40
  }).transform((v) => {
40
41
  return remap$(v, {
41
42
  "limit_remaining": "limitRemaining",
@@ -50,6 +51,7 @@ export const ListData$inboundSchema = z.object({
50
51
  "byok_usage_monthly": "byokUsageMonthly",
51
52
  "created_at": "createdAt",
52
53
  "updated_at": "updatedAt",
54
+ "expires_at": "expiresAt",
53
55
  });
54
56
  });
55
57
  export function listDataFromJSON(jsonString) {
@@ -119,6 +119,10 @@ export type UpdateKeysData = {
119
119
  * ISO 8601 timestamp of when the API key was last updated
120
120
  */
121
121
  updatedAt: string | null;
122
+ /**
123
+ * ISO 8601 UTC timestamp when the API key expires, or null if no expiration
124
+ */
125
+ expiresAt?: Date | null | undefined;
122
126
  };
123
127
  /**
124
128
  * API key updated successfully
@@ -65,6 +65,7 @@ export const UpdateKeysData$inboundSchema = z.object({
65
65
  byok_usage_monthly: z.number(),
66
66
  created_at: z.string(),
67
67
  updated_at: z.nullable(z.string()),
68
+ expires_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
68
69
  }).transform((v) => {
69
70
  return remap$(v, {
70
71
  "limit_remaining": "limitRemaining",
@@ -79,6 +80,7 @@ export const UpdateKeysData$inboundSchema = z.object({
79
80
  "byok_usage_monthly": "byokUsageMonthly",
80
81
  "created_at": "createdAt",
81
82
  "updated_at": "updatedAt",
83
+ "expires_at": "expiresAt",
82
84
  });
83
85
  });
84
86
  export function updateKeysDataFromJSON(jsonString) {
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.1.8",
5
+ "version": "0.1.9",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
6
6
  "keywords": [