@openrouter/sdk 1.3.9 → 1.3.11

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.
@@ -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.3.9";
53
+ readonly sdkVersion: "1.3.11";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.3.9 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.11 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.3.9",
32
+ sdkVersion: "1.3.11",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.3.9 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.11 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -5,6 +5,7 @@ import { WebSearchConfig, WebSearchConfig$Outbound } from "./websearchconfig.js"
5
5
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
6
6
  import { WebSearchMode } from "./websearchmode.js";
7
7
  import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbound } from "./websearchuserlocationservertool.js";
8
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
8
9
  export declare const ChatWebSearchShorthandType: {
9
10
  readonly WebSearch: "web_search";
10
11
  readonly WebSearchPreview: "web_search_preview";
@@ -17,7 +18,7 @@ export type ChatWebSearchShorthandType = OpenEnum<typeof ChatWebSearchShorthandT
17
18
  */
18
19
  export type ChatWebSearchShorthand = {
19
20
  /**
20
- * Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains.
21
+ * Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXAI). Cannot be used with excluded_domains.
21
22
  */
22
23
  allowedDomains?: Array<string> | undefined;
23
24
  /**
@@ -25,7 +26,7 @@ export type ChatWebSearchShorthand = {
25
26
  */
26
27
  engine?: WebSearchEngineEnum | undefined;
27
28
  /**
28
- * Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and xAI. Cannot be used with allowed_domains.
29
+ * Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXAI. Cannot be used with allowed_domains.
29
30
  */
30
31
  excludedDomains?: Array<string> | undefined;
31
32
  /**
@@ -58,6 +59,10 @@ export type ChatWebSearchShorthand = {
58
59
  * Approximate user location for location-biased results.
59
60
  */
60
61
  userLocation?: WebSearchUserLocationServerTool | undefined;
62
+ /**
63
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
64
+ */
65
+ xSearch?: XSearchOptions | undefined;
61
66
  };
62
67
  /** @internal */
63
68
  export declare const ChatWebSearchShorthandType$outboundSchema: z.ZodType<string, ChatWebSearchShorthandType>;
@@ -75,6 +80,7 @@ export type ChatWebSearchShorthand$Outbound = {
75
80
  search_context_size?: string | undefined;
76
81
  type: string;
77
82
  user_location?: WebSearchUserLocationServerTool$Outbound | undefined;
83
+ x_search?: XSearchOptions$Outbound | undefined;
78
84
  };
79
85
  /** @internal */
80
86
  export declare const ChatWebSearchShorthand$outboundSchema: z.ZodType<ChatWebSearchShorthand$Outbound, ChatWebSearchShorthand>;
@@ -10,6 +10,7 @@ import { WebSearchConfig$outboundSchema, } from "./websearchconfig.js";
10
10
  import { WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
11
11
  import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
12
12
  import { WebSearchUserLocationServerTool$outboundSchema, } from "./websearchuserlocationservertool.js";
13
+ import { XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
13
14
  export const ChatWebSearchShorthandType = {
14
15
  WebSearch: "web_search",
15
16
  WebSearchPreview: "web_search_preview",
@@ -32,6 +33,7 @@ export const ChatWebSearchShorthand$outboundSchema = z.object({
32
33
  searchContextSize: SearchQualityLevel$outboundSchema.optional(),
33
34
  type: ChatWebSearchShorthandType$outboundSchema,
34
35
  userLocation: WebSearchUserLocationServerTool$outboundSchema.optional(),
36
+ xSearch: XSearchOptions$outboundSchema.optional(),
35
37
  }).transform((v) => {
36
38
  return remap$(v, {
37
39
  allowedDomains: "allowed_domains",
@@ -42,6 +44,7 @@ export const ChatWebSearchShorthand$outboundSchema = z.object({
42
44
  maxUses: "max_uses",
43
45
  searchContextSize: "search_context_size",
44
46
  userLocation: "user_location",
47
+ xSearch: "x_search",
45
48
  });
46
49
  });
47
50
  export function chatWebSearchShorthandToJSON(chatWebSearchShorthand) {
@@ -686,4 +686,5 @@ export * from "./workspace.js";
686
686
  export * from "./workspacebudget.js";
687
687
  export * from "./workspacebudgetinterval.js";
688
688
  export * from "./workspacemember.js";
689
+ export * from "./xsearchoptions.js";
689
690
  //# sourceMappingURL=index.d.ts.map
@@ -690,4 +690,5 @@ export * from "./workspace.js";
690
690
  export * from "./workspacebudget.js";
691
691
  export * from "./workspacebudgetinterval.js";
692
692
  export * from "./workspacemember.js";
693
+ export * from "./xsearchoptions.js";
693
694
  //# sourceMappingURL=index.js.map
@@ -7,6 +7,7 @@ import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websear
7
7
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
8
8
  import { WebSearchMode } from "./websearchmode.js";
9
9
  import { WebSearchUserLocation, WebSearchUserLocation$Outbound } from "./websearchuserlocation.js";
10
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
10
11
  export declare const LegacyWebSearchServerToolType: {
11
12
  readonly WebSearch: "web_search";
12
13
  };
@@ -41,6 +42,10 @@ export type LegacyWebSearchServerTool = {
41
42
  * User location information for web search
42
43
  */
43
44
  userLocation?: WebSearchUserLocation | null | undefined;
45
+ /**
46
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
47
+ */
48
+ xSearch?: XSearchOptions | undefined;
44
49
  };
45
50
  /** @internal */
46
51
  export declare const LegacyWebSearchServerToolType$inboundSchema: z.ZodEnum<typeof LegacyWebSearchServerToolType>;
@@ -58,6 +63,7 @@ export type LegacyWebSearchServerTool$Outbound = {
58
63
  search_context_size?: string | undefined;
59
64
  type: string;
60
65
  user_location?: WebSearchUserLocation$Outbound | null | undefined;
66
+ x_search?: XSearchOptions$Outbound | undefined;
61
67
  };
62
68
  /** @internal */
63
69
  export declare const LegacyWebSearchServerTool$outboundSchema: z.ZodType<LegacyWebSearchServerTool$Outbound, LegacyWebSearchServerTool>;
@@ -10,6 +10,7 @@ import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSche
10
10
  import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
11
11
  import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
12
12
  import { WebSearchUserLocation$inboundSchema, WebSearchUserLocation$outboundSchema, } from "./websearchuserlocation.js";
13
+ import { XSearchOptions$inboundSchema, XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
13
14
  export const LegacyWebSearchServerToolType = {
14
15
  WebSearch: "web_search",
15
16
  };
@@ -27,12 +28,14 @@ export const LegacyWebSearchServerTool$inboundSchema = z.object({
27
28
  search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
28
29
  type: LegacyWebSearchServerToolType$inboundSchema,
29
30
  user_location: z.nullable(WebSearchUserLocation$inboundSchema).optional(),
31
+ x_search: XSearchOptions$inboundSchema.optional(),
30
32
  }).transform((v) => {
31
33
  return remap$(v, {
32
34
  "max_results": "maxResults",
33
35
  "max_uses": "maxUses",
34
36
  "search_context_size": "searchContextSize",
35
37
  "user_location": "userLocation",
38
+ "x_search": "xSearch",
36
39
  });
37
40
  });
38
41
  /** @internal */
@@ -45,12 +48,14 @@ export const LegacyWebSearchServerTool$outboundSchema = z.object({
45
48
  searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
46
49
  type: LegacyWebSearchServerToolType$outboundSchema,
47
50
  userLocation: z.nullable(WebSearchUserLocation$outboundSchema).optional(),
51
+ xSearch: XSearchOptions$outboundSchema.optional(),
48
52
  }).transform((v) => {
49
53
  return remap$(v, {
50
54
  maxResults: "max_results",
51
55
  maxUses: "max_uses",
52
56
  searchContextSize: "search_context_size",
53
57
  userLocation: "user_location",
58
+ xSearch: "x_search",
54
59
  });
55
60
  });
56
61
  export function legacyWebSearchServerToolToJSON(legacyWebSearchServerTool) {
@@ -7,6 +7,7 @@ import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
7
7
  import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
8
8
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
9
9
  import { WebSearchMode } from "./websearchmode.js";
10
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
10
11
  export declare const Preview20250311WebSearchServerToolType: {
11
12
  readonly WebSearchPreview20250311: "web_search_preview_2025_03_11";
12
13
  };
@@ -38,6 +39,10 @@ export type Preview20250311WebSearchServerTool = {
38
39
  searchContextSize?: SearchContextSizeEnum | undefined;
39
40
  type: Preview20250311WebSearchServerToolType;
40
41
  userLocation?: PreviewWebSearchUserLocation | null | undefined;
42
+ /**
43
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
44
+ */
45
+ xSearch?: XSearchOptions | undefined;
41
46
  };
42
47
  /** @internal */
43
48
  export declare const Preview20250311WebSearchServerToolType$inboundSchema: z.ZodEnum<typeof Preview20250311WebSearchServerToolType>;
@@ -55,6 +60,7 @@ export type Preview20250311WebSearchServerTool$Outbound = {
55
60
  search_context_size?: string | undefined;
56
61
  type: string;
57
62
  user_location?: PreviewWebSearchUserLocation$Outbound | null | undefined;
63
+ x_search?: XSearchOptions$Outbound | undefined;
58
64
  };
59
65
  /** @internal */
60
66
  export declare const Preview20250311WebSearchServerTool$outboundSchema: z.ZodType<Preview20250311WebSearchServerTool$Outbound, Preview20250311WebSearchServerTool>;
@@ -10,6 +10,7 @@ import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSche
10
10
  import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
11
11
  import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
12
12
  import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
13
+ import { XSearchOptions$inboundSchema, XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
13
14
  export const Preview20250311WebSearchServerToolType = {
14
15
  WebSearchPreview20250311: "web_search_preview_2025_03_11",
15
16
  };
@@ -28,12 +29,14 @@ export const Preview20250311WebSearchServerTool$inboundSchema = z.object({
28
29
  type: Preview20250311WebSearchServerToolType$inboundSchema,
29
30
  user_location: z.nullable(PreviewWebSearchUserLocation$inboundSchema)
30
31
  .optional(),
32
+ x_search: XSearchOptions$inboundSchema.optional(),
31
33
  }).transform((v) => {
32
34
  return remap$(v, {
33
35
  "max_results": "maxResults",
34
36
  "max_uses": "maxUses",
35
37
  "search_context_size": "searchContextSize",
36
38
  "user_location": "userLocation",
39
+ "x_search": "xSearch",
37
40
  });
38
41
  });
39
42
  /** @internal */
@@ -47,12 +50,14 @@ export const Preview20250311WebSearchServerTool$outboundSchema = z.object({
47
50
  type: Preview20250311WebSearchServerToolType$outboundSchema,
48
51
  userLocation: z.nullable(PreviewWebSearchUserLocation$outboundSchema)
49
52
  .optional(),
53
+ xSearch: XSearchOptions$outboundSchema.optional(),
50
54
  }).transform((v) => {
51
55
  return remap$(v, {
52
56
  maxResults: "max_results",
53
57
  maxUses: "max_uses",
54
58
  searchContextSize: "search_context_size",
55
59
  userLocation: "user_location",
60
+ xSearch: "x_search",
56
61
  });
57
62
  });
58
63
  export function preview20250311WebSearchServerToolToJSON(preview20250311WebSearchServerTool) {
@@ -7,6 +7,7 @@ import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
7
7
  import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
8
8
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
9
9
  import { WebSearchMode } from "./websearchmode.js";
10
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
10
11
  export declare const PreviewWebSearchServerToolType: {
11
12
  readonly WebSearchPreview: "web_search_preview";
12
13
  };
@@ -38,6 +39,10 @@ export type PreviewWebSearchServerTool = {
38
39
  searchContextSize?: SearchContextSizeEnum | undefined;
39
40
  type: PreviewWebSearchServerToolType;
40
41
  userLocation?: PreviewWebSearchUserLocation | null | undefined;
42
+ /**
43
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
44
+ */
45
+ xSearch?: XSearchOptions | undefined;
41
46
  };
42
47
  /** @internal */
43
48
  export declare const PreviewWebSearchServerToolType$inboundSchema: z.ZodEnum<typeof PreviewWebSearchServerToolType>;
@@ -55,6 +60,7 @@ export type PreviewWebSearchServerTool$Outbound = {
55
60
  search_context_size?: string | undefined;
56
61
  type: string;
57
62
  user_location?: PreviewWebSearchUserLocation$Outbound | null | undefined;
63
+ x_search?: XSearchOptions$Outbound | undefined;
58
64
  };
59
65
  /** @internal */
60
66
  export declare const PreviewWebSearchServerTool$outboundSchema: z.ZodType<PreviewWebSearchServerTool$Outbound, PreviewWebSearchServerTool>;
@@ -10,6 +10,7 @@ import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSche
10
10
  import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
11
11
  import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
12
12
  import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
13
+ import { XSearchOptions$inboundSchema, XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
13
14
  export const PreviewWebSearchServerToolType = {
14
15
  WebSearchPreview: "web_search_preview",
15
16
  };
@@ -28,12 +29,14 @@ export const PreviewWebSearchServerTool$inboundSchema = z.object({
28
29
  type: PreviewWebSearchServerToolType$inboundSchema,
29
30
  user_location: z.nullable(PreviewWebSearchUserLocation$inboundSchema)
30
31
  .optional(),
32
+ x_search: XSearchOptions$inboundSchema.optional(),
31
33
  }).transform((v) => {
32
34
  return remap$(v, {
33
35
  "max_results": "maxResults",
34
36
  "max_uses": "maxUses",
35
37
  "search_context_size": "searchContextSize",
36
38
  "user_location": "userLocation",
39
+ "x_search": "xSearch",
37
40
  });
38
41
  });
39
42
  /** @internal */
@@ -47,12 +50,14 @@ export const PreviewWebSearchServerTool$outboundSchema = z.object({
47
50
  type: PreviewWebSearchServerToolType$outboundSchema,
48
51
  userLocation: z.nullable(PreviewWebSearchUserLocation$outboundSchema)
49
52
  .optional(),
53
+ xSearch: XSearchOptions$outboundSchema.optional(),
50
54
  }).transform((v) => {
51
55
  return remap$(v, {
52
56
  maxResults: "max_results",
53
57
  maxUses: "max_uses",
54
58
  searchContextSize: "search_context_size",
55
59
  userLocation: "user_location",
60
+ xSearch: "x_search",
56
61
  });
57
62
  });
58
63
  export function previewWebSearchServerToolToJSON(previewWebSearchServerTool) {
@@ -465,6 +465,7 @@ export type VideoGenerationRequestProvider = {
465
465
  * Resolution of the generated video
466
466
  */
467
467
  export declare const VideoGenerationRequestResolution: {
468
+ readonly ThreeHundredAndSixtyp: "360p";
468
469
  readonly FourHundredAndEightyp: "480p";
469
470
  readonly SevenHundredAndTwentyp: "720p";
470
471
  readonly SevenHundredAndSixtyEightp: "768p";
@@ -26,6 +26,7 @@ export const VideoGenerationRequestAspectRatio = {
26
26
  * Resolution of the generated video
27
27
  */
28
28
  export const VideoGenerationRequestResolution = {
29
+ ThreeHundredAndSixtyp: "360p",
29
30
  FourHundredAndEightyp: "480p",
30
31
  SevenHundredAndTwentyp: "720p",
31
32
  SevenHundredAndSixtyEightp: "768p",
@@ -20,6 +20,7 @@ export declare const SupportedFrameImage: {
20
20
  };
21
21
  export type SupportedFrameImage = OpenEnum<typeof SupportedFrameImage>;
22
22
  export declare const SupportedResolution: {
23
+ readonly ThreeHundredAndSixtyp: "360p";
23
24
  readonly FourHundredAndEightyp: "480p";
24
25
  readonly SevenHundredAndTwentyp: "720p";
25
26
  readonly SevenHundredAndSixtyEightp: "768p";
@@ -30,12 +31,20 @@ export declare const SupportedResolution: {
30
31
  };
31
32
  export type SupportedResolution = OpenEnum<typeof SupportedResolution>;
32
33
  export declare const SupportedSize: {
34
+ readonly ThreeHundredAndSixtyx360: "360x360";
35
+ readonly ThreeHundredAndSixtyx480: "360x480";
36
+ readonly ThreeHundredAndSixtyx540: "360x540";
37
+ readonly ThreeHundredAndSixtyx640: "360x640";
38
+ readonly ThreeHundredAndSixtyx840: "360x840";
39
+ readonly FourHundredAndEightyx360: "480x360";
33
40
  readonly FourHundredAndEightyx480: "480x480";
34
41
  readonly FourHundredAndEightyx640: "480x640";
35
42
  readonly FourHundredAndEightyx720: "480x720";
36
43
  readonly FourHundredAndEightyx854: "480x854";
37
44
  readonly FourHundredAndEightyx1120: "480x1120";
45
+ readonly FiveHundredAndFortyx360: "540x360";
38
46
  readonly FiveHundredAndSixtyx752: "560x752";
47
+ readonly SixHundredAndFortyx360: "640x360";
39
48
  readonly SixHundredAndFortyx480: "640x480";
40
49
  readonly SixHundredAndFortyx640: "640x640";
41
50
  readonly SevenHundredAndTwentyx480: "720x480";
@@ -51,6 +60,7 @@ export declare const SupportedSize: {
51
60
  readonly SevenHundredAndSixtyEightx1366: "768x1366";
52
61
  readonly SevenHundredAndSixtyEightx1792: "768x1792";
53
62
  readonly EightHundredAndThirtyFourx1112: "834x1112";
63
+ readonly EightHundredAndFortyx360: "840x360";
54
64
  readonly EightHundredAndFiftyFourx480: "854x480";
55
65
  readonly NineHundredAndSixtyx720: "960x720";
56
66
  readonly NineHundredAndSixtyx960: "960x960";
@@ -22,6 +22,7 @@ export const SupportedFrameImage = {
22
22
  LastFrame: "last_frame",
23
23
  };
24
24
  export const SupportedResolution = {
25
+ ThreeHundredAndSixtyp: "360p",
25
26
  FourHundredAndEightyp: "480p",
26
27
  SevenHundredAndTwentyp: "720p",
27
28
  SevenHundredAndSixtyEightp: "768p",
@@ -31,12 +32,20 @@ export const SupportedResolution = {
31
32
  FourK: "4K",
32
33
  };
33
34
  export const SupportedSize = {
35
+ ThreeHundredAndSixtyx360: "360x360",
36
+ ThreeHundredAndSixtyx480: "360x480",
37
+ ThreeHundredAndSixtyx540: "360x540",
38
+ ThreeHundredAndSixtyx640: "360x640",
39
+ ThreeHundredAndSixtyx840: "360x840",
40
+ FourHundredAndEightyx360: "480x360",
34
41
  FourHundredAndEightyx480: "480x480",
35
42
  FourHundredAndEightyx640: "480x640",
36
43
  FourHundredAndEightyx720: "480x720",
37
44
  FourHundredAndEightyx854: "480x854",
38
45
  FourHundredAndEightyx1120: "480x1120",
46
+ FiveHundredAndFortyx360: "540x360",
39
47
  FiveHundredAndSixtyx752: "560x752",
48
+ SixHundredAndFortyx360: "640x360",
40
49
  SixHundredAndFortyx480: "640x480",
41
50
  SixHundredAndFortyx640: "640x640",
42
51
  SevenHundredAndTwentyx480: "720x480",
@@ -52,6 +61,7 @@ export const SupportedSize = {
52
61
  SevenHundredAndSixtyEightx1366: "768x1366",
53
62
  SevenHundredAndSixtyEightx1792: "768x1792",
54
63
  EightHundredAndThirtyFourx1112: "834x1112",
64
+ EightHundredAndFortyx360: "840x360",
55
65
  EightHundredAndFiftyFourx480: "854x480",
56
66
  NineHundredAndSixtyx720: "960x720",
57
67
  NineHundredAndSixtyx960: "960x960",
@@ -3,9 +3,10 @@ import { SearchQualityLevel } from "./searchqualitylevel.js";
3
3
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
4
4
  import { WebSearchMode } from "./websearchmode.js";
5
5
  import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbound } from "./websearchuserlocationservertool.js";
6
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
6
7
  export type WebSearchConfig = {
7
8
  /**
8
- * Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains.
9
+ * Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXAI). Cannot be used with excluded_domains.
9
10
  */
10
11
  allowedDomains?: Array<string> | undefined;
11
12
  /**
@@ -13,7 +14,7 @@ export type WebSearchConfig = {
13
14
  */
14
15
  engine?: WebSearchEngineEnum | undefined;
15
16
  /**
16
- * Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and xAI. Cannot be used with allowed_domains.
17
+ * Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXAI. Cannot be used with allowed_domains.
17
18
  */
18
19
  excludedDomains?: Array<string> | undefined;
19
20
  /**
@@ -44,6 +45,10 @@ export type WebSearchConfig = {
44
45
  * Approximate user location for location-biased results.
45
46
  */
46
47
  userLocation?: WebSearchUserLocationServerTool | undefined;
48
+ /**
49
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
50
+ */
51
+ xSearch?: XSearchOptions | undefined;
47
52
  };
48
53
  /** @internal */
49
54
  export type WebSearchConfig$Outbound = {
@@ -57,6 +62,7 @@ export type WebSearchConfig$Outbound = {
57
62
  mode?: string | undefined;
58
63
  search_context_size?: string | undefined;
59
64
  user_location?: WebSearchUserLocationServerTool$Outbound | undefined;
65
+ x_search?: XSearchOptions$Outbound | undefined;
60
66
  };
61
67
  /** @internal */
62
68
  export declare const WebSearchConfig$outboundSchema: z.ZodType<WebSearchConfig$Outbound, WebSearchConfig>;
@@ -8,6 +8,7 @@ import { SearchQualityLevel$outboundSchema, } from "./searchqualitylevel.js";
8
8
  import { WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
9
9
  import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
10
10
  import { WebSearchUserLocationServerTool$outboundSchema, } from "./websearchuserlocationservertool.js";
11
+ import { XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
11
12
  /** @internal */
12
13
  export const WebSearchConfig$outboundSchema = z.object({
13
14
  allowedDomains: z.array(z.string()).optional(),
@@ -20,6 +21,7 @@ export const WebSearchConfig$outboundSchema = z.object({
20
21
  mode: WebSearchMode$outboundSchema.optional(),
21
22
  searchContextSize: SearchQualityLevel$outboundSchema.optional(),
22
23
  userLocation: WebSearchUserLocationServerTool$outboundSchema.optional(),
24
+ xSearch: XSearchOptions$outboundSchema.optional(),
23
25
  }).transform((v) => {
24
26
  return remap$(v, {
25
27
  allowedDomains: "allowed_domains",
@@ -30,6 +32,7 @@ export const WebSearchConfig$outboundSchema = z.object({
30
32
  maxUses: "max_uses",
31
33
  searchContextSize: "search_context_size",
32
34
  userLocation: "user_location",
35
+ xSearch: "x_search",
33
36
  });
34
37
  });
35
38
  export function webSearchConfigToJSON(webSearchConfig) {
@@ -2,6 +2,7 @@ import * as z from "zod/v4";
2
2
  import { ClosedEnum } from "../types/enums.js";
3
3
  import { WebSearchEngine } from "./websearchengine.js";
4
4
  import { WebSearchMode } from "./websearchmode.js";
5
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
5
6
  export declare const WebSearchPluginType: {
6
7
  readonly Approximate: "approximate";
7
8
  };
@@ -45,6 +46,10 @@ export type WebSearchPlugin = {
45
46
  mode?: WebSearchMode | undefined;
46
47
  searchPrompt?: string | undefined;
47
48
  userLocation?: UserLocation | null | undefined;
49
+ /**
50
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
51
+ */
52
+ xSearch?: XSearchOptions | undefined;
48
53
  };
49
54
  /** @internal */
50
55
  export declare const WebSearchPluginType$outboundSchema: z.ZodEnum<typeof WebSearchPluginType>;
@@ -71,6 +76,7 @@ export type WebSearchPlugin$Outbound = {
71
76
  mode?: string | undefined;
72
77
  search_prompt?: string | undefined;
73
78
  user_location?: UserLocation$Outbound | null | undefined;
79
+ x_search?: XSearchOptions$Outbound | undefined;
74
80
  };
75
81
  /** @internal */
76
82
  export declare const WebSearchPlugin$outboundSchema: z.ZodType<WebSearchPlugin$Outbound, WebSearchPlugin>;
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { WebSearchEngine$outboundSchema, } from "./websearchengine.js";
8
8
  import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
9
+ import { XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
9
10
  export const WebSearchPluginType = {
10
11
  Approximate: "approximate",
11
12
  };
@@ -35,6 +36,7 @@ export const WebSearchPlugin$outboundSchema = z.object({
35
36
  searchPrompt: z.string().optional(),
36
37
  userLocation: z.nullable(z.lazy(() => UserLocation$outboundSchema))
37
38
  .optional(),
39
+ xSearch: XSearchOptions$outboundSchema.optional(),
38
40
  }).transform((v) => {
39
41
  return remap$(v, {
40
42
  excludeDomains: "exclude_domains",
@@ -43,6 +45,7 @@ export const WebSearchPlugin$outboundSchema = z.object({
43
45
  maxUses: "max_uses",
44
46
  searchPrompt: "search_prompt",
45
47
  userLocation: "user_location",
48
+ xSearch: "x_search",
46
49
  });
47
50
  });
48
51
  export function webSearchPluginToJSON(webSearchPlugin) {
@@ -7,6 +7,7 @@ import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websear
7
7
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
8
8
  import { WebSearchMode } from "./websearchmode.js";
9
9
  import { WebSearchUserLocation, WebSearchUserLocation$Outbound } from "./websearchuserlocation.js";
10
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
10
11
  export declare const WebSearchServerToolType: {
11
12
  readonly WebSearch20250826: "web_search_2025_08_26";
12
13
  };
@@ -41,6 +42,10 @@ export type WebSearchServerTool = {
41
42
  * User location information for web search
42
43
  */
43
44
  userLocation?: WebSearchUserLocation | null | undefined;
45
+ /**
46
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
47
+ */
48
+ xSearch?: XSearchOptions | undefined;
44
49
  };
45
50
  /** @internal */
46
51
  export declare const WebSearchServerToolType$inboundSchema: z.ZodEnum<typeof WebSearchServerToolType>;
@@ -58,6 +63,7 @@ export type WebSearchServerTool$Outbound = {
58
63
  search_context_size?: string | undefined;
59
64
  type: string;
60
65
  user_location?: WebSearchUserLocation$Outbound | null | undefined;
66
+ x_search?: XSearchOptions$Outbound | undefined;
61
67
  };
62
68
  /** @internal */
63
69
  export declare const WebSearchServerTool$outboundSchema: z.ZodType<WebSearchServerTool$Outbound, WebSearchServerTool>;
@@ -10,6 +10,7 @@ import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSche
10
10
  import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
11
11
  import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
12
12
  import { WebSearchUserLocation$inboundSchema, WebSearchUserLocation$outboundSchema, } from "./websearchuserlocation.js";
13
+ import { XSearchOptions$inboundSchema, XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
13
14
  export const WebSearchServerToolType = {
14
15
  WebSearch20250826: "web_search_2025_08_26",
15
16
  };
@@ -27,12 +28,14 @@ export const WebSearchServerTool$inboundSchema = z.object({
27
28
  search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
28
29
  type: WebSearchServerToolType$inboundSchema,
29
30
  user_location: z.nullable(WebSearchUserLocation$inboundSchema).optional(),
31
+ x_search: XSearchOptions$inboundSchema.optional(),
30
32
  }).transform((v) => {
31
33
  return remap$(v, {
32
34
  "max_results": "maxResults",
33
35
  "max_uses": "maxUses",
34
36
  "search_context_size": "searchContextSize",
35
37
  "user_location": "userLocation",
38
+ "x_search": "xSearch",
36
39
  });
37
40
  });
38
41
  /** @internal */
@@ -45,12 +48,14 @@ export const WebSearchServerTool$outboundSchema = z.object({
45
48
  searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
46
49
  type: WebSearchServerToolType$outboundSchema,
47
50
  userLocation: z.nullable(WebSearchUserLocation$outboundSchema).optional(),
51
+ xSearch: XSearchOptions$outboundSchema.optional(),
48
52
  }).transform((v) => {
49
53
  return remap$(v, {
50
54
  maxResults: "max_results",
51
55
  maxUses: "max_uses",
52
56
  searchContextSize: "search_context_size",
53
57
  userLocation: "user_location",
58
+ xSearch: "x_search",
54
59
  });
55
60
  });
56
61
  export function webSearchServerToolToJSON(webSearchServerTool) {
@@ -3,12 +3,13 @@ import { SearchQualityLevel } from "./searchqualitylevel.js";
3
3
  import { WebSearchEngineEnum } from "./websearchengineenum.js";
4
4
  import { WebSearchMode } from "./websearchmode.js";
5
5
  import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbound } from "./websearchuserlocationservertool.js";
6
+ import { XSearchOptions, XSearchOptions$Outbound } from "./xsearchoptions.js";
6
7
  /**
7
8
  * Configuration for the openrouter:web_search server tool
8
9
  */
9
10
  export type WebSearchServerToolConfig = {
10
11
  /**
11
- * Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains.
12
+ * Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, SpaceXAI). Cannot be used with excluded_domains.
12
13
  */
13
14
  allowedDomains?: Array<string> | undefined;
14
15
  /**
@@ -16,7 +17,7 @@ export type WebSearchServerToolConfig = {
16
17
  */
17
18
  engine?: WebSearchEngineEnum | undefined;
18
19
  /**
19
- * Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and xAI. Cannot be used with allowed_domains.
20
+ * Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, OpenAI, and SpaceXAI. Cannot be used with allowed_domains.
20
21
  */
21
22
  excludedDomains?: Array<string> | undefined;
22
23
  /**
@@ -47,6 +48,10 @@ export type WebSearchServerToolConfig = {
47
48
  * Approximate user location for location-biased results.
48
49
  */
49
50
  userLocation?: WebSearchUserLocationServerTool | undefined;
51
+ /**
52
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
53
+ */
54
+ xSearch?: XSearchOptions | undefined;
50
55
  };
51
56
  /** @internal */
52
57
  export type WebSearchServerToolConfig$Outbound = {
@@ -60,6 +65,7 @@ export type WebSearchServerToolConfig$Outbound = {
60
65
  mode?: string | undefined;
61
66
  search_context_size?: string | undefined;
62
67
  user_location?: WebSearchUserLocationServerTool$Outbound | undefined;
68
+ x_search?: XSearchOptions$Outbound | undefined;
63
69
  };
64
70
  /** @internal */
65
71
  export declare const WebSearchServerToolConfig$outboundSchema: z.ZodType<WebSearchServerToolConfig$Outbound, WebSearchServerToolConfig>;
@@ -8,6 +8,7 @@ import { SearchQualityLevel$outboundSchema, } from "./searchqualitylevel.js";
8
8
  import { WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
9
9
  import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
10
10
  import { WebSearchUserLocationServerTool$outboundSchema, } from "./websearchuserlocationservertool.js";
11
+ import { XSearchOptions$outboundSchema, } from "./xsearchoptions.js";
11
12
  /** @internal */
12
13
  export const WebSearchServerToolConfig$outboundSchema = z.object({
13
14
  allowedDomains: z.array(z.string()).optional(),
@@ -20,6 +21,7 @@ export const WebSearchServerToolConfig$outboundSchema = z.object({
20
21
  mode: WebSearchMode$outboundSchema.optional(),
21
22
  searchContextSize: SearchQualityLevel$outboundSchema.optional(),
22
23
  userLocation: WebSearchUserLocationServerTool$outboundSchema.optional(),
24
+ xSearch: XSearchOptions$outboundSchema.optional(),
23
25
  }).transform((v) => {
24
26
  return remap$(v, {
25
27
  allowedDomains: "allowed_domains",
@@ -30,6 +32,7 @@ export const WebSearchServerToolConfig$outboundSchema = z.object({
30
32
  maxUses: "max_uses",
31
33
  searchContextSize: "search_context_size",
32
34
  userLocation: "user_location",
35
+ xSearch: "x_search",
33
36
  });
34
37
  });
35
38
  export function webSearchServerToolConfigToJSON(webSearchServerToolConfig) {
@@ -0,0 +1,49 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { RFCDate } from "../types/rfcdate.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ /**
6
+ * Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.
7
+ */
8
+ export type XSearchOptions = {
9
+ /**
10
+ * Only include posts from these X handles (max 20). Cannot be used with excluded_x_handles.
11
+ */
12
+ allowedXHandles?: Array<string> | undefined;
13
+ /**
14
+ * Analyze images attached to matching posts.
15
+ */
16
+ enableImageUnderstanding?: boolean | undefined;
17
+ /**
18
+ * Analyze videos attached to matching posts.
19
+ */
20
+ enableVideoUnderstanding?: boolean | undefined;
21
+ /**
22
+ * Exclude posts from these X handles (max 20). Cannot be used with allowed_x_handles.
23
+ */
24
+ excludedXHandles?: Array<string> | undefined;
25
+ /**
26
+ * Start of the post date range (ISO 8601 date, e.g. "2025-01-01").
27
+ */
28
+ fromDate?: RFCDate | undefined;
29
+ /**
30
+ * End of the post date range (ISO 8601 date, e.g. "2025-12-31").
31
+ */
32
+ toDate?: RFCDate | undefined;
33
+ };
34
+ /** @internal */
35
+ export declare const XSearchOptions$inboundSchema: z.ZodType<XSearchOptions, unknown>;
36
+ /** @internal */
37
+ export type XSearchOptions$Outbound = {
38
+ allowed_x_handles?: Array<string> | undefined;
39
+ enable_image_understanding?: boolean | undefined;
40
+ enable_video_understanding?: boolean | undefined;
41
+ excluded_x_handles?: Array<string> | undefined;
42
+ from_date?: string | undefined;
43
+ to_date?: string | undefined;
44
+ };
45
+ /** @internal */
46
+ export declare const XSearchOptions$outboundSchema: z.ZodType<XSearchOptions$Outbound, XSearchOptions>;
47
+ export declare function xSearchOptionsToJSON(xSearchOptions: XSearchOptions): string;
48
+ export declare function xSearchOptionsFromJSON(jsonString: string): SafeParseResult<XSearchOptions, SDKValidationError>;
49
+ //# sourceMappingURL=xsearchoptions.d.ts.map
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d7a145785d12
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { RFCDate } from "../types/rfcdate.js";
9
+ /** @internal */
10
+ export const XSearchOptions$inboundSchema = z.object({
11
+ allowed_x_handles: z.array(z.string()).optional(),
12
+ enable_image_understanding: z.boolean().optional(),
13
+ enable_video_understanding: z.boolean().optional(),
14
+ excluded_x_handles: z.array(z.string()).optional(),
15
+ from_date: z.string().transform(v => new RFCDate(v)).optional(),
16
+ to_date: z.string().transform(v => new RFCDate(v)).optional(),
17
+ }).transform((v) => {
18
+ return remap$(v, {
19
+ "allowed_x_handles": "allowedXHandles",
20
+ "enable_image_understanding": "enableImageUnderstanding",
21
+ "enable_video_understanding": "enableVideoUnderstanding",
22
+ "excluded_x_handles": "excludedXHandles",
23
+ "from_date": "fromDate",
24
+ "to_date": "toDate",
25
+ });
26
+ });
27
+ /** @internal */
28
+ export const XSearchOptions$outboundSchema = z.object({
29
+ allowedXHandles: z.array(z.string()).optional(),
30
+ enableImageUnderstanding: z.boolean().optional(),
31
+ enableVideoUnderstanding: z.boolean().optional(),
32
+ excludedXHandles: z.array(z.string()).optional(),
33
+ fromDate: z.custom(x => x instanceof RFCDate).transform(v => v.toString()).optional(),
34
+ toDate: z.custom(x => x instanceof RFCDate).transform(v => v.toString()).optional(),
35
+ }).transform((v) => {
36
+ return remap$(v, {
37
+ allowedXHandles: "allowed_x_handles",
38
+ enableImageUnderstanding: "enable_image_understanding",
39
+ enableVideoUnderstanding: "enable_video_understanding",
40
+ excludedXHandles: "excluded_x_handles",
41
+ fromDate: "from_date",
42
+ toDate: "to_date",
43
+ });
44
+ });
45
+ export function xSearchOptionsToJSON(xSearchOptions) {
46
+ return JSON.stringify(XSearchOptions$outboundSchema.parse(xSearchOptions));
47
+ }
48
+ export function xSearchOptionsFromJSON(jsonString) {
49
+ return safeParse(jsonString, (x) => XSearchOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'XSearchOptions' from JSON`);
50
+ }
51
+ //# sourceMappingURL=xsearchoptions.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.3.9",
5
+ "version": "1.3.11",
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.3.9",
3
+ "version": "1.3.11",
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
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -73,14 +73,14 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "compile": "tsc",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test:e2e": "vitest --run --project e2e",
79
- "test:watch": "vitest --watch --project unit",
80
- "typecheck:transit": "exit 0",
81
76
  "prepare": "npm run build",
82
77
  "test": "vitest --run --project unit",
78
+ "test:e2e": "vitest --run --project e2e",
83
79
  "test:transit": "exit 0",
80
+ "typecheck:transit": "exit 0",
81
+ "compile": "tsc",
82
+ "postinstall": "node scripts/check-types.js || true",
83
+ "test:watch": "vitest --watch --project unit",
84
84
  "typecheck": "tsc --noEmit"
85
85
  },
86
86
  "peerDependencies": {},