@openrouter/sdk 1.5.28 → 1.5.30

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 (32) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/extractionasset.d.ts +36 -0
  4. package/esm/models/extractionasset.js +35 -0
  5. package/esm/models/extractiondateanswer.d.ts +4 -3
  6. package/esm/models/extractiondateanswer.js +2 -1
  7. package/esm/models/extractiondatetimeanswer.d.ts +4 -3
  8. package/esm/models/extractiondatetimeanswer.js +2 -1
  9. package/esm/models/extractiondurationanswer.d.ts +4 -3
  10. package/esm/models/extractiondurationanswer.js +2 -1
  11. package/esm/models/extractionestimateanswer.d.ts +4 -3
  12. package/esm/models/extractionestimateanswer.js +2 -1
  13. package/esm/models/extractionforecastanswer.d.ts +4 -3
  14. package/esm/models/extractionforecastanswer.js +2 -1
  15. package/esm/models/extractionlistanswer.d.ts +8 -3
  16. package/esm/models/extractionlistanswer.js +3 -1
  17. package/esm/models/extractionnumberanswer.d.ts +4 -3
  18. package/esm/models/extractionnumberanswer.js +2 -1
  19. package/esm/models/extractionsrequest.d.ts +4 -4
  20. package/esm/models/extractionsrequest.js +2 -2
  21. package/esm/models/extractiontextanswer.d.ts +4 -3
  22. package/esm/models/extractiontextanswer.js +2 -1
  23. package/esm/models/extractiontimeanswer.d.ts +4 -3
  24. package/esm/models/extractiontimeanswer.js +2 -1
  25. package/esm/models/index.d.ts +1 -0
  26. package/esm/models/index.js +1 -0
  27. package/esm/models/model.d.ts +4 -0
  28. package/esm/models/model.js +1 -0
  29. package/esm/models/operations/listmodelsuser.d.ts +3 -3
  30. package/esm/models/operations/listmodelsuser.js +1 -1
  31. package/jsr.json +1 -1
  32. package/package.json +6 -6
@@ -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.28";
53
+ readonly sdkVersion: "1.5.30";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.28 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.30 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.28",
32
+ sdkVersion: "1.5.30",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.28 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.30 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -0,0 +1,36 @@
1
+ import * as z from "zod/v4";
2
+ import { OpenEnum } from "../types/enums.js";
3
+ export declare const ExtractionAssetFormat: {
4
+ readonly Png: "png";
5
+ readonly Jpg: "jpg";
6
+ readonly Jpeg: "jpeg";
7
+ readonly Pdf: "pdf";
8
+ };
9
+ export type ExtractionAssetFormat = OpenEnum<typeof ExtractionAssetFormat>;
10
+ export declare const ExtractionAssetType: {
11
+ readonly Image: "image";
12
+ readonly Document: "document";
13
+ };
14
+ export type ExtractionAssetType = OpenEnum<typeof ExtractionAssetType>;
15
+ /**
16
+ * An image or PDF sent once and referenced by its key in the `assets` map. `data_base64` is the file in standard base64 with no `data:` prefix. PDF is read by document models only.
17
+ */
18
+ export type ExtractionAsset = {
19
+ dataBase64: string;
20
+ format: ExtractionAssetFormat;
21
+ type?: ExtractionAssetType | undefined;
22
+ };
23
+ /** @internal */
24
+ export declare const ExtractionAssetFormat$outboundSchema: z.ZodType<string, ExtractionAssetFormat>;
25
+ /** @internal */
26
+ export declare const ExtractionAssetType$outboundSchema: z.ZodType<string, ExtractionAssetType>;
27
+ /** @internal */
28
+ export type ExtractionAsset$Outbound = {
29
+ data_base64: string;
30
+ format: string;
31
+ type?: string | undefined;
32
+ };
33
+ /** @internal */
34
+ export declare const ExtractionAsset$outboundSchema: z.ZodType<ExtractionAsset$Outbound, ExtractionAsset>;
35
+ export declare function extractionAssetToJSON(extractionAsset: ExtractionAsset): string;
36
+ //# sourceMappingURL=extractionasset.d.ts.map
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 07f8c3a66e60
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
+ export const ExtractionAssetFormat = {
9
+ Png: "png",
10
+ Jpg: "jpg",
11
+ Jpeg: "jpeg",
12
+ Pdf: "pdf",
13
+ };
14
+ export const ExtractionAssetType = {
15
+ Image: "image",
16
+ Document: "document",
17
+ };
18
+ /** @internal */
19
+ export const ExtractionAssetFormat$outboundSchema = openEnums.outboundSchema(ExtractionAssetFormat);
20
+ /** @internal */
21
+ export const ExtractionAssetType$outboundSchema = openEnums.outboundSchema(ExtractionAssetType);
22
+ /** @internal */
23
+ export const ExtractionAsset$outboundSchema = z.object({
24
+ dataBase64: z.string(),
25
+ format: ExtractionAssetFormat$outboundSchema,
26
+ type: ExtractionAssetType$outboundSchema.optional(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ dataBase64: "data_base64",
30
+ });
31
+ });
32
+ export function extractionAssetToJSON(extractionAsset) {
33
+ return JSON.stringify(ExtractionAsset$outboundSchema.parse(extractionAsset));
34
+ }
35
+ //# sourceMappingURL=extractionasset.js.map
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Set to `image` when the answer was read from an image rather than the state text.
6
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
7
7
  */
8
8
  export declare const ExtractionDateAnswerSource: {
9
9
  readonly State: "state";
10
10
  readonly Image: "image";
11
+ readonly Document: "document";
11
12
  };
12
13
  /**
13
- * Set to `image` when the answer was read from an image rather than the state text.
14
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
14
15
  */
15
16
  export type ExtractionDateAnswerSource = OpenEnum<typeof ExtractionDateAnswerSource>;
16
17
  export type ExtractionDateAnswer = {
@@ -24,7 +25,7 @@ export type ExtractionDateAnswer = {
24
25
  */
25
26
  pNull?: number | undefined;
26
27
  /**
27
- * Set to `image` when the answer was read from an image rather than the state text.
28
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
28
29
  */
29
30
  source?: ExtractionDateAnswerSource | undefined;
30
31
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionDateAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionDateAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionDateAnswerSource);
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Set to `image` when the answer was read from an image rather than the state text.
6
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
7
7
  */
8
8
  export declare const ExtractionDatetimeAnswerSource: {
9
9
  readonly State: "state";
10
10
  readonly Image: "image";
11
+ readonly Document: "document";
11
12
  };
12
13
  /**
13
- * Set to `image` when the answer was read from an image rather than the state text.
14
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
14
15
  */
15
16
  export type ExtractionDatetimeAnswerSource = OpenEnum<typeof ExtractionDatetimeAnswerSource>;
16
17
  export type ExtractionDatetimeAnswer = {
@@ -24,7 +25,7 @@ export type ExtractionDatetimeAnswer = {
24
25
  */
25
26
  pNull?: number | undefined;
26
27
  /**
27
- * Set to `image` when the answer was read from an image rather than the state text.
28
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
28
29
  */
29
30
  source?: ExtractionDatetimeAnswerSource | undefined;
30
31
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionDatetimeAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionDatetimeAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionDatetimeAnswerSource);
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Set to `image` when the answer was read from an image rather than the state text.
6
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
7
7
  */
8
8
  export declare const ExtractionDurationAnswerSource: {
9
9
  readonly State: "state";
10
10
  readonly Image: "image";
11
+ readonly Document: "document";
11
12
  };
12
13
  /**
13
- * Set to `image` when the answer was read from an image rather than the state text.
14
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
14
15
  */
15
16
  export type ExtractionDurationAnswerSource = OpenEnum<typeof ExtractionDurationAnswerSource>;
16
17
  export type ExtractionDurationAnswer = {
@@ -24,7 +25,7 @@ export type ExtractionDurationAnswer = {
24
25
  */
25
26
  pNull?: number | undefined;
26
27
  /**
27
- * Set to `image` when the answer was read from an image rather than the state text.
28
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
28
29
  */
29
30
  source?: ExtractionDurationAnswerSource | undefined;
30
31
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionDurationAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionDurationAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionDurationAnswerSource);
@@ -12,14 +12,15 @@ export type ExtractionEstimateAnswerP10 = number | string;
12
12
  export type ExtractionEstimateAnswerP90 = number | string;
13
13
  export type ExtractionEstimateAnswerQuantile = number | string;
14
14
  /**
15
- * Set to `image` when the answer was read from an image rather than the state text.
15
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
16
16
  */
17
17
  export declare const ExtractionEstimateAnswerSource: {
18
18
  readonly State: "state";
19
19
  readonly Image: "image";
20
+ readonly Document: "document";
20
21
  };
21
22
  /**
22
- * Set to `image` when the answer was read from an image rather than the state text.
23
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
23
24
  */
24
25
  export type ExtractionEstimateAnswerSource = OpenEnum<typeof ExtractionEstimateAnswerSource>;
25
26
  export type ExtractionEstimateAnswerValue = number | string;
@@ -50,7 +51,7 @@ export type ExtractionEstimateAnswer = {
50
51
  */
51
52
  quantiles?: Array<number | string> | undefined;
52
53
  /**
53
- * Set to `image` when the answer was read from an image rather than the state text.
54
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
54
55
  */
55
56
  source?: ExtractionEstimateAnswerSource | undefined;
56
57
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionEstimateAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionEstimateAnswerGuess$inboundSchema = z.union([z.number(), z.string()]);
@@ -9,14 +9,15 @@ export type ExtractionForecastAnswerMedian = number | string;
9
9
  export type ExtractionForecastAnswerP10 = number | string;
10
10
  export type ExtractionForecastAnswerP90 = number | string;
11
11
  /**
12
- * Set to `image` when the answer was read from an image rather than the state text.
12
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
13
13
  */
14
14
  export declare const ExtractionForecastAnswerSource: {
15
15
  readonly State: "state";
16
16
  readonly Image: "image";
17
+ readonly Document: "document";
17
18
  };
18
19
  /**
19
- * Set to `image` when the answer was read from an image rather than the state text.
20
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
20
21
  */
21
22
  export type ExtractionForecastAnswerSource = OpenEnum<typeof ExtractionForecastAnswerSource>;
22
23
  export type ExtractionForecastAnswerValue = number | string;
@@ -35,7 +36,7 @@ export type ExtractionForecastAnswer = {
35
36
  p10?: Array<number | string> | undefined;
36
37
  p90?: Array<number | string> | undefined;
37
38
  /**
38
- * Set to `image` when the answer was read from an image rather than the state text.
39
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
39
40
  */
40
41
  source?: ExtractionForecastAnswerSource | undefined;
41
42
  /**
@@ -8,11 +8,12 @@ import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  import { ExtractionForecastStep$inboundSchema, } from "./extractionforecaststep.js";
10
10
  /**
11
- * Set to `image` when the answer was read from an image rather than the state text.
11
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
12
12
  */
13
13
  export const ExtractionForecastAnswerSource = {
14
14
  State: "state",
15
15
  Image: "image",
16
+ Document: "document",
16
17
  };
17
18
  /** @internal */
18
19
  export const ExtractionForecastAnswerGuess$inboundSchema = z.union([z.number(), z.string()]);
@@ -4,19 +4,24 @@ import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  export type ExtractionListAnswerGuess = string | number;
6
6
  /**
7
- * Set to `image` when the answer was read from an image rather than the state text.
7
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
8
8
  */
9
9
  export declare const ExtractionListAnswerSource: {
10
10
  readonly State: "state";
11
11
  readonly Image: "image";
12
+ readonly Document: "document";
12
13
  };
13
14
  /**
14
- * Set to `image` when the answer was read from an image rather than the state text.
15
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
15
16
  */
16
17
  export type ExtractionListAnswerSource = OpenEnum<typeof ExtractionListAnswerSource>;
17
18
  export type ExtractionListAnswerValue = string | number;
18
19
  export type ExtractionListAnswer = {
19
20
  confidence?: number | undefined;
21
+ /**
22
+ * One confidence per item of `value`, in the same order.
23
+ */
24
+ confidences?: Array<number> | undefined;
20
25
  /**
21
26
  * The most likely value even when `value` is null because `p_null` crossed the threshold.
22
27
  */
@@ -26,7 +31,7 @@ export type ExtractionListAnswer = {
26
31
  */
27
32
  pNull?: number | undefined;
28
33
  /**
29
- * Set to `image` when the answer was read from an image rather than the state text.
34
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
30
35
  */
31
36
  source?: ExtractionListAnswerSource | undefined;
32
37
  spans?: Array<Array<number>> | undefined;
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionListAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionListAnswerGuess$inboundSchema = z.union([z.string(), z.number()]);
@@ -28,6 +29,7 @@ export function extractionListAnswerValueFromJSON(jsonString) {
28
29
  /** @internal */
29
30
  export const ExtractionListAnswer$inboundSchema = z.object({
30
31
  confidence: z.number().optional(),
32
+ confidences: z.array(z.number()).optional(),
31
33
  guess: z.array(z.union([z.string(), z.number()])).optional(),
32
34
  p_null: z.number().optional(),
33
35
  source: ExtractionListAnswerSource$inboundSchema.optional(),
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Set to `image` when the answer was read from an image rather than the state text.
6
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
7
7
  */
8
8
  export declare const ExtractionNumberAnswerSource: {
9
9
  readonly State: "state";
10
10
  readonly Image: "image";
11
+ readonly Document: "document";
11
12
  };
12
13
  /**
13
- * Set to `image` when the answer was read from an image rather than the state text.
14
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
14
15
  */
15
16
  export type ExtractionNumberAnswerSource = OpenEnum<typeof ExtractionNumberAnswerSource>;
16
17
  export type ExtractionNumberAnswer = {
@@ -24,7 +25,7 @@ export type ExtractionNumberAnswer = {
24
25
  */
25
26
  pNull?: number | undefined;
26
27
  /**
27
- * Set to `image` when the answer was read from an image rather than the state text.
28
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
28
29
  */
29
30
  source?: ExtractionNumberAnswerSource | undefined;
30
31
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionNumberAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionNumberAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionNumberAnswerSource);
@@ -1,5 +1,5 @@
1
1
  import * as z from "zod/v4";
2
- import { DecisionsImageAsset, DecisionsImageAsset$Outbound } from "./decisionsimageasset.js";
2
+ import { ExtractionAsset, ExtractionAsset$Outbound } from "./extractionasset.js";
3
3
  import { ExtractionDateField, ExtractionDateField$Outbound } from "./extractiondatefield.js";
4
4
  import { ExtractionDatetimeField, ExtractionDatetimeField$Outbound } from "./extractiondatetimefield.js";
5
5
  import { ExtractionDurationField, ExtractionDurationField$Outbound } from "./extractiondurationfield.js";
@@ -17,10 +17,10 @@ import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
17
17
  export type Fields = ExtractionDateField | ExtractionDatetimeField | ExtractionDurationField | ExtractionEstimateField | ExtractionForecastField | ExtractionListField | ExtractionNumberField | ExtractionTextField | ExtractionTimeField;
18
18
  export type ExtractionsRequest = {
19
19
  /**
20
- * Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.
20
+ * Assets keyed by reference string. Write a reference wherever the asset belongs in `state` or a field `instructions`; every asset must be referenced at least once. A `state` that is exactly the sole asset's key carries no text of its own and is read as file-only. A model that reads either text or a document per request, not both (ScaleDown Extract with a PDF), needs that form: any other text around the key is state text and is rejected with 400.
21
21
  */
22
22
  assets?: {
23
- [k: string]: DecisionsImageAsset;
23
+ [k: string]: ExtractionAsset;
24
24
  } | undefined;
25
25
  /**
26
26
  * Map of field name to typed field spec.
@@ -56,7 +56,7 @@ export declare function fieldsToJSON(fields: Fields): string;
56
56
  /** @internal */
57
57
  export type ExtractionsRequest$Outbound = {
58
58
  assets?: {
59
- [k: string]: DecisionsImageAsset$Outbound;
59
+ [k: string]: ExtractionAsset$Outbound;
60
60
  } | undefined;
61
61
  fields: {
62
62
  [k: string]: ExtractionDateField$Outbound | ExtractionDatetimeField$Outbound | ExtractionDurationField$Outbound | ExtractionEstimateField$Outbound | ExtractionForecastField$Outbound | ExtractionListField$Outbound | ExtractionNumberField$Outbound | ExtractionTextField$Outbound | ExtractionTimeField$Outbound;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
- import { DecisionsImageAsset$outboundSchema, } from "./decisionsimageasset.js";
7
+ import { ExtractionAsset$outboundSchema, } from "./extractionasset.js";
8
8
  import { ExtractionDateField$outboundSchema, } from "./extractiondatefield.js";
9
9
  import { ExtractionDatetimeField$outboundSchema, } from "./extractiondatetimefield.js";
10
10
  import { ExtractionDurationField$outboundSchema, } from "./extractiondurationfield.js";
@@ -34,7 +34,7 @@ export function fieldsToJSON(fields) {
34
34
  }
35
35
  /** @internal */
36
36
  export const ExtractionsRequest$outboundSchema = z.object({
37
- assets: z.record(z.string(), DecisionsImageAsset$outboundSchema).optional(),
37
+ assets: z.record(z.string(), ExtractionAsset$outboundSchema).optional(),
38
38
  fields: z.record(z.string(), z.union([
39
39
  ExtractionDateField$outboundSchema,
40
40
  ExtractionDatetimeField$outboundSchema,
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Set to `image` when the answer was read from an image rather than the state text.
6
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
7
7
  */
8
8
  export declare const ExtractionTextAnswerSource: {
9
9
  readonly State: "state";
10
10
  readonly Image: "image";
11
+ readonly Document: "document";
11
12
  };
12
13
  /**
13
- * Set to `image` when the answer was read from an image rather than the state text.
14
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
14
15
  */
15
16
  export type ExtractionTextAnswerSource = OpenEnum<typeof ExtractionTextAnswerSource>;
16
17
  export type ExtractionTextAnswer = {
@@ -24,7 +25,7 @@ export type ExtractionTextAnswer = {
24
25
  */
25
26
  pNull?: number | undefined;
26
27
  /**
27
- * Set to `image` when the answer was read from an image rather than the state text.
28
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
28
29
  */
29
30
  source?: ExtractionTextAnswerSource | undefined;
30
31
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionTextAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionTextAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionTextAnswerSource);
@@ -3,14 +3,15 @@ import { OpenEnum } from "../types/enums.js";
3
3
  import { Result as SafeParseResult } from "../types/fp.js";
4
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  /**
6
- * Set to `image` when the answer was read from an image rather than the state text.
6
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
7
7
  */
8
8
  export declare const ExtractionTimeAnswerSource: {
9
9
  readonly State: "state";
10
10
  readonly Image: "image";
11
+ readonly Document: "document";
11
12
  };
12
13
  /**
13
- * Set to `image` when the answer was read from an image rather than the state text.
14
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
14
15
  */
15
16
  export type ExtractionTimeAnswerSource = OpenEnum<typeof ExtractionTimeAnswerSource>;
16
17
  export type ExtractionTimeAnswer = {
@@ -24,7 +25,7 @@ export type ExtractionTimeAnswer = {
24
25
  */
25
26
  pNull?: number | undefined;
26
27
  /**
27
- * Set to `image` when the answer was read from an image rather than the state text.
28
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
28
29
  */
29
30
  source?: ExtractionTimeAnswerSource | undefined;
30
31
  /**
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { safeParse } from "../lib/schemas.js";
8
8
  import * as openEnums from "../types/enums.js";
9
9
  /**
10
- * Set to `image` when the answer was read from an image rather than the state text.
10
+ * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
11
11
  */
12
12
  export const ExtractionTimeAnswerSource = {
13
13
  State: "state",
14
14
  Image: "image",
15
+ Document: "document",
15
16
  };
16
17
  /** @internal */
17
18
  export const ExtractionTimeAnswerSource$inboundSchema = openEnums.inboundSchema(ExtractionTimeAnswerSource);
@@ -331,6 +331,7 @@ export * from "./enumcapability.js";
331
331
  export * from "./errorevent.js";
332
332
  export * from "./externaluser.js";
333
333
  export * from "./externaluserresponse.js";
334
+ export * from "./extractionasset.js";
334
335
  export * from "./extractiondateanswer.js";
335
336
  export * from "./extractiondatefield.js";
336
337
  export * from "./extractiondatetimeanswer.js";
@@ -335,6 +335,7 @@ export * from "./enumcapability.js";
335
335
  export * from "./errorevent.js";
336
336
  export * from "./externaluser.js";
337
337
  export * from "./externaluserresponse.js";
338
+ export * from "./extractionasset.js";
338
339
  export * from "./extractiondateanswer.js";
339
340
  export * from "./extractiondatefield.js";
340
341
  export * from "./extractiondatetimeanswer.js";
@@ -47,6 +47,10 @@ export type Model = {
47
47
  * Description of the model
48
48
  */
49
49
  description?: string | undefined;
50
+ /**
51
+ * Request API paths that serve this model, derived from the same modality and adapter rules the routers use. A model served only through an alpha surface lists only that path.
52
+ */
53
+ endpoints: Array<string>;
50
54
  /**
51
55
  * The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.
52
56
  */
@@ -25,6 +25,7 @@ export const Model$inboundSchema = z.object({
25
25
  created: z.int(),
26
26
  default_parameters: z.nullable(DefaultParameters$inboundSchema),
27
27
  description: z.string().optional(),
28
+ endpoints: z.array(z.string()),
28
29
  expiration_date: z.nullable(z.string()).optional(),
29
30
  hugging_face_id: z.nullable(z.string()).optional(),
30
31
  id: z.string(),
@@ -49,7 +49,7 @@ export declare const ListModelsUserSort: {
49
49
  */
50
50
  export type ListModelsUserSort = OpenEnum<typeof ListModelsUserSort>;
51
51
  /**
52
- * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
52
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). When your workspace's Managed Machines policy sets a model list for that harness, only the listed models remain, and a preset remains only while every model it routes to is listed. This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
53
53
  */
54
54
  export declare const Client: {
55
55
  readonly ClaudeCode: "claude_code";
@@ -57,7 +57,7 @@ export declare const Client: {
57
57
  readonly Codex: "codex";
58
58
  };
59
59
  /**
60
- * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
60
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). When your workspace's Managed Machines policy sets a model list for that harness, only the listed models remain, and a preset remains only while every model it routes to is listed. This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
61
61
  */
62
62
  export type Client = OpenEnum<typeof Client>;
63
63
  export type ListModelsUserRequest = {
@@ -97,7 +97,7 @@ export type ListModelsUserRequest = {
97
97
  */
98
98
  sort?: ListModelsUserSort | undefined;
99
99
  /**
100
- * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
100
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). When your workspace's Managed Machines policy sets a model list for that harness, only the listed models remain, and a preset remains only while every model it routes to is listed. This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
101
101
  */
102
102
  client?: Client | undefined;
103
103
  };
@@ -25,7 +25,7 @@ export const ListModelsUserSort = {
25
25
  DesignArenaEloHighToLow: "design-arena-elo-high-to-low",
26
26
  };
27
27
  /**
28
- * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
28
+ * Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). When your workspace's Managed Machines policy sets a model list for that harness, only the listed models remain, and a preset remains only while every model it routes to is listed. This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.
29
29
  */
30
30
  export const Client = {
31
31
  ClaudeCode: "claude_code",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.28",
5
+ "version": "1.5.30",
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.28",
3
+ "version": "1.5.30",
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
- "typecheck": "tsc --noEmit",
77
- "compile": "tsc && node scripts/unbarrel-imports.js",
78
76
  "postinstall": "node scripts/check-types.js || true",
77
+ "test:e2e": "vitest --run --project e2e",
79
78
  "test:transit": "exit 0",
80
- "typecheck:transit": "exit 0",
81
79
  "prepare": "npm run build",
82
80
  "test": "vitest --run --project unit",
83
- "test:e2e": "vitest --run --project e2e",
84
- "test:watch": "vitest --watch --project unit"
81
+ "test:watch": "vitest --watch --project unit",
82
+ "typecheck": "tsc --noEmit",
83
+ "typecheck:transit": "exit 0",
84
+ "compile": "tsc && node scripts/unbarrel-imports.js"
85
85
  },
86
86
  "peerDependencies": {
87
87