@openrouter/sdk 1.2.118 → 1.2.120
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/videoGenerationGetVideoContent.d.ts +1 -1
- package/esm/funcs/videoGenerationGetVideoContent.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/byokproviderslug.d.ts +3 -0
- package/esm/models/byokproviderslug.js +3 -0
- package/esm/models/errors/goneresponseerror.d.ts +39 -0
- package/esm/models/errors/goneresponseerror.js +47 -0
- package/esm/models/errors/index.d.ts +1 -0
- package/esm/models/errors/index.js +1 -0
- package/esm/models/goneresponseerrordata.d.ts +17 -0
- package/esm/models/goneresponseerrordata.js +16 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/operations/listbyokkeys.d.ts +3 -0
- package/esm/models/operations/listbyokkeys.js +3 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
|
|
|
14
14
|
* @remarks
|
|
15
15
|
* Streams the generated video content from the upstream provider
|
|
16
16
|
*/
|
|
17
|
-
export declare function videoGenerationGetVideoContent(client: OpenRouterCore, request: operations.ListVideosContentRequest, options?: RequestOptions): APIPromise<Result<ReadableStream<Uint8Array>, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
+
export declare function videoGenerationGetVideoContent(client: OpenRouterCore, request: operations.ListVideosContentRequest, options?: RequestOptions): APIPromise<Result<ReadableStream<Uint8Array>, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.ConflictResponseError | errors.GoneResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=videoGenerationGetVideoContent.d.ts.map
|
|
@@ -98,7 +98,7 @@ async function $do(client, request, options) {
|
|
|
98
98
|
const responseFields = {
|
|
99
99
|
HttpMeta: { Response: response, Request: req },
|
|
100
100
|
};
|
|
101
|
-
const [result] = await M.match(M.stream(200, z.custom(x => x instanceof ReadableStream), { ctype: "video/mp4" }), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
101
|
+
const [result] = await M.match(M.stream(200, z.custom(x => x instanceof ReadableStream), { ctype: "video/mp4" }), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(409, errors.ConflictResponseError$inboundSchema), M.jsonErr(410, errors.GoneResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
102
102
|
if (!result.ok) {
|
|
103
103
|
return [result, { status: "complete", request: req, response }];
|
|
104
104
|
}
|
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.120";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.120 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.120",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.120 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -9,9 +9,11 @@ export declare const BYOKProviderSlug: {
|
|
|
9
9
|
readonly Akashml: "akashml";
|
|
10
10
|
readonly Alibaba: "alibaba";
|
|
11
11
|
readonly AmazonBedrock: "amazon-bedrock";
|
|
12
|
+
readonly AmazonBedrockClaudeOnAws: "amazon-bedrock/claude-on-aws";
|
|
12
13
|
readonly AmazonNova: "amazon-nova";
|
|
13
14
|
readonly Ambient: "ambient";
|
|
14
15
|
readonly Anthropic: "anthropic";
|
|
16
|
+
readonly Anthropic2: "anthropic/2";
|
|
15
17
|
readonly ArceeAi: "arcee-ai";
|
|
16
18
|
readonly AtlasCloud: "atlas-cloud";
|
|
17
19
|
readonly Avian: "avian";
|
|
@@ -24,6 +26,7 @@ export declare const BYOKProviderSlug: {
|
|
|
24
26
|
readonly Chutes: "chutes";
|
|
25
27
|
readonly Cirrascale: "cirrascale";
|
|
26
28
|
readonly Clarifai: "clarifai";
|
|
29
|
+
readonly ClaudeOnAws: "claude-on-aws";
|
|
27
30
|
readonly Cloudflare: "cloudflare";
|
|
28
31
|
readonly Cohere: "cohere";
|
|
29
32
|
readonly Coreweave: "coreweave";
|
|
@@ -12,9 +12,11 @@ export const BYOKProviderSlug = {
|
|
|
12
12
|
Akashml: "akashml",
|
|
13
13
|
Alibaba: "alibaba",
|
|
14
14
|
AmazonBedrock: "amazon-bedrock",
|
|
15
|
+
AmazonBedrockClaudeOnAws: "amazon-bedrock/claude-on-aws",
|
|
15
16
|
AmazonNova: "amazon-nova",
|
|
16
17
|
Ambient: "ambient",
|
|
17
18
|
Anthropic: "anthropic",
|
|
19
|
+
Anthropic2: "anthropic/2",
|
|
18
20
|
ArceeAi: "arcee-ai",
|
|
19
21
|
AtlasCloud: "atlas-cloud",
|
|
20
22
|
Avian: "avian",
|
|
@@ -27,6 +29,7 @@ export const BYOKProviderSlug = {
|
|
|
27
29
|
Chutes: "chutes",
|
|
28
30
|
Cirrascale: "cirrascale",
|
|
29
31
|
Clarifai: "clarifai",
|
|
32
|
+
ClaudeOnAws: "claude-on-aws",
|
|
30
33
|
Cloudflare: "cloudflare",
|
|
31
34
|
Cohere: "cohere",
|
|
32
35
|
Coreweave: "coreweave",
|
|
@@ -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
|
+
* Gone - Endpoint has been permanently removed or deprecated
|
|
6
|
+
*/
|
|
7
|
+
export type GoneResponseErrorData = {
|
|
8
|
+
/**
|
|
9
|
+
* Error data for GoneResponse
|
|
10
|
+
*/
|
|
11
|
+
error: models.GoneResponseErrorData;
|
|
12
|
+
openrouterMetadata?: {
|
|
13
|
+
[k: string]: any;
|
|
14
|
+
} | null | undefined;
|
|
15
|
+
userId?: string | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Gone - Endpoint has been permanently removed or deprecated
|
|
19
|
+
*/
|
|
20
|
+
export declare class GoneResponseError extends OpenRouterError {
|
|
21
|
+
/**
|
|
22
|
+
* Error data for GoneResponse
|
|
23
|
+
*/
|
|
24
|
+
error: models.GoneResponseErrorData;
|
|
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$: GoneResponseErrorData;
|
|
31
|
+
constructor(err: GoneResponseErrorData, httpMeta: {
|
|
32
|
+
response: Response;
|
|
33
|
+
request: Request;
|
|
34
|
+
body: string;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** @internal */
|
|
38
|
+
export declare const GoneResponseError$inboundSchema: z.ZodType<GoneResponseError, unknown>;
|
|
39
|
+
//# sourceMappingURL=goneresponseerror.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1ef067a14e46
|
|
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
|
+
* Gone - Endpoint has been permanently removed or deprecated
|
|
11
|
+
*/
|
|
12
|
+
export class GoneResponseError 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 = "GoneResponseError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const GoneResponseError$inboundSchema = z.object({
|
|
29
|
+
error: models.GoneResponseErrorData$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 GoneResponseError(remapped, {
|
|
42
|
+
request: v.request$,
|
|
43
|
+
response: v.response$,
|
|
44
|
+
body: v.body$,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=goneresponseerror.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 "./goneresponseerror.js";
|
|
6
7
|
export * from "./httpclienterrors.js";
|
|
7
8
|
export * from "./internalserverresponseerror.js";
|
|
8
9
|
export * from "./notfoundresponseerror.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 "./goneresponseerror.js";
|
|
10
11
|
export * from "./httpclienterrors.js";
|
|
11
12
|
export * from "./internalserverresponseerror.js";
|
|
12
13
|
export * from "./notfoundresponseerror.js";
|
|
@@ -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 GoneResponse
|
|
6
|
+
*/
|
|
7
|
+
export type GoneResponseErrorData = {
|
|
8
|
+
code: number;
|
|
9
|
+
message: string;
|
|
10
|
+
metadata?: {
|
|
11
|
+
[k: string]: any;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const GoneResponseErrorData$inboundSchema: z.ZodType<GoneResponseErrorData, unknown>;
|
|
16
|
+
export declare function goneResponseErrorDataFromJSON(jsonString: string): SafeParseResult<GoneResponseErrorData, SDKValidationError>;
|
|
17
|
+
//# sourceMappingURL=goneresponseerrordata.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f206bbd2db1a
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const GoneResponseErrorData$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 goneResponseErrorDataFromJSON(jsonString) {
|
|
14
|
+
return safeParse(jsonString, (x) => GoneResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GoneResponseErrorData' from JSON`);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=goneresponseerrordata.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -260,6 +260,7 @@ export * from "./getscimgroupmappingresponse.js";
|
|
|
260
260
|
export * from "./getscimsyncjobresponse.js";
|
|
261
261
|
export * from "./getworkspacebudgetresponse.js";
|
|
262
262
|
export * from "./getworkspaceresponse.js";
|
|
263
|
+
export * from "./goneresponseerrordata.js";
|
|
263
264
|
export * from "./guardrail.js";
|
|
264
265
|
export * from "./guardraildataregion.js";
|
|
265
266
|
export * from "./guardrailinterval.js";
|
package/esm/models/index.js
CHANGED
|
@@ -264,6 +264,7 @@ export * from "./getscimgroupmappingresponse.js";
|
|
|
264
264
|
export * from "./getscimsyncjobresponse.js";
|
|
265
265
|
export * from "./getworkspacebudgetresponse.js";
|
|
266
266
|
export * from "./getworkspaceresponse.js";
|
|
267
|
+
export * from "./goneresponseerrordata.js";
|
|
267
268
|
export * from "./guardrail.js";
|
|
268
269
|
export * from "./guardraildataregion.js";
|
|
269
270
|
export * from "./guardrailinterval.js";
|
|
@@ -33,9 +33,11 @@ export declare const Provider: {
|
|
|
33
33
|
readonly Akashml: "akashml";
|
|
34
34
|
readonly Alibaba: "alibaba";
|
|
35
35
|
readonly AmazonBedrock: "amazon-bedrock";
|
|
36
|
+
readonly AmazonBedrockClaudeOnAws: "amazon-bedrock/claude-on-aws";
|
|
36
37
|
readonly AmazonNova: "amazon-nova";
|
|
37
38
|
readonly Ambient: "ambient";
|
|
38
39
|
readonly Anthropic: "anthropic";
|
|
40
|
+
readonly Anthropic2: "anthropic/2";
|
|
39
41
|
readonly ArceeAi: "arcee-ai";
|
|
40
42
|
readonly AtlasCloud: "atlas-cloud";
|
|
41
43
|
readonly Avian: "avian";
|
|
@@ -48,6 +50,7 @@ export declare const Provider: {
|
|
|
48
50
|
readonly Chutes: "chutes";
|
|
49
51
|
readonly Cirrascale: "cirrascale";
|
|
50
52
|
readonly Clarifai: "clarifai";
|
|
53
|
+
readonly ClaudeOnAws: "claude-on-aws";
|
|
51
54
|
readonly Cloudflare: "cloudflare";
|
|
52
55
|
readonly Cohere: "cohere";
|
|
53
56
|
readonly Coreweave: "coreweave";
|
|
@@ -16,9 +16,11 @@ export const Provider = {
|
|
|
16
16
|
Akashml: "akashml",
|
|
17
17
|
Alibaba: "alibaba",
|
|
18
18
|
AmazonBedrock: "amazon-bedrock",
|
|
19
|
+
AmazonBedrockClaudeOnAws: "amazon-bedrock/claude-on-aws",
|
|
19
20
|
AmazonNova: "amazon-nova",
|
|
20
21
|
Ambient: "ambient",
|
|
21
22
|
Anthropic: "anthropic",
|
|
23
|
+
Anthropic2: "anthropic/2",
|
|
22
24
|
ArceeAi: "arcee-ai",
|
|
23
25
|
AtlasCloud: "atlas-cloud",
|
|
24
26
|
Avian: "avian",
|
|
@@ -31,6 +33,7 @@ export const Provider = {
|
|
|
31
33
|
Chutes: "chutes",
|
|
32
34
|
Cirrascale: "cirrascale",
|
|
33
35
|
Clarifai: "clarifai",
|
|
36
|
+
ClaudeOnAws: "claude-on-aws",
|
|
34
37
|
Cloudflare: "cloudflare",
|
|
35
38
|
Cohere: "cohere",
|
|
36
39
|
Coreweave: "coreweave",
|
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.120",
|
|
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
|
-
"test:watch": "vitest --watch --project unit",
|
|
77
76
|
"compile": "tsc",
|
|
77
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
+
"prepare": "npm run build",
|
|
78
79
|
"test": "vitest --run --project unit",
|
|
79
80
|
"test:e2e": "vitest --run --project e2e",
|
|
80
81
|
"test:transit": "exit 0",
|
|
82
|
+
"test:watch": "vitest --watch --project unit",
|
|
81
83
|
"typecheck": "tsc --noEmit",
|
|
82
|
-
"typecheck:transit": "exit 0"
|
|
83
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
-
"prepare": "npm run build"
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|