@openrouter/sdk 1.5.27 → 1.5.28

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.5.27";
53
+ readonly sdkVersion: "1.5.28";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.27 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.28 2.950.13 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.5.27",
32
+ sdkVersion: "1.5.28",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.27 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.28 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -131,6 +131,18 @@ export type Usage = {
131
131
  */
132
132
  serverToolUseDetails?: ServerToolUseDetails | null | undefined;
133
133
  };
134
+ export declare const OpenResponsesResultCyber: {
135
+ readonly Standard: "standard";
136
+ readonly DaybreakBlue: "daybreak_blue";
137
+ readonly DaybreakRed: "daybreak_red";
138
+ };
139
+ export type OpenResponsesResultCyber = OpenEnum<typeof OpenResponsesResultCyber>;
140
+ /**
141
+ * Access program the upstream provider reported for this response (OpenAI `access_programs`). `null` when the provider reported none, including OpenAI's implicit Standard program.
142
+ */
143
+ export type OpenResponsesResultAccessPrograms = {
144
+ cyber: OpenResponsesResultCyber;
145
+ };
134
146
  /**
135
147
  * Complete non-streaming response from the Responses API
136
148
  */
@@ -215,6 +227,10 @@ export type OpenResponsesResult = {
215
227
  */
216
228
  usage?: Usage | null | undefined;
217
229
  user?: string | null | undefined;
230
+ /**
231
+ * Access program the upstream provider reported for this response (OpenAI `access_programs`). `null` when the provider reported none, including OpenAI's implicit Standard program.
232
+ */
233
+ accessPrograms?: OpenResponsesResultAccessPrograms | null | undefined;
218
234
  /**
219
235
  * Beta. The result of the alignment plugin for this request; the shape may change.
220
236
  */
@@ -252,6 +268,11 @@ export declare function usageCostDetailsFromJSON(jsonString: string): SafeParseR
252
268
  export declare const Usage$inboundSchema: z.ZodType<Usage, unknown>;
253
269
  export declare function usageFromJSON(jsonString: string): SafeParseResult<Usage, SDKValidationError>;
254
270
  /** @internal */
271
+ export declare const OpenResponsesResultCyber$inboundSchema: z.ZodType<OpenResponsesResultCyber, unknown>;
272
+ /** @internal */
273
+ export declare const OpenResponsesResultAccessPrograms$inboundSchema: z.ZodType<OpenResponsesResultAccessPrograms, unknown>;
274
+ export declare function openResponsesResultAccessProgramsFromJSON(jsonString: string): SafeParseResult<OpenResponsesResultAccessPrograms, SDKValidationError>;
275
+ /** @internal */
255
276
  export declare const OpenResponsesResult$inboundSchema: z.ZodType<OpenResponsesResult, unknown>;
256
277
  export declare function openResponsesResultFromJSON(jsonString: string): SafeParseResult<OpenResponsesResult, SDKValidationError>;
257
278
  //# sourceMappingURL=openresponsesresult.d.ts.map
@@ -44,6 +44,11 @@ export const OpenResponsesResultAllowedCaller = {
44
44
  Direct: "direct",
45
45
  Programmatic: "programmatic",
46
46
  };
47
+ export const OpenResponsesResultCyber = {
48
+ Standard: "standard",
49
+ DaybreakBlue: "daybreak_blue",
50
+ DaybreakRed: "daybreak_red",
51
+ };
47
52
  /** @internal */
48
53
  export const OpenResponsesResultObject$inboundSchema = z.enum(OpenResponsesResultObject);
49
54
  /** @internal */
@@ -159,6 +164,15 @@ export function usageFromJSON(jsonString) {
159
164
  return safeParse(jsonString, (x) => Usage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Usage' from JSON`);
160
165
  }
161
166
  /** @internal */
167
+ export const OpenResponsesResultCyber$inboundSchema = openEnums.inboundSchema(OpenResponsesResultCyber);
168
+ /** @internal */
169
+ export const OpenResponsesResultAccessPrograms$inboundSchema = z.object({
170
+ cyber: OpenResponsesResultCyber$inboundSchema,
171
+ });
172
+ export function openResponsesResultAccessProgramsFromJSON(jsonString) {
173
+ return safeParse(jsonString, (x) => OpenResponsesResultAccessPrograms$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesResultAccessPrograms' from JSON`);
174
+ }
175
+ /** @internal */
162
176
  export const OpenResponsesResult$inboundSchema = z.object({
163
177
  background: z.nullable(z.boolean()).optional(),
164
178
  completed_at: z.nullable(z.int()),
@@ -211,6 +225,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
211
225
  truncation: z.nullable(Truncation$inboundSchema).optional(),
212
226
  usage: z.nullable(z.lazy(() => Usage$inboundSchema)).optional(),
213
227
  user: z.nullable(z.string()).optional(),
228
+ access_programs: z.nullable(z.lazy(() => OpenResponsesResultAccessPrograms$inboundSchema)).optional(),
214
229
  alignment: Alignment$inboundSchema.optional(),
215
230
  error_type: ApiErrorType$inboundSchema.optional(),
216
231
  openrouter_metadata: OpenRouterMetadata$inboundSchema.optional(),
@@ -234,6 +249,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
234
249
  "tool_choice": "toolChoice",
235
250
  "top_logprobs": "topLogprobs",
236
251
  "top_p": "topP",
252
+ "access_programs": "accessPrograms",
237
253
  "error_type": "errorType",
238
254
  "openrouter_metadata": "openrouterMetadata",
239
255
  "safeguard_results": "safeguardResults",
@@ -60,6 +60,18 @@ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchserve
60
60
  import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
61
61
  import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
62
62
  import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
63
+ export declare const ResponsesRequestCyber: {
64
+ readonly Standard: "standard";
65
+ readonly DaybreakBlue: "daybreak_blue";
66
+ readonly DaybreakRed: "daybreak_red";
67
+ };
68
+ export type ResponsesRequestCyber = OpenEnum<typeof ResponsesRequestCyber>;
69
+ /**
70
+ * OpenAI access programs for this request. `cyber` selects the Cyber access program: `standard`, `daybreak_blue`, or `daybreak_red`. A program other than `standard` is supported only on BYOK requests that run on your own OpenAI key enrolled in that program; any other endpoint, including OpenRouter's own OpenAI credentials, rejects it with a 400 error. Requests on OpenRouter's OpenAI credentials always run `standard`. Omit the field unless your key is enrolled in a Daybreak program.
71
+ */
72
+ export type ResponsesRequestAccessPrograms = {
73
+ cyber?: ResponsesRequestCyber | undefined;
74
+ };
63
75
  export type ResponsesRequestPlugin = AlignmentPlugin | ArmorPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
64
76
  export type ReasoningConfig = {
65
77
  /**
@@ -183,6 +195,10 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | (PreviewW
183
195
  * Request schema for Responses endpoint
184
196
  */
185
197
  export type ResponsesRequest = {
198
+ /**
199
+ * OpenAI access programs for this request. `cyber` selects the Cyber access program: `standard`, `daybreak_blue`, or `daybreak_red`. A program other than `standard` is supported only on BYOK requests that run on your own OpenAI key enrolled in that program; any other endpoint, including OpenRouter's own OpenAI credentials, rejects it with a 400 error. Requests on OpenRouter's OpenAI credentials always run `standard`. Omit the field unless your key is enrolled in a Daybreak program.
200
+ */
201
+ accessPrograms?: ResponsesRequestAccessPrograms | undefined;
186
202
  background?: boolean | null | undefined;
187
203
  /**
188
204
  * Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
@@ -347,6 +363,15 @@ export type ResponsesRequest = {
347
363
  user?: string | undefined;
348
364
  };
349
365
  /** @internal */
366
+ export declare const ResponsesRequestCyber$outboundSchema: z.ZodType<string, ResponsesRequestCyber>;
367
+ /** @internal */
368
+ export type ResponsesRequestAccessPrograms$Outbound = {
369
+ cyber?: string | undefined;
370
+ };
371
+ /** @internal */
372
+ export declare const ResponsesRequestAccessPrograms$outboundSchema: z.ZodType<ResponsesRequestAccessPrograms$Outbound, ResponsesRequestAccessPrograms>;
373
+ export declare function responsesRequestAccessProgramsToJSON(responsesRequestAccessPrograms: ResponsesRequestAccessPrograms): string;
374
+ /** @internal */
350
375
  export type ResponsesRequestPlugin$Outbound = AlignmentPlugin$Outbound | ArmorPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
351
376
  /** @internal */
352
377
  export declare const ResponsesRequestPlugin$outboundSchema: z.ZodType<ResponsesRequestPlugin$Outbound, ResponsesRequestPlugin>;
@@ -452,6 +477,7 @@ export declare const ResponsesRequestToolUnion$outboundSchema: z.ZodType<Respons
452
477
  export declare function responsesRequestToolUnionToJSON(responsesRequestToolUnion: ResponsesRequestToolUnion): string;
453
478
  /** @internal */
454
479
  export type ResponsesRequest$Outbound = {
480
+ access_programs?: ResponsesRequestAccessPrograms$Outbound | undefined;
455
481
  background?: boolean | null | undefined;
456
482
  cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
457
483
  debug?: ChatDebugOptions$Outbound | undefined;
@@ -65,6 +65,11 @@ import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
65
65
  import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
66
66
  import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
67
67
  import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
68
+ export const ResponsesRequestCyber = {
69
+ Standard: "standard",
70
+ DaybreakBlue: "daybreak_blue",
71
+ DaybreakRed: "daybreak_red",
72
+ };
68
73
  /**
69
74
  * The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints.
70
75
  */
@@ -82,6 +87,15 @@ export const ResponsesRequestAllowedCaller = {
82
87
  Programmatic: "programmatic",
83
88
  };
84
89
  /** @internal */
90
+ export const ResponsesRequestCyber$outboundSchema = openEnums.outboundSchema(ResponsesRequestCyber);
91
+ /** @internal */
92
+ export const ResponsesRequestAccessPrograms$outboundSchema = z.object({
93
+ cyber: ResponsesRequestCyber$outboundSchema.optional(),
94
+ });
95
+ export function responsesRequestAccessProgramsToJSON(responsesRequestAccessPrograms) {
96
+ return JSON.stringify(ResponsesRequestAccessPrograms$outboundSchema.parse(responsesRequestAccessPrograms));
97
+ }
98
+ /** @internal */
85
99
  export const ResponsesRequestPlugin$outboundSchema = z.union([
86
100
  AlignmentPlugin$outboundSchema,
87
101
  ArmorPlugin$outboundSchema,
@@ -183,6 +197,8 @@ export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
183
197
  }
184
198
  /** @internal */
185
199
  export const ResponsesRequest$outboundSchema = z.object({
200
+ accessPrograms: z.lazy(() => ResponsesRequestAccessPrograms$outboundSchema)
201
+ .optional(),
186
202
  background: z.nullable(z.boolean()).optional(),
187
203
  cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
188
204
  debug: ChatDebugOptions$outboundSchema.optional(),
@@ -272,6 +288,7 @@ export const ResponsesRequest$outboundSchema = z.object({
272
288
  user: z.string().optional(),
273
289
  }).transform((v) => {
274
290
  return remap$(v, {
291
+ accessPrograms: "access_programs",
275
292
  cacheControl: "cache_control",
276
293
  deferredTools: "deferred_tools",
277
294
  frequencyPenalty: "frequency_penalty",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.27",
5
+ "version": "1.5.28",
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.5.27",
3
+ "version": "1.5.28",
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 && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "test:e2e": "vitest --run --project e2e",
77
76
  "typecheck": "tsc --noEmit",
78
- "typecheck:transit": "exit 0",
79
77
  "compile": "tsc && node scripts/unbarrel-imports.js",
80
78
  "postinstall": "node scripts/check-types.js || true",
81
- "prepare": "npm run build",
82
79
  "test:transit": "exit 0",
83
- "test:watch": "vitest --watch --project unit",
84
- "test": "vitest --run --project unit"
80
+ "typecheck:transit": "exit 0",
81
+ "prepare": "npm run build",
82
+ "test": "vitest --run --project unit",
83
+ "test:e2e": "vitest --run --project e2e",
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87