@openrouter/sdk 1.2.149 → 1.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.
@@ -11,6 +11,7 @@ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
12
12
  import * as errors from "../models/errors/index.js";
13
13
  import * as models from "../models/index.js";
14
+ import { CreateApiAlphaDecisionsServerList } from "../models/operations/createapialphadecisions.js";
14
15
  import * as operations from "../models/operations/index.js";
15
16
  import { APIPromise } from "../types/async.js";
16
17
  /**
@@ -29,6 +30,10 @@ async function $do(client, request, options) {
29
30
  }
30
31
  const payload = parsed.value;
31
32
  const body = encodeJSON("body", payload.DecisionsRequest, { explode: true });
33
+ const baseURL = options?.serverURL
34
+ || pathToFunc(CreateApiAlphaDecisionsServerList[0], {
35
+ charEncoding: "percent",
36
+ })();
32
37
  const path = pathToFunc("/api/alpha/decisions")();
33
38
  const headers = new Headers(compactMap({
34
39
  "Content-Type": "application/json",
@@ -42,7 +47,7 @@ async function $do(client, request, options) {
42
47
  const requestSecurity = resolveGlobalSecurity(securityInput);
43
48
  const context = {
44
49
  options: client._options,
45
- baseURL: options?.serverURL ?? client._baseURL ?? "",
50
+ baseURL: baseURL ?? "",
46
51
  operationID: "createApiAlphaDecisions",
47
52
  oAuth2Scopes: null,
48
53
  resolvedSecurity: requestSecurity,
@@ -65,7 +70,7 @@ async function $do(client, request, options) {
65
70
  const requestRes = client._createRequest(context, {
66
71
  security: requestSecurity,
67
72
  method: "POST",
68
- baseURL: options?.serverURL,
73
+ baseURL: baseURL,
69
74
  path: path,
70
75
  headers: headers,
71
76
  body: body,
@@ -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.149";
53
+ readonly sdkVersion: "1.3.0";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.149 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.0 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.149",
32
+ sdkVersion: "1.3.0",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.149 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.0 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,5 +1,6 @@
1
1
  import * as z from "zod/v4";
2
2
  import * as models from "../index.js";
3
+ export declare const CreateApiAlphaDecisionsServerList: readonly ["https://openrouter.ai"];
3
4
  export type CreateApiAlphaDecisionsGlobals = {
4
5
  /**
5
6
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -5,6 +5,9 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import * as models from "../index.js";
8
+ export const CreateApiAlphaDecisionsServerList = [
9
+ "https://openrouter.ai",
10
+ ];
8
11
  /** @internal */
9
12
  export const CreateApiAlphaDecisionsRequest$outboundSchema = z.object({
10
13
  httpReferer: z.string().optional(),
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.149",
5
+ "version": "1.3.0",
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": "1.2.149",
3
+ "version": "1.3.0",
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
- "prepare": "npm run build",
76
+ "compile": "tsc",
77
+ "postinstall": "node scripts/check-types.js || true",
77
78
  "test:e2e": "vitest --run --project e2e",
78
- "test": "vitest --run --project unit",
79
79
  "test:transit": "exit 0",
80
- "test:watch": "vitest --watch --project unit",
81
80
  "typecheck": "tsc --noEmit",
82
81
  "typecheck:transit": "exit 0",
83
- "compile": "tsc",
84
- "postinstall": "node scripts/check-types.js || true"
82
+ "prepare": "npm run build",
83
+ "test": "vitest --run --project unit",
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {