@openrouter/sdk 0.13.36 → 0.13.38

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.
Files changed (34) hide show
  1. package/esm/funcs/generationsSubmitFeedback.d.ts +19 -0
  2. package/esm/funcs/generationsSubmitFeedback.js +100 -0
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/lib/conversation-state.d.ts +1 -1
  6. package/esm/lib/turn-context.d.ts +1 -1
  7. package/esm/models/byokproviderslug.d.ts +1 -1
  8. package/esm/models/byokproviderslug.js +1 -1
  9. package/esm/models/imagegenerationrequest.d.ts +2 -2
  10. package/esm/models/imagegenerationrequest.js +1 -2
  11. package/esm/models/imagegenerationservertool.d.ts +2 -22
  12. package/esm/models/imagegenerationservertool.js +4 -26
  13. package/esm/models/index.d.ts +2 -0
  14. package/esm/models/index.js +2 -0
  15. package/esm/models/operations/index.d.ts +1 -0
  16. package/esm/models/operations/index.js +1 -0
  17. package/esm/models/operations/listbyokkeys.d.ts +1 -1
  18. package/esm/models/operations/listbyokkeys.js +1 -1
  19. package/esm/models/operations/submitgenerationfeedback.d.ts +56 -0
  20. package/esm/models/operations/submitgenerationfeedback.js +23 -0
  21. package/esm/models/provideroptions.d.ts +2 -2
  22. package/esm/models/provideroptions.js +1 -2
  23. package/esm/models/responseserrorfield.d.ts +1 -0
  24. package/esm/models/responseserrorfield.js +1 -0
  25. package/esm/models/submitgenerationfeedbackrequest.d.ts +47 -0
  26. package/esm/models/submitgenerationfeedbackrequest.js +36 -0
  27. package/esm/models/submitgenerationfeedbackresponse.d.ts +22 -0
  28. package/esm/models/submitgenerationfeedbackresponse.js +21 -0
  29. package/esm/models/videogenerationrequest.d.ts +2 -2
  30. package/esm/models/videogenerationrequest.js +1 -2
  31. package/esm/sdk/generations.d.ts +7 -0
  32. package/esm/sdk/generations.js +10 -0
  33. package/jsr.json +1 -1
  34. package/package.json +7 -7
@@ -0,0 +1,19 @@
1
+ import { OpenRouterCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
+ import * as errors from "../models/errors/index.js";
5
+ import { OpenRouterError } from "../models/errors/openroutererror.js";
6
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import * as models from "../models/index.js";
9
+ import * as operations from "../models/operations/index.js";
10
+ import { APIPromise } from "../types/async.js";
11
+ import { Result } from "../types/fp.js";
12
+ /**
13
+ * Submit feedback for a generation
14
+ *
15
+ * @remarks
16
+ * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
+ */
18
+ export declare function generationsSubmitFeedback(client: OpenRouterCore, request: operations.SubmitGenerationFeedbackRequest, options?: RequestOptions): APIPromise<Result<models.SubmitGenerationFeedbackResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
+ //# sourceMappingURL=generationsSubmitFeedback.d.ts.map
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7164852deaac
4
+ */
5
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as errors from "../models/errors/index.js";
13
+ import * as models from "../models/index.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { APIPromise } from "../types/async.js";
16
+ /**
17
+ * Submit feedback for a generation
18
+ *
19
+ * @remarks
20
+ * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
+ */
22
+ export function generationsSubmitFeedback(client, request, options) {
23
+ return new APIPromise($do(client, request, options));
24
+ }
25
+ async function $do(client, request, options) {
26
+ const parsed = safeParse(request, (value) => operations.SubmitGenerationFeedbackRequest$outboundSchema.parse(value), "Input validation failed");
27
+ if (!parsed.ok) {
28
+ return [parsed, { status: "invalid" }];
29
+ }
30
+ const payload = parsed.value;
31
+ const body = encodeJSON("body", payload.SubmitGenerationFeedbackRequest, {
32
+ explode: true,
33
+ });
34
+ const path = pathToFunc("/generation/feedback")();
35
+ const headers = new Headers(compactMap({
36
+ "Content-Type": "application/json",
37
+ Accept: "application/json",
38
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
39
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
40
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
41
+ }));
42
+ const secConfig = await extractSecurity(client._options.apiKey);
43
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
44
+ const requestSecurity = resolveGlobalSecurity(securityInput);
45
+ const context = {
46
+ options: client._options,
47
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
48
+ operationID: "submitGenerationFeedback",
49
+ oAuth2Scopes: null,
50
+ resolvedSecurity: requestSecurity,
51
+ securitySource: client._options.apiKey,
52
+ retryConfig: options?.retries
53
+ || client._options.retryConfig
54
+ || {
55
+ strategy: "backoff",
56
+ backoff: {
57
+ initialInterval: 500,
58
+ maxInterval: 60000,
59
+ exponent: 1.5,
60
+ maxElapsedTime: 3600000,
61
+ },
62
+ retryConnectionErrors: true,
63
+ }
64
+ || { strategy: "none" },
65
+ retryCodes: options?.retryCodes || ["5XX"],
66
+ };
67
+ const requestRes = client._createRequest(context, {
68
+ security: requestSecurity,
69
+ method: "POST",
70
+ baseURL: options?.serverURL,
71
+ path: path,
72
+ headers: headers,
73
+ body: body,
74
+ userAgent: client._options.userAgent,
75
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
76
+ }, options);
77
+ if (!requestRes.ok) {
78
+ return [requestRes, { status: "invalid" }];
79
+ }
80
+ const req = requestRes.value;
81
+ const doResult = await client._do(req, {
82
+ context,
83
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
84
+ retryConfig: context.retryConfig,
85
+ retryCodes: context.retryCodes,
86
+ });
87
+ if (!doResult.ok) {
88
+ return [doResult, { status: "request-error", request: req }];
89
+ }
90
+ const response = doResult.value;
91
+ const responseFields = {
92
+ HttpMeta: { Response: response, Request: req },
93
+ };
94
+ const [result] = await M.match(M.json(200, models.SubmitGenerationFeedbackResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
95
+ if (!result.ok) {
96
+ return [result, { status: "complete", request: req, response }];
97
+ }
98
+ return [result, { status: "complete", request: req, response }];
99
+ }
100
+ //# sourceMappingURL=generationsSubmitFeedback.js.map
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
49
49
  export declare const SDK_METADATA: {
50
50
  readonly language: "typescript";
51
51
  readonly openapiDocVersion: "1.0.0";
52
- readonly sdkVersion: "0.13.36";
52
+ readonly sdkVersion: "0.13.38";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.36 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.38 2.884.4 1.0.0 @openrouter/sdk";
55
55
  };
56
56
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
26
26
  export const SDK_METADATA = {
27
27
  language: "typescript",
28
28
  openapiDocVersion: "1.0.0",
29
- sdkVersion: "0.13.36",
29
+ sdkVersion: "0.13.38",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.36 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.38 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -18,7 +18,7 @@ export declare function updateState<TTools extends readonly Tool[] = readonly To
18
18
  /**
19
19
  * Append new items to the message history
20
20
  */
21
- export declare function appendToMessages(current: models.InputsUnion, newItems: models.BaseInputsUnion[]): models.InputsUnion;
21
+ export declare function appendToMessages(current: models.InputsUnion, newItems: models.InputsUnion1[]): models.InputsUnion;
22
22
  /**
23
23
  * Check if a tool call requires approval
24
24
  * @param toolCall - The tool call to check
@@ -46,5 +46,5 @@ export declare function buildTurnContext(options: BuildTurnContextOptions): Turn
46
46
  * // Returns: [{ role: "user", content: "Hello!" }]
47
47
  * ```
48
48
  */
49
- export declare function normalizeInputToArray(input: models.InputsUnion): Array<models.BaseInputsUnion>;
49
+ export declare function normalizeInputToArray(input: models.InputsUnion): Array<models.InputsUnion1>;
50
50
  //# sourceMappingURL=turn-context.d.ts.map
@@ -75,7 +75,7 @@ export declare const BYOKProviderSlug: {
75
75
  readonly Recraft: "recraft";
76
76
  readonly Reka: "reka";
77
77
  readonly Relace: "relace";
78
- readonly SakanaAi: "sakana-ai";
78
+ readonly Sakana: "sakana";
79
79
  readonly Sambanova: "sambanova";
80
80
  readonly Seed: "seed";
81
81
  readonly Siliconflow: "siliconflow";
@@ -78,7 +78,7 @@ export const BYOKProviderSlug = {
78
78
  Recraft: "recraft",
79
79
  Reka: "reka",
80
80
  Relace: "relace",
81
- SakanaAi: "sakana-ai",
81
+ Sakana: "sakana",
82
82
  Sambanova: "sambanova",
83
83
  Seed: "seed",
84
84
  Siliconflow: "siliconflow",
@@ -352,7 +352,7 @@ export type ImageGenerationRequestOptions = {
352
352
  replicate?: {
353
353
  [k: string]: any | null;
354
354
  } | undefined;
355
- sakanaAi?: {
355
+ sakana?: {
356
356
  [k: string]: any | null;
357
357
  } | undefined;
358
358
  sambanova?: {
@@ -814,7 +814,7 @@ export type ImageGenerationRequestOptions$Outbound = {
814
814
  replicate?: {
815
815
  [k: string]: any | null;
816
816
  } | undefined;
817
- "sakana-ai"?: {
817
+ sakana?: {
818
818
  [k: string]: any | null;
819
819
  } | undefined;
820
820
  sambanova?: {
@@ -173,7 +173,7 @@ export const ImageGenerationRequestOptions$outboundSchema = z.object({
173
173
  reka: z.record(z.string(), z.nullable(z.any())).optional(),
174
174
  relace: z.record(z.string(), z.nullable(z.any())).optional(),
175
175
  replicate: z.record(z.string(), z.nullable(z.any())).optional(),
176
- sakanaAi: z.record(z.string(), z.nullable(z.any())).optional(),
176
+ sakana: z.record(z.string(), z.nullable(z.any())).optional(),
177
177
  sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
178
178
  sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
179
179
  seed: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -216,7 +216,6 @@ export const ImageGenerationRequestOptions$outboundSchema = z.object({
216
216
  mancerOld: "mancer-old",
217
217
  nexAgi: "nex-agi",
218
218
  openInference: "open-inference",
219
- sakanaAi: "sakana-ai",
220
219
  sambanovaCloaked: "sambanova-cloaked",
221
220
  sfCompute: "sf-compute",
222
221
  togetherLite: "together-lite",
@@ -17,11 +17,6 @@ export type InputImageMask = {
17
17
  fileId?: string | undefined;
18
18
  imageUrl?: string | undefined;
19
19
  };
20
- export declare const ModelEnum: {
21
- readonly GptImage1: "gpt-image-1";
22
- readonly GptImage1Mini: "gpt-image-1-mini";
23
- };
24
- export type ModelEnum = OpenEnum<typeof ModelEnum>;
25
20
  export declare const Moderation: {
26
21
  readonly Auto: "auto";
27
22
  readonly Low: "low";
@@ -40,13 +35,6 @@ export declare const ImageGenerationServerToolQuality: {
40
35
  readonly Auto: "auto";
41
36
  };
42
37
  export type ImageGenerationServerToolQuality = OpenEnum<typeof ImageGenerationServerToolQuality>;
43
- export declare const Size: {
44
- readonly OneThousandAndTwentyFourx1024: "1024x1024";
45
- readonly OneThousandAndTwentyFourx1536: "1024x1536";
46
- readonly OneThousandFiveHundredAndThirtySixx1024: "1536x1024";
47
- readonly Auto: "auto";
48
- };
49
- export type Size = OpenEnum<typeof Size>;
50
38
  /**
51
39
  * Image generation tool configuration
52
40
  */
@@ -54,13 +42,13 @@ export type ImageGenerationServerTool = {
54
42
  background?: ImageGenerationServerToolBackground | undefined;
55
43
  inputFidelity?: InputFidelity | null | undefined;
56
44
  inputImageMask?: InputImageMask | undefined;
57
- model?: ModelEnum | undefined;
45
+ model?: string | undefined;
58
46
  moderation?: Moderation | undefined;
59
47
  outputCompression?: number | undefined;
60
48
  outputFormat?: ImageGenerationServerToolOutputFormat | undefined;
61
49
  partialImages?: number | undefined;
62
50
  quality?: ImageGenerationServerToolQuality | undefined;
63
- size?: Size | undefined;
51
+ size?: string | undefined;
64
52
  type: "image_generation";
65
53
  };
66
54
  /** @internal */
@@ -83,10 +71,6 @@ export declare const InputImageMask$outboundSchema: z.ZodType<InputImageMask$Out
83
71
  export declare function inputImageMaskToJSON(inputImageMask: InputImageMask): string;
84
72
  export declare function inputImageMaskFromJSON(jsonString: string): SafeParseResult<InputImageMask, SDKValidationError>;
85
73
  /** @internal */
86
- export declare const ModelEnum$inboundSchema: z.ZodType<ModelEnum, unknown>;
87
- /** @internal */
88
- export declare const ModelEnum$outboundSchema: z.ZodType<string, ModelEnum>;
89
- /** @internal */
90
74
  export declare const Moderation$inboundSchema: z.ZodType<Moderation, unknown>;
91
75
  /** @internal */
92
76
  export declare const Moderation$outboundSchema: z.ZodType<string, Moderation>;
@@ -99,10 +83,6 @@ export declare const ImageGenerationServerToolQuality$inboundSchema: z.ZodType<I
99
83
  /** @internal */
100
84
  export declare const ImageGenerationServerToolQuality$outboundSchema: z.ZodType<string, ImageGenerationServerToolQuality>;
101
85
  /** @internal */
102
- export declare const Size$inboundSchema: z.ZodType<Size, unknown>;
103
- /** @internal */
104
- export declare const Size$outboundSchema: z.ZodType<string, Size>;
105
- /** @internal */
106
86
  export declare const ImageGenerationServerTool$inboundSchema: z.ZodType<ImageGenerationServerTool, unknown>;
107
87
  /** @internal */
108
88
  export type ImageGenerationServerTool$Outbound = {
@@ -15,10 +15,6 @@ export const InputFidelity = {
15
15
  High: "high",
16
16
  Low: "low",
17
17
  };
18
- export const ModelEnum = {
19
- GptImage1: "gpt-image-1",
20
- GptImage1Mini: "gpt-image-1-mini",
21
- };
22
18
  export const Moderation = {
23
19
  Auto: "auto",
24
20
  Low: "low",
@@ -34,12 +30,6 @@ export const ImageGenerationServerToolQuality = {
34
30
  High: "high",
35
31
  Auto: "auto",
36
32
  };
37
- export const Size = {
38
- OneThousandAndTwentyFourx1024: "1024x1024",
39
- OneThousandAndTwentyFourx1536: "1024x1536",
40
- OneThousandFiveHundredAndThirtySixx1024: "1536x1024",
41
- Auto: "auto",
42
- };
43
33
  /** @internal */
44
34
  export const ImageGenerationServerToolBackground$inboundSchema = openEnums.inboundSchema(ImageGenerationServerToolBackground);
45
35
  /** @internal */
@@ -75,12 +65,6 @@ export function inputImageMaskFromJSON(jsonString) {
75
65
  return safeParse(jsonString, (x) => InputImageMask$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputImageMask' from JSON`);
76
66
  }
77
67
  /** @internal */
78
- export const ModelEnum$inboundSchema = openEnums
79
- .inboundSchema(ModelEnum);
80
- /** @internal */
81
- export const ModelEnum$outboundSchema = openEnums
82
- .outboundSchema(ModelEnum);
83
- /** @internal */
84
68
  export const Moderation$inboundSchema = openEnums.inboundSchema(Moderation);
85
69
  /** @internal */
86
70
  export const Moderation$outboundSchema = openEnums.outboundSchema(Moderation);
@@ -93,23 +77,17 @@ export const ImageGenerationServerToolQuality$inboundSchema = openEnums.inboundS
93
77
  /** @internal */
94
78
  export const ImageGenerationServerToolQuality$outboundSchema = openEnums.outboundSchema(ImageGenerationServerToolQuality);
95
79
  /** @internal */
96
- export const Size$inboundSchema = openEnums
97
- .inboundSchema(Size);
98
- /** @internal */
99
- export const Size$outboundSchema = openEnums
100
- .outboundSchema(Size);
101
- /** @internal */
102
80
  export const ImageGenerationServerTool$inboundSchema = z.object({
103
81
  background: ImageGenerationServerToolBackground$inboundSchema.optional(),
104
82
  input_fidelity: z.nullable(InputFidelity$inboundSchema).optional(),
105
83
  input_image_mask: z.lazy(() => InputImageMask$inboundSchema).optional(),
106
- model: ModelEnum$inboundSchema.optional(),
84
+ model: z.string().optional(),
107
85
  moderation: Moderation$inboundSchema.optional(),
108
86
  output_compression: z.int().optional(),
109
87
  output_format: ImageGenerationServerToolOutputFormat$inboundSchema.optional(),
110
88
  partial_images: z.int().optional(),
111
89
  quality: ImageGenerationServerToolQuality$inboundSchema.optional(),
112
- size: Size$inboundSchema.optional(),
90
+ size: z.string().optional(),
113
91
  type: z.literal("image_generation"),
114
92
  }).transform((v) => {
115
93
  return remap$(v, {
@@ -125,13 +103,13 @@ export const ImageGenerationServerTool$outboundSchema = z.object({
125
103
  background: ImageGenerationServerToolBackground$outboundSchema.optional(),
126
104
  inputFidelity: z.nullable(InputFidelity$outboundSchema).optional(),
127
105
  inputImageMask: z.lazy(() => InputImageMask$outboundSchema).optional(),
128
- model: ModelEnum$outboundSchema.optional(),
106
+ model: z.string().optional(),
129
107
  moderation: Moderation$outboundSchema.optional(),
130
108
  outputCompression: z.int().optional(),
131
109
  outputFormat: ImageGenerationServerToolOutputFormat$outboundSchema.optional(),
132
110
  partialImages: z.int().optional(),
133
111
  quality: ImageGenerationServerToolQuality$outboundSchema.optional(),
134
- size: Size$outboundSchema.optional(),
112
+ size: z.string().optional(),
135
113
  type: z.literal("image_generation"),
136
114
  }).transform((v) => {
137
115
  return remap$(v, {
@@ -481,6 +481,8 @@ export * from "./subagentnestedtool.js";
481
481
  export * from "./subagentreasoning.js";
482
482
  export * from "./subagentservertoolconfig.js";
483
483
  export * from "./subagentservertoolopenrouter.js";
484
+ export * from "./submitgenerationfeedbackrequest.js";
485
+ export * from "./submitgenerationfeedbackresponse.js";
484
486
  export * from "./taskclassificationitem.js";
485
487
  export * from "./taskclassificationmacrocategory.js";
486
488
  export * from "./taskclassificationmodel.js";
@@ -485,6 +485,8 @@ export * from "./subagentnestedtool.js";
485
485
  export * from "./subagentreasoning.js";
486
486
  export * from "./subagentservertoolconfig.js";
487
487
  export * from "./subagentservertoolopenrouter.js";
488
+ export * from "./submitgenerationfeedbackrequest.js";
489
+ export * from "./submitgenerationfeedbackresponse.js";
488
490
  export * from "./taskclassificationitem.js";
489
491
  export * from "./taskclassificationmacrocategory.js";
490
492
  export * from "./taskclassificationmodel.js";
@@ -78,6 +78,7 @@ export * from "./listworkspacemembers.js";
78
78
  export * from "./listworkspaces.js";
79
79
  export * from "./queryanalytics.js";
80
80
  export * from "./sendchatcompletionrequest.js";
81
+ export * from "./submitgenerationfeedback.js";
81
82
  export * from "./updatebyokkey.js";
82
83
  export * from "./updateguardrail.js";
83
84
  export * from "./updatekeys.js";
@@ -82,6 +82,7 @@ export * from "./listworkspacemembers.js";
82
82
  export * from "./listworkspaces.js";
83
83
  export * from "./queryanalytics.js";
84
84
  export * from "./sendchatcompletionrequest.js";
85
+ export * from "./submitgenerationfeedback.js";
85
86
  export * from "./updatebyokkey.js";
86
87
  export * from "./updateguardrail.js";
87
88
  export * from "./updatekeys.js";
@@ -99,7 +99,7 @@ export declare const Provider: {
99
99
  readonly Recraft: "recraft";
100
100
  readonly Reka: "reka";
101
101
  readonly Relace: "relace";
102
- readonly SakanaAi: "sakana-ai";
102
+ readonly Sakana: "sakana";
103
103
  readonly Sambanova: "sambanova";
104
104
  readonly Seed: "seed";
105
105
  readonly Siliconflow: "siliconflow";
@@ -82,7 +82,7 @@ export const Provider = {
82
82
  Recraft: "recraft",
83
83
  Reka: "reka",
84
84
  Relace: "relace",
85
- SakanaAi: "sakana-ai",
85
+ Sakana: "sakana",
86
86
  Sambanova: "sambanova",
87
87
  Seed: "seed",
88
88
  Siliconflow: "siliconflow",
@@ -0,0 +1,56 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ export type SubmitGenerationFeedbackGlobals = {
4
+ /**
5
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
6
+ *
7
+ * @remarks
8
+ * This is used to track API usage per application.
9
+ */
10
+ httpReferer?: string | undefined;
11
+ /**
12
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
13
+ *
14
+ * @remarks
15
+ */
16
+ appTitle?: string | undefined;
17
+ /**
18
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
19
+ *
20
+ * @remarks
21
+ */
22
+ appCategories?: string | undefined;
23
+ };
24
+ export type SubmitGenerationFeedbackRequest = {
25
+ /**
26
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
27
+ *
28
+ * @remarks
29
+ * This is used to track API usage per application.
30
+ */
31
+ httpReferer?: string | undefined;
32
+ /**
33
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
34
+ *
35
+ * @remarks
36
+ */
37
+ appTitle?: string | undefined;
38
+ /**
39
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
40
+ *
41
+ * @remarks
42
+ */
43
+ appCategories?: string | undefined;
44
+ submitGenerationFeedbackRequest: models.SubmitGenerationFeedbackRequest;
45
+ };
46
+ /** @internal */
47
+ export type SubmitGenerationFeedbackRequest$Outbound = {
48
+ "HTTP-Referer"?: string | undefined;
49
+ appTitle?: string | undefined;
50
+ appCategories?: string | undefined;
51
+ SubmitGenerationFeedbackRequest: models.SubmitGenerationFeedbackRequest$Outbound;
52
+ };
53
+ /** @internal */
54
+ export declare const SubmitGenerationFeedbackRequest$outboundSchema: z.ZodType<SubmitGenerationFeedbackRequest$Outbound, SubmitGenerationFeedbackRequest>;
55
+ export declare function submitGenerationFeedbackRequestToJSON(submitGenerationFeedbackRequest: SubmitGenerationFeedbackRequest): string;
56
+ //# sourceMappingURL=submitgenerationfeedback.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 0c88d9ca4722
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
+ /** @internal */
9
+ export const SubmitGenerationFeedbackRequest$outboundSchema = z.object({
10
+ httpReferer: z.string().optional(),
11
+ appTitle: z.string().optional(),
12
+ appCategories: z.string().optional(),
13
+ submitGenerationFeedbackRequest: models.SubmitGenerationFeedbackRequest$outboundSchema,
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ httpReferer: "HTTP-Referer",
17
+ submitGenerationFeedbackRequest: "SubmitGenerationFeedbackRequest",
18
+ });
19
+ });
20
+ export function submitGenerationFeedbackRequestToJSON(submitGenerationFeedbackRequest) {
21
+ return JSON.stringify(SubmitGenerationFeedbackRequest$outboundSchema.parse(submitGenerationFeedbackRequest));
22
+ }
23
+ //# sourceMappingURL=submitgenerationfeedback.js.map
@@ -294,7 +294,7 @@ export type ProviderOptions = {
294
294
  replicate?: {
295
295
  [k: string]: any | null;
296
296
  } | undefined;
297
- sakanaAi?: {
297
+ sakana?: {
298
298
  [k: string]: any | null;
299
299
  } | undefined;
300
300
  sambanova?: {
@@ -657,7 +657,7 @@ export type ProviderOptions$Outbound = {
657
657
  replicate?: {
658
658
  [k: string]: any | null;
659
659
  } | undefined;
660
- "sakana-ai"?: {
660
+ sakana?: {
661
661
  [k: string]: any | null;
662
662
  } | undefined;
663
663
  sambanova?: {
@@ -103,7 +103,7 @@ export const ProviderOptions$outboundSchema = z.object({
103
103
  reka: z.record(z.string(), z.nullable(z.any())).optional(),
104
104
  relace: z.record(z.string(), z.nullable(z.any())).optional(),
105
105
  replicate: z.record(z.string(), z.nullable(z.any())).optional(),
106
- sakanaAi: z.record(z.string(), z.nullable(z.any())).optional(),
106
+ sakana: z.record(z.string(), z.nullable(z.any())).optional(),
107
107
  sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
108
108
  sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
109
109
  seed: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -146,7 +146,6 @@ export const ProviderOptions$outboundSchema = z.object({
146
146
  mancerOld: "mancer-old",
147
147
  nexAgi: "nex-agi",
148
148
  openInference: "open-inference",
149
- sakanaAi: "sakana-ai",
150
149
  sambanovaCloaked: "sambanova-cloaked",
151
150
  sfCompute: "sf-compute",
152
151
  togetherLite: "together-lite",
@@ -21,6 +21,7 @@ export declare const Code: {
21
21
  readonly EmptyImageFile: "empty_image_file";
22
22
  readonly FailedToDownloadImage: "failed_to_download_image";
23
23
  readonly ImageFileNotFound: "image_file_not_found";
24
+ readonly BioPolicy: "bio_policy";
24
25
  };
25
26
  export type Code = OpenEnum<typeof Code>;
26
27
  /**
@@ -24,6 +24,7 @@ export const Code = {
24
24
  EmptyImageFile: "empty_image_file",
25
25
  FailedToDownloadImage: "failed_to_download_image",
26
26
  ImageFileNotFound: "image_file_not_found",
27
+ BioPolicy: "bio_policy",
27
28
  };
28
29
  /** @internal */
29
30
  export const Code$inboundSchema = openEnums
@@ -0,0 +1,47 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ /**
4
+ * The category of feedback being reported
5
+ */
6
+ export declare const Category: {
7
+ readonly Latency: "latency";
8
+ readonly Incoherence: "incoherence";
9
+ readonly IncorrectResponse: "incorrect_response";
10
+ readonly Formatting: "formatting";
11
+ readonly Billing: "billing";
12
+ readonly ApiError: "api_error";
13
+ readonly Other: "other";
14
+ };
15
+ /**
16
+ * The category of feedback being reported
17
+ */
18
+ export type Category = OpenEnum<typeof Category>;
19
+ /**
20
+ * Structured feedback about a specific generation
21
+ */
22
+ export type SubmitGenerationFeedbackRequest = {
23
+ /**
24
+ * The category of feedback being reported
25
+ */
26
+ category: Category;
27
+ /**
28
+ * An optional free-text comment describing the feedback
29
+ */
30
+ comment?: string | undefined;
31
+ /**
32
+ * The generation to submit feedback on
33
+ */
34
+ generationId: string;
35
+ };
36
+ /** @internal */
37
+ export declare const Category$outboundSchema: z.ZodType<string, Category>;
38
+ /** @internal */
39
+ export type SubmitGenerationFeedbackRequest$Outbound = {
40
+ category: string;
41
+ comment?: string | undefined;
42
+ generation_id: string;
43
+ };
44
+ /** @internal */
45
+ export declare const SubmitGenerationFeedbackRequest$outboundSchema: z.ZodType<SubmitGenerationFeedbackRequest$Outbound, SubmitGenerationFeedbackRequest>;
46
+ export declare function submitGenerationFeedbackRequestToJSON(submitGenerationFeedbackRequest: SubmitGenerationFeedbackRequest): string;
47
+ //# sourceMappingURL=submitgenerationfeedbackrequest.d.ts.map
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: c8bd4306e20e
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import * as openEnums from "../types/enums.js";
8
+ /**
9
+ * The category of feedback being reported
10
+ */
11
+ export const Category = {
12
+ Latency: "latency",
13
+ Incoherence: "incoherence",
14
+ IncorrectResponse: "incorrect_response",
15
+ Formatting: "formatting",
16
+ Billing: "billing",
17
+ ApiError: "api_error",
18
+ Other: "other",
19
+ };
20
+ /** @internal */
21
+ export const Category$outboundSchema = openEnums
22
+ .outboundSchema(Category);
23
+ /** @internal */
24
+ export const SubmitGenerationFeedbackRequest$outboundSchema = z.object({
25
+ category: Category$outboundSchema,
26
+ comment: z.string().optional(),
27
+ generationId: z.string(),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ generationId: "generation_id",
31
+ });
32
+ });
33
+ export function submitGenerationFeedbackRequestToJSON(submitGenerationFeedbackRequest) {
34
+ return JSON.stringify(SubmitGenerationFeedbackRequest$outboundSchema.parse(submitGenerationFeedbackRequest));
35
+ }
36
+ //# sourceMappingURL=submitgenerationfeedbackrequest.js.map
@@ -0,0 +1,22 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ export type SubmitGenerationFeedbackResponseData = {
5
+ /**
6
+ * Whether the feedback was recorded
7
+ */
8
+ success: true;
9
+ };
10
+ /**
11
+ * Confirmation that the feedback was recorded
12
+ */
13
+ export type SubmitGenerationFeedbackResponse = {
14
+ data: SubmitGenerationFeedbackResponseData;
15
+ };
16
+ /** @internal */
17
+ export declare const SubmitGenerationFeedbackResponseData$inboundSchema: z.ZodType<SubmitGenerationFeedbackResponseData, unknown>;
18
+ export declare function submitGenerationFeedbackResponseDataFromJSON(jsonString: string): SafeParseResult<SubmitGenerationFeedbackResponseData, SDKValidationError>;
19
+ /** @internal */
20
+ export declare const SubmitGenerationFeedbackResponse$inboundSchema: z.ZodType<SubmitGenerationFeedbackResponse, unknown>;
21
+ export declare function submitGenerationFeedbackResponseFromJSON(jsonString: string): SafeParseResult<SubmitGenerationFeedbackResponse, SDKValidationError>;
22
+ //# sourceMappingURL=submitgenerationfeedbackresponse.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 16760a92290d
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const SubmitGenerationFeedbackResponseData$inboundSchema = z.object({
9
+ success: z.literal(true),
10
+ });
11
+ export function submitGenerationFeedbackResponseDataFromJSON(jsonString) {
12
+ return safeParse(jsonString, (x) => SubmitGenerationFeedbackResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitGenerationFeedbackResponseData' from JSON`);
13
+ }
14
+ /** @internal */
15
+ export const SubmitGenerationFeedbackResponse$inboundSchema = z.object({
16
+ data: z.lazy(() => SubmitGenerationFeedbackResponseData$inboundSchema),
17
+ });
18
+ export function submitGenerationFeedbackResponseFromJSON(jsonString) {
19
+ return safeParse(jsonString, (x) => SubmitGenerationFeedbackResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubmitGenerationFeedbackResponse' from JSON`);
20
+ }
21
+ //# sourceMappingURL=submitgenerationfeedbackresponse.js.map
@@ -315,7 +315,7 @@ export type VideoGenerationRequestOptions = {
315
315
  replicate?: {
316
316
  [k: string]: any | null;
317
317
  } | undefined;
318
- sakanaAi?: {
318
+ sakana?: {
319
319
  [k: string]: any | null;
320
320
  } | undefined;
321
321
  sambanova?: {
@@ -745,7 +745,7 @@ export type VideoGenerationRequestOptions$Outbound = {
745
745
  replicate?: {
746
746
  [k: string]: any | null;
747
747
  } | undefined;
748
- "sakana-ai"?: {
748
+ sakana?: {
749
749
  [k: string]: any | null;
750
750
  } | undefined;
751
751
  sambanova?: {
@@ -133,7 +133,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
133
133
  reka: z.record(z.string(), z.nullable(z.any())).optional(),
134
134
  relace: z.record(z.string(), z.nullable(z.any())).optional(),
135
135
  replicate: z.record(z.string(), z.nullable(z.any())).optional(),
136
- sakanaAi: z.record(z.string(), z.nullable(z.any())).optional(),
136
+ sakana: z.record(z.string(), z.nullable(z.any())).optional(),
137
137
  sambanova: z.record(z.string(), z.nullable(z.any())).optional(),
138
138
  sambanovaCloaked: z.record(z.string(), z.nullable(z.any())).optional(),
139
139
  seed: z.record(z.string(), z.nullable(z.any())).optional(),
@@ -176,7 +176,6 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
176
176
  mancerOld: "mancer-old",
177
177
  nexAgi: "nex-agi",
178
178
  openInference: "open-inference",
179
- sakanaAi: "sakana-ai",
180
179
  sambanovaCloaked: "sambanova-cloaked",
181
180
  sfCompute: "sf-compute",
182
181
  togetherLite: "together-lite",
@@ -10,5 +10,12 @@ export declare class Generations extends ClientSDK {
10
10
  * Get stored prompt and completion content for a generation
11
11
  */
12
12
  listGenerationContent(request: operations.ListGenerationContentRequest, options?: RequestOptions): Promise<models.GenerationContentResponse>;
13
+ /**
14
+ * Submit feedback for a generation
15
+ *
16
+ * @remarks
17
+ * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
18
+ */
19
+ submitFeedback(request: operations.SubmitGenerationFeedbackRequest, options?: RequestOptions): Promise<models.SubmitGenerationFeedbackResponse>;
13
20
  }
14
21
  //# sourceMappingURL=generations.d.ts.map
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { generationsGetGeneration } from "../funcs/generationsGetGeneration.js";
6
6
  import { generationsListGenerationContent } from "../funcs/generationsListGenerationContent.js";
7
+ import { generationsSubmitFeedback } from "../funcs/generationsSubmitFeedback.js";
7
8
  import { ClientSDK } from "../lib/sdks.js";
8
9
  import { unwrapAsync } from "../types/fp.js";
9
10
  export class Generations extends ClientSDK {
@@ -19,5 +20,14 @@ export class Generations extends ClientSDK {
19
20
  async listGenerationContent(request, options) {
20
21
  return unwrapAsync(generationsListGenerationContent(this, request, options));
21
22
  }
23
+ /**
24
+ * Submit feedback for a generation
25
+ *
26
+ * @remarks
27
+ * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
28
+ */
29
+ async submitFeedback(request, options) {
30
+ return unwrapAsync(generationsSubmitFeedback(this, request, options));
31
+ }
22
32
  }
23
33
  //# sourceMappingURL=generations.js.map
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "0.13.36",
5
+ "version": "0.13.38",
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": "0.13.36",
3
+ "version": "0.13.38",
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
- "provenance": true,
25
- "access": "public"
24
+ "access": "public",
25
+ "provenance": true
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -74,14 +74,14 @@
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
76
  "test:transit": "exit 0",
77
+ "test:watch": "vitest --watch --project unit",
77
78
  "typecheck": "tsc --noEmit",
78
79
  "typecheck:transit": "exit 0",
79
- "test:watch": "vitest --watch --project unit",
80
+ "prepare": "npm run build",
81
+ "test:e2e": "vitest --run --project e2e",
80
82
  "compile": "tsc",
81
83
  "postinstall": "node scripts/check-types.js || true",
82
- "prepare": "npm run build",
83
- "test": "vitest --run --project unit",
84
- "test:e2e": "vitest --run --project e2e"
84
+ "test": "vitest --run --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {