@openrouter/sdk 1.2.126 → 1.2.128
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/sttCreateTranscription.d.ts +1 -1
- package/esm/funcs/sttCreateTranscription.js +1 -1
- package/esm/funcs/sttCreateTranscriptionMultipart.d.ts +1 -1
- package/esm/funcs/sttCreateTranscriptionMultipart.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/errors/gatewaytimeoutresponseerror.d.ts +39 -0
- package/esm/models/errors/gatewaytimeoutresponseerror.js +47 -0
- package/esm/models/errors/index.d.ts +1 -0
- package/esm/models/errors/index.js +1 -0
- package/esm/models/freemodeldailyrequests.d.ts +24 -0
- package/esm/models/freemodeldailyrequests.js +16 -0
- package/esm/models/gatewaytimeoutresponseerrordata.d.ts +17 -0
- package/esm/models/gatewaytimeoutresponseerrordata.js +16 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/operations/getcurrentkey.d.ts +5 -0
- package/esm/models/operations/getcurrentkey.js +3 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -15,5 +15,5 @@ import { Result } from "../types/fp.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
|
|
17
17
|
*/
|
|
18
|
-
export declare function sttCreateTranscription(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
export declare function sttCreateTranscription(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.GatewayTimeoutResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=sttCreateTranscription.d.ts.map
|
|
@@ -89,7 +89,7 @@ async function $do(client, request, options) {
|
|
|
89
89
|
const responseFields = {
|
|
90
90
|
HttpMeta: { Response: response, Request: req },
|
|
91
91
|
};
|
|
92
|
-
const [result] = await M.match(M.json(200, models.STTResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
92
|
+
const [result] = await M.match(M.json(200, models.STTResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(504, errors.GatewayTimeoutResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
93
93
|
if (!result.ok) {
|
|
94
94
|
return [result, { status: "complete", request: req, response }];
|
|
95
95
|
}
|
|
@@ -15,5 +15,5 @@ import { Result } from "../types/fp.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* Transcribes audio into text. Accepts base64-encoded audio input as JSON or an OpenAI-style multipart/form-data file upload, and returns the transcribed text.
|
|
17
17
|
*/
|
|
18
|
-
export declare function sttCreateTranscriptionMultipart(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsMultipartRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
export declare function sttCreateTranscriptionMultipart(client: OpenRouterCore, request: operations.CreateAudioTranscriptionsMultipartRequest, options?: RequestOptions): APIPromise<Result<models.STTResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.GatewayTimeoutResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=sttCreateTranscriptionMultipart.d.ts.map
|
|
@@ -121,7 +121,7 @@ async function $do(client, request, options) {
|
|
|
121
121
|
const responseFields = {
|
|
122
122
|
HttpMeta: { Response: response, Request: req },
|
|
123
123
|
};
|
|
124
|
-
const [result] = await M.match(M.json(200, models.STTResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
124
|
+
const [result] = await M.match(M.json(200, models.STTResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(504, errors.GatewayTimeoutResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
125
125
|
if (!result.ok) {
|
|
126
126
|
return [result, { status: "complete", request: req, response }];
|
|
127
127
|
}
|
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.128";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.128 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.128",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.128 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
import { OpenRouterError } from "./openroutererror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Gateway Timeout - Provider did not respond before the upstream deadline
|
|
6
|
+
*/
|
|
7
|
+
export type GatewayTimeoutResponseErrorData = {
|
|
8
|
+
/**
|
|
9
|
+
* Error data for GatewayTimeoutResponse
|
|
10
|
+
*/
|
|
11
|
+
error: models.GatewayTimeoutResponseErrorData;
|
|
12
|
+
openrouterMetadata?: {
|
|
13
|
+
[k: string]: any;
|
|
14
|
+
} | null | undefined;
|
|
15
|
+
userId?: string | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Gateway Timeout - Provider did not respond before the upstream deadline
|
|
19
|
+
*/
|
|
20
|
+
export declare class GatewayTimeoutResponseError extends OpenRouterError {
|
|
21
|
+
/**
|
|
22
|
+
* Error data for GatewayTimeoutResponse
|
|
23
|
+
*/
|
|
24
|
+
error: models.GatewayTimeoutResponseErrorData;
|
|
25
|
+
openrouterMetadata?: {
|
|
26
|
+
[k: string]: any;
|
|
27
|
+
} | null | undefined;
|
|
28
|
+
userId?: string | null | undefined;
|
|
29
|
+
/** The original data that was passed to this error instance. */
|
|
30
|
+
data$: GatewayTimeoutResponseErrorData;
|
|
31
|
+
constructor(err: GatewayTimeoutResponseErrorData, httpMeta: {
|
|
32
|
+
response: Response;
|
|
33
|
+
request: Request;
|
|
34
|
+
body: string;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const GatewayTimeoutResponseError$inboundSchema: z.ZodType<GatewayTimeoutResponseError, unknown>;
|
|
39
|
+
//# sourceMappingURL=gatewaytimeoutresponseerror.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: defb0ae6c18e
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
import { OpenRouterError } from "./openroutererror.js";
|
|
9
|
+
/**
|
|
10
|
+
* Gateway Timeout - Provider did not respond before the upstream deadline
|
|
11
|
+
*/
|
|
12
|
+
export class GatewayTimeoutResponseError extends OpenRouterError {
|
|
13
|
+
constructor(err, httpMeta) {
|
|
14
|
+
const message = err.error?.message
|
|
15
|
+
|| `API error occurred: ${JSON.stringify(err)}`;
|
|
16
|
+
super(message, httpMeta);
|
|
17
|
+
this.data$ = err;
|
|
18
|
+
this.error = err.error;
|
|
19
|
+
if (err.openrouterMetadata != null) {
|
|
20
|
+
this.openrouterMetadata = err.openrouterMetadata;
|
|
21
|
+
}
|
|
22
|
+
if (err.userId != null)
|
|
23
|
+
this.userId = err.userId;
|
|
24
|
+
this.name = "GatewayTimeoutResponseError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const GatewayTimeoutResponseError$inboundSchema = z.object({
|
|
29
|
+
error: models.GatewayTimeoutResponseErrorData$inboundSchema,
|
|
30
|
+
openrouter_metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
31
|
+
user_id: z.nullable(z.string()).optional(),
|
|
32
|
+
request$: z.custom(x => x instanceof Request),
|
|
33
|
+
response$: z.custom(x => x instanceof Response),
|
|
34
|
+
body$: z.string(),
|
|
35
|
+
})
|
|
36
|
+
.transform((v) => {
|
|
37
|
+
const remapped = remap$(v, {
|
|
38
|
+
"openrouter_metadata": "openrouterMetadata",
|
|
39
|
+
"user_id": "userId",
|
|
40
|
+
});
|
|
41
|
+
return new GatewayTimeoutResponseError(remapped, {
|
|
42
|
+
request: v.request$,
|
|
43
|
+
response: v.response$,
|
|
44
|
+
body: v.body$,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=gatewaytimeoutresponseerror.js.map
|
|
@@ -3,6 +3,7 @@ export * from "./badrequestresponseerror.js";
|
|
|
3
3
|
export * from "./conflictresponseerror.js";
|
|
4
4
|
export * from "./edgenetworktimeoutresponseerror.js";
|
|
5
5
|
export * from "./forbiddenresponseerror.js";
|
|
6
|
+
export * from "./gatewaytimeoutresponseerror.js";
|
|
6
7
|
export * from "./goneresponseerror.js";
|
|
7
8
|
export * from "./httpclienterrors.js";
|
|
8
9
|
export * from "./internalserverresponseerror.js";
|
|
@@ -7,6 +7,7 @@ export * from "./badrequestresponseerror.js";
|
|
|
7
7
|
export * from "./conflictresponseerror.js";
|
|
8
8
|
export * from "./edgenetworktimeoutresponseerror.js";
|
|
9
9
|
export * from "./forbiddenresponseerror.js";
|
|
10
|
+
export * from "./gatewaytimeoutresponseerror.js";
|
|
10
11
|
export * from "./goneresponseerror.js";
|
|
11
12
|
export * from "./httpclienterrors.js";
|
|
12
13
|
export * from "./internalserverresponseerror.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Free-model (`:free` variant) daily request quota for the account that owns the key. Reports the same counter and tier limit that free-model enforcement reads for accounts subject to the free-model limits; the counter resets at UTC midnight. Accounts and endpoints exempt from free-model limits, and BYOK requests, are not gated by it, so `remaining` is the tier policy rather than an enforced ceiling for them.
|
|
6
|
+
*/
|
|
7
|
+
export type FreeModelDailyRequests = {
|
|
8
|
+
/**
|
|
9
|
+
* Free-model requests the account may make per UTC day; the ceiling depends on total credits purchased and is independent of `is_free_tier`
|
|
10
|
+
*/
|
|
11
|
+
limit: number;
|
|
12
|
+
/**
|
|
13
|
+
* Free-model requests left in the current UTC day
|
|
14
|
+
*/
|
|
15
|
+
remaining: number;
|
|
16
|
+
/**
|
|
17
|
+
* Free-model requests recorded for the account so far in the current UTC day
|
|
18
|
+
*/
|
|
19
|
+
used: number;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const FreeModelDailyRequests$inboundSchema: z.ZodType<FreeModelDailyRequests, unknown>;
|
|
23
|
+
export declare function freeModelDailyRequestsFromJSON(jsonString: string): SafeParseResult<FreeModelDailyRequests, SDKValidationError>;
|
|
24
|
+
//# sourceMappingURL=freemodeldailyrequests.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 6ed229ff1382
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const FreeModelDailyRequests$inboundSchema = z.object({
|
|
9
|
+
limit: z.int(),
|
|
10
|
+
remaining: z.int(),
|
|
11
|
+
used: z.int(),
|
|
12
|
+
});
|
|
13
|
+
export function freeModelDailyRequestsFromJSON(jsonString) {
|
|
14
|
+
return safeParse(jsonString, (x) => FreeModelDailyRequests$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FreeModelDailyRequests' from JSON`);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=freemodeldailyrequests.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Error data for GatewayTimeoutResponse
|
|
6
|
+
*/
|
|
7
|
+
export type GatewayTimeoutResponseErrorData = {
|
|
8
|
+
code: number;
|
|
9
|
+
message: string;
|
|
10
|
+
metadata?: {
|
|
11
|
+
[k: string]: any;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const GatewayTimeoutResponseErrorData$inboundSchema: z.ZodType<GatewayTimeoutResponseErrorData, unknown>;
|
|
16
|
+
export declare function gatewayTimeoutResponseErrorDataFromJSON(jsonString: string): SafeParseResult<GatewayTimeoutResponseErrorData, SDKValidationError>;
|
|
17
|
+
//# sourceMappingURL=gatewaytimeoutresponseerrordata.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e843379431c7
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const GatewayTimeoutResponseErrorData$inboundSchema = z.object({
|
|
9
|
+
code: z.int(),
|
|
10
|
+
message: z.string(),
|
|
11
|
+
metadata: z.nullable(z.record(z.string(), z.any())).optional(),
|
|
12
|
+
});
|
|
13
|
+
export function gatewayTimeoutResponseErrorDataFromJSON(jsonString) {
|
|
14
|
+
return safeParse(jsonString, (x) => GatewayTimeoutResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GatewayTimeoutResponseErrorData' from JSON`);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=gatewaytimeoutresponseerrordata.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -228,6 +228,7 @@ export * from "./formatjsonschemaconfig.js";
|
|
|
228
228
|
export * from "./formats.js";
|
|
229
229
|
export * from "./formattextconfig.js";
|
|
230
230
|
export * from "./frameimage.js";
|
|
231
|
+
export * from "./freemodeldailyrequests.js";
|
|
231
232
|
export * from "./functioncallargsdeltaevent.js";
|
|
232
233
|
export * from "./functioncallargsdoneevent.js";
|
|
233
234
|
export * from "./functioncallitem.js";
|
|
@@ -246,6 +247,7 @@ export * from "./fusionplugin.js";
|
|
|
246
247
|
export * from "./fusionservertoolconfig.js";
|
|
247
248
|
export * from "./fusionservertoolopenrouter.js";
|
|
248
249
|
export * from "./fusionsource.js";
|
|
250
|
+
export * from "./gatewaytimeoutresponseerrordata.js";
|
|
249
251
|
export * from "./generationcontentdata.js";
|
|
250
252
|
export * from "./generationcontenterror.js";
|
|
251
253
|
export * from "./generationcontenterrorattempt.js";
|
package/esm/models/index.js
CHANGED
|
@@ -232,6 +232,7 @@ export * from "./formatjsonschemaconfig.js";
|
|
|
232
232
|
export * from "./formats.js";
|
|
233
233
|
export * from "./formattextconfig.js";
|
|
234
234
|
export * from "./frameimage.js";
|
|
235
|
+
export * from "./freemodeldailyrequests.js";
|
|
235
236
|
export * from "./functioncallargsdeltaevent.js";
|
|
236
237
|
export * from "./functioncallargsdoneevent.js";
|
|
237
238
|
export * from "./functioncallitem.js";
|
|
@@ -250,6 +251,7 @@ export * from "./fusionplugin.js";
|
|
|
250
251
|
export * from "./fusionservertoolconfig.js";
|
|
251
252
|
export * from "./fusionservertoolopenrouter.js";
|
|
252
253
|
export * from "./fusionsource.js";
|
|
254
|
+
export * from "./gatewaytimeoutresponseerrordata.js";
|
|
253
255
|
export * from "./generationcontentdata.js";
|
|
254
256
|
export * from "./generationcontenterror.js";
|
|
255
257
|
export * from "./generationcontenterrorattempt.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
import * as models from "../index.js";
|
|
4
5
|
export type GetCurrentKeyGlobals = {
|
|
5
6
|
/**
|
|
6
7
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -90,6 +91,10 @@ export type GetCurrentKeyData = {
|
|
|
90
91
|
* ISO 8601 UTC timestamp when the API key expires, or null if no expiration
|
|
91
92
|
*/
|
|
92
93
|
expiresAt?: Date | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Free-model (`:free` variant) daily request quota for the account that owns the key. Reports the same counter and tier limit that free-model enforcement reads for accounts subject to the free-model limits; the counter resets at UTC midnight. Accounts and endpoints exempt from free-model limits, and BYOK requests, are not gated by it, so `remaining` is the tier policy rather than an enforced ceiling for them.
|
|
96
|
+
*/
|
|
97
|
+
freeModelDailyRequests: models.FreeModelDailyRequests;
|
|
93
98
|
/**
|
|
94
99
|
* Whether to include external BYOK usage in the credit limit
|
|
95
100
|
*/
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as models from "../index.js";
|
|
8
9
|
/** @internal */
|
|
9
10
|
export const GetCurrentKeyRequest$outboundSchema = z.object({
|
|
10
11
|
httpReferer: z.string().optional(),
|
|
@@ -35,6 +36,7 @@ export const GetCurrentKeyData$inboundSchema = z.object({
|
|
|
35
36
|
byok_usage_weekly: z.number(),
|
|
36
37
|
creator_user_id: z.nullable(z.string()),
|
|
37
38
|
expires_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))).optional(),
|
|
39
|
+
free_model_daily_requests: models.FreeModelDailyRequests$inboundSchema,
|
|
38
40
|
include_byok_in_limit: z.boolean(),
|
|
39
41
|
is_free_tier: z.boolean(),
|
|
40
42
|
is_management_key: z.boolean(),
|
|
@@ -56,6 +58,7 @@ export const GetCurrentKeyData$inboundSchema = z.object({
|
|
|
56
58
|
"byok_usage_weekly": "byokUsageWeekly",
|
|
57
59
|
"creator_user_id": "creatorUserId",
|
|
58
60
|
"expires_at": "expiresAt",
|
|
61
|
+
"free_model_daily_requests": "freeModelDailyRequests",
|
|
59
62
|
"include_byok_in_limit": "includeByokInLimit",
|
|
60
63
|
"is_free_tier": "isFreeTier",
|
|
61
64
|
"is_management_key": "isManagementKey",
|
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.128",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
76
77
|
"prepare": "npm run build",
|
|
77
|
-
"test": "vitest --run --project unit",
|
|
78
78
|
"test:e2e": "vitest --run --project e2e",
|
|
79
|
-
"typecheck": "tsc --noEmit",
|
|
80
|
-
"compile": "tsc",
|
|
81
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
82
79
|
"test:transit": "exit 0",
|
|
83
80
|
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"typecheck
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"typecheck:transit": "exit 0",
|
|
83
|
+
"compile": "tsc",
|
|
84
|
+
"test": "vitest --run --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|