@openrouter/sdk 1.5.81 → 1.5.82

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 (44) hide show
  1. package/esm/funcs/observabilityCreate.d.ts +1 -1
  2. package/esm/funcs/observabilityCreate.js +1 -1
  3. package/esm/funcs/observabilityDelete.d.ts +1 -1
  4. package/esm/funcs/observabilityDelete.js +1 -1
  5. package/esm/funcs/observabilityGet.d.ts +1 -1
  6. package/esm/funcs/observabilityGet.js +1 -1
  7. package/esm/funcs/observabilityList.d.ts +1 -1
  8. package/esm/funcs/observabilityList.js +1 -1
  9. package/esm/funcs/observabilityUpdate.d.ts +1 -1
  10. package/esm/funcs/observabilityUpdate.js +1 -1
  11. package/esm/lib/config.d.ts +2 -2
  12. package/esm/lib/config.js +2 -2
  13. package/esm/models/createobservabilitydestinationrequest.d.ts +2 -2
  14. package/esm/models/extractionasset.d.ts +2 -1
  15. package/esm/models/extractionasset.js +1 -0
  16. package/esm/models/extractiondateanswer.d.ts +1 -1
  17. package/esm/models/extractiondatefield.d.ts +5 -0
  18. package/esm/models/extractiondatefield.js +1 -0
  19. package/esm/models/extractiondatetimeanswer.d.ts +1 -1
  20. package/esm/models/extractiondatetimefield.d.ts +5 -0
  21. package/esm/models/extractiondatetimefield.js +1 -0
  22. package/esm/models/extractiondurationanswer.d.ts +1 -1
  23. package/esm/models/extractiondurationfield.d.ts +3 -0
  24. package/esm/models/extractionestimatefield.d.ts +4 -1
  25. package/esm/models/extractionforecastfield.d.ts +4 -1
  26. package/esm/models/extractionlistanswer.d.ts +1 -1
  27. package/esm/models/extractionlistfield.d.ts +10 -0
  28. package/esm/models/extractionlistfield.js +2 -0
  29. package/esm/models/extractionnumberanswer.d.ts +1 -1
  30. package/esm/models/extractionnumberfield.d.ts +6 -0
  31. package/esm/models/extractionsrequest.d.ts +3 -3
  32. package/esm/models/extractionsrequest.js +1 -1
  33. package/esm/models/extractiontextanswer.d.ts +1 -1
  34. package/esm/models/extractiontextfield.d.ts +5 -0
  35. package/esm/models/extractiontextfield.js +1 -0
  36. package/esm/models/extractiontimeanswer.d.ts +1 -1
  37. package/esm/models/extractiontimefield.d.ts +5 -0
  38. package/esm/models/extractiontimefield.js +1 -0
  39. package/esm/models/operations/listobservabilitydestinations.d.ts +1 -1
  40. package/esm/models/updateobservabilitydestinationrequest.d.ts +1 -1
  41. package/esm/sdk/observability.d.ts +5 -5
  42. package/esm/sdk/observability.js +5 -5
  43. package/jsr.json +1 -1
  44. package/package.json +8 -8
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Create an observability destination
14
14
  *
15
15
  * @remarks
16
- * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function observabilityCreate(client: OpenRouterCore, request: operations.CreateObservabilityDestinationRequest, options?: RequestOptions): APIPromise<Result<models.CreateObservabilityDestinationResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=observabilityCreate.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Create an observability destination
18
18
  *
19
19
  * @remarks
20
- * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function observabilityCreate(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Delete an observability destination
14
14
  *
15
15
  * @remarks
16
- * Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Delete an existing observability destination. This performs a soft delete. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function observabilityDelete(client: OpenRouterCore, request: operations.DeleteObservabilityDestinationRequest, options?: RequestOptions): APIPromise<Result<models.DeleteObservabilityDestinationResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=observabilityDelete.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Delete an observability destination
18
18
  *
19
19
  * @remarks
20
- * Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Delete an existing observability destination. This performs a soft delete. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function observabilityDelete(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Get an observability destination
14
14
  *
15
15
  * @remarks
16
- * Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Fetch a single observability destination by its UUID. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function observabilityGet(client: OpenRouterCore, request: operations.GetObservabilityDestinationRequest, options?: RequestOptions): APIPromise<Result<models.GetObservabilityDestinationResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=observabilityGet.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Get an observability destination
18
18
  *
19
19
  * @remarks
20
- * Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Fetch a single observability destination by its UUID. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function observabilityGet(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -13,7 +13,7 @@ import { PageIterator } from "../types/operations.js";
13
13
  * List observability destinations
14
14
  *
15
15
  * @remarks
16
- * List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * List the observability destinations configured for the authenticated entity's default workspace, or a workspace-scoped management key's own workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. A workspace-scoped management key can only list its own workspace; any other `workspace_id` returns 403. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function observabilityList(client: OpenRouterCore, request?: operations.ListObservabilityDestinationsRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListObservabilityDestinationsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
19
19
  offset: number;
@@ -17,7 +17,7 @@ import { createPageIterator, haltIterator, } from "../types/operations.js";
17
17
  * List observability destinations
18
18
  *
19
19
  * @remarks
20
- * List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * List the observability destinations configured for the authenticated entity's default workspace, or a workspace-scoped management key's own workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. A workspace-scoped management key can only list its own workspace; any other `workspace_id` returns 403. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function observabilityList(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Update an observability destination
14
14
  *
15
15
  * @remarks
16
- * Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  export declare function observabilityUpdate(client: OpenRouterCore, request: operations.UpdateObservabilityDestinationRequest, options?: RequestOptions): APIPromise<Result<models.UpdateObservabilityDestinationResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.ConflictResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=observabilityUpdate.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Update an observability destination
18
18
  *
19
19
  * @remarks
20
- * Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
+ * Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
21
  */
22
22
  export function observabilityUpdate(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -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.81";
53
+ readonly sdkVersion: "1.5.82";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.81 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.82 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.81",
32
+ sdkVersion: "1.5.82",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.81 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.82 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -30,7 +30,7 @@ export declare const CreateObservabilityDestinationRequestType: {
30
30
  export type CreateObservabilityDestinationRequestType = OpenEnum<typeof CreateObservabilityDestinationRequestType>;
31
31
  export type CreateObservabilityDestinationRequest = {
32
32
  /**
33
- * Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided.
33
+ * Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. A workspace-scoped management key can only name API keys in its own workspace; any other hash returns 400.
34
34
  */
35
35
  apiKeyHashes?: Array<string> | null | undefined;
36
36
  /**
@@ -84,7 +84,7 @@ export type CreateObservabilityDestinationRequest = {
84
84
  */
85
85
  type: CreateObservabilityDestinationRequestType;
86
86
  /**
87
- * Optional workspace ID. Defaults to the authenticated entity's default workspace.
87
+ * Optional workspace ID. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace.
88
88
  */
89
89
  workspaceId?: string | undefined;
90
90
  };
@@ -4,6 +4,7 @@ export declare const ExtractionAssetFormat: {
4
4
  readonly Png: "png";
5
5
  readonly Jpg: "jpg";
6
6
  readonly Jpeg: "jpeg";
7
+ readonly Webp: "webp";
7
8
  readonly Pdf: "pdf";
8
9
  };
9
10
  export type ExtractionAssetFormat = OpenEnum<typeof ExtractionAssetFormat>;
@@ -13,7 +14,7 @@ export declare const ExtractionAssetType: {
13
14
  };
14
15
  export type ExtractionAssetType = OpenEnum<typeof ExtractionAssetType>;
15
16
  /**
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
+ * 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. Which formats are read is model-specific: a format the model cannot read fails with a 400.
17
18
  */
18
19
  export type ExtractionAsset = {
19
20
  dataBase64: string;
@@ -9,6 +9,7 @@ export const ExtractionAssetFormat = {
9
9
  Png: "png",
10
10
  Jpg: "jpg",
11
11
  Jpeg: "jpeg",
12
+ Webp: "webp",
12
13
  Pdf: "pdf",
13
14
  };
14
15
  export const ExtractionAssetType = {
@@ -29,7 +29,7 @@ export type ExtractionDateAnswer = {
29
29
  */
30
30
  source?: ExtractionDateAnswerSource | undefined;
31
31
  /**
32
- * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
32
+ * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. Absent for an answer that has no offsets in the state text, for example a null answer, one read from an image or a document, or one the provider returned without offsets that delimit it.
33
33
  */
34
34
  span?: Array<number> | undefined;
35
35
  /**
@@ -9,12 +9,17 @@ export type ExtractionDateField = {
9
9
  */
10
10
  nullThreshold?: number | undefined;
11
11
  type: "date";
12
+ /**
13
+ * Unit label for the value.
14
+ */
15
+ unit?: string | undefined;
12
16
  };
13
17
  /** @internal */
14
18
  export type ExtractionDateField$Outbound = {
15
19
  instructions?: string | undefined;
16
20
  null_threshold?: number | undefined;
17
21
  type: "date";
22
+ unit?: string | undefined;
18
23
  };
19
24
  /** @internal */
20
25
  export declare const ExtractionDateField$outboundSchema: z.ZodType<ExtractionDateField$Outbound, ExtractionDateField>;
@@ -9,6 +9,7 @@ export const ExtractionDateField$outboundSchema = z.object({
9
9
  instructions: z.string().optional(),
10
10
  nullThreshold: z.number().optional(),
11
11
  type: z.literal("date"),
12
+ unit: z.string().optional(),
12
13
  }).transform((v) => {
13
14
  return remap$(v, {
14
15
  nullThreshold: "null_threshold",
@@ -29,7 +29,7 @@ export type ExtractionDatetimeAnswer = {
29
29
  */
30
30
  source?: ExtractionDatetimeAnswerSource | undefined;
31
31
  /**
32
- * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
32
+ * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. Absent for an answer that has no offsets in the state text, for example a null answer, one read from an image or a document, or one the provider returned without offsets that delimit it.
33
33
  */
34
34
  span?: Array<number> | undefined;
35
35
  /**
@@ -9,12 +9,17 @@ export type ExtractionDatetimeField = {
9
9
  */
10
10
  nullThreshold?: number | undefined;
11
11
  type: "datetime";
12
+ /**
13
+ * Unit label for the value.
14
+ */
15
+ unit?: string | undefined;
12
16
  };
13
17
  /** @internal */
14
18
  export type ExtractionDatetimeField$Outbound = {
15
19
  instructions?: string | undefined;
16
20
  null_threshold?: number | undefined;
17
21
  type: "datetime";
22
+ unit?: string | undefined;
18
23
  };
19
24
  /** @internal */
20
25
  export declare const ExtractionDatetimeField$outboundSchema: z.ZodType<ExtractionDatetimeField$Outbound, ExtractionDatetimeField>;
@@ -9,6 +9,7 @@ export const ExtractionDatetimeField$outboundSchema = z.object({
9
9
  instructions: z.string().optional(),
10
10
  nullThreshold: z.number().optional(),
11
11
  type: z.literal("datetime"),
12
+ unit: z.string().optional(),
12
13
  }).transform((v) => {
13
14
  return remap$(v, {
14
15
  nullThreshold: "null_threshold",
@@ -29,7 +29,7 @@ export type ExtractionDurationAnswer = {
29
29
  */
30
30
  source?: ExtractionDurationAnswerSource | undefined;
31
31
  /**
32
- * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
32
+ * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. Absent for an answer that has no offsets in the state text, for example a null answer, one read from an image or a document, or one the provider returned without offsets that delimit it.
33
33
  */
34
34
  span?: Array<number> | undefined;
35
35
  /**
@@ -8,6 +8,9 @@ export type ExtractionDurationField = {
8
8
  * What the field should contain.
9
9
  */
10
10
  instructions?: string | undefined;
11
+ /**
12
+ * Whole numbers only.
13
+ */
11
14
  integer?: boolean | undefined;
12
15
  /**
13
16
  * Probability of null above which `value` is null. Default 0.5.
@@ -24,12 +24,15 @@ export type ExtractionEstimateField = {
24
24
  max: number | string;
25
25
  min: number | string;
26
26
  /**
27
- * Probability of null above which `value` is null. Default 0.5.
27
+ * Not read on this field type: no model takes a null threshold here, and a request that sets it fails with a 400.
28
28
  */
29
29
  nullThreshold?: number | undefined;
30
30
  scale?: ExtractionEstimateFieldScale | undefined;
31
31
  step?: number | ExtractionEstimateFieldStepMonth | ExtractionEstimateFieldStepYear | undefined;
32
32
  type: "estimate";
33
+ /**
34
+ * Unit label for the value.
35
+ */
33
36
  unit?: string | undefined;
34
37
  };
35
38
  /** @internal */
@@ -40,12 +40,15 @@ export type ExtractionForecastField = {
40
40
  max: number | string;
41
41
  min: number | string;
42
42
  /**
43
- * Probability of null above which `value` is null. Default 0.5.
43
+ * Not read on this field type: no model takes a null threshold here, and a request that sets it fails with a 400.
44
44
  */
45
45
  nullThreshold?: number | undefined;
46
46
  scale?: ExtractionForecastFieldScale | undefined;
47
47
  step?: number | ExtractionForecastFieldStepMonth | ExtractionForecastFieldStepYear | undefined;
48
48
  type: "forecast";
49
+ /**
50
+ * Unit label for the value.
51
+ */
49
52
  unit?: string | undefined;
50
53
  };
51
54
  /** @internal */
@@ -35,7 +35,7 @@ export type ExtractionListAnswer = {
35
35
  */
36
36
  source?: ExtractionListAnswerSource | undefined;
37
37
  /**
38
- * One span per item of `value`, in the same order; null for an item that has no offsets in the state text (read from an image or a document).
38
+ * One span per item of `value`, in the same order; null for an item that has no offsets in the state text: one read from an image or a document, or one the provider returned without offsets that delimit it.
39
39
  */
40
40
  spans?: Array<Array<number> | null> | undefined;
41
41
  /**
@@ -15,12 +15,20 @@ export type ExtractionListField = {
15
15
  * What the field should contain.
16
16
  */
17
17
  instructions?: string | undefined;
18
+ /**
19
+ * Whole numbers only. Lists of numbers only.
20
+ */
21
+ integer?: boolean | undefined;
18
22
  items: Items;
19
23
  /**
20
24
  * Probability of null above which `value` is null. Default 0.5.
21
25
  */
22
26
  nullThreshold?: number | undefined;
23
27
  type: "list";
28
+ /**
29
+ * Unit label for the value.
30
+ */
31
+ unit?: string | undefined;
24
32
  };
25
33
  /** @internal */
26
34
  export declare const Items$outboundSchema: z.ZodType<string, Items>;
@@ -28,9 +36,11 @@ export declare const Items$outboundSchema: z.ZodType<string, Items>;
28
36
  export type ExtractionListField$Outbound = {
29
37
  decimals?: number | undefined;
30
38
  instructions?: string | undefined;
39
+ integer?: boolean | undefined;
31
40
  items: string;
32
41
  null_threshold?: number | undefined;
33
42
  type: "list";
43
+ unit?: string | undefined;
34
44
  };
35
45
  /** @internal */
36
46
  export declare const ExtractionListField$outboundSchema: z.ZodType<ExtractionListField$Outbound, ExtractionListField>;
@@ -17,9 +17,11 @@ export const Items$outboundSchema = openEnums
17
17
  export const ExtractionListField$outboundSchema = z.object({
18
18
  decimals: z.int().optional(),
19
19
  instructions: z.string().optional(),
20
+ integer: z.boolean().optional(),
20
21
  items: Items$outboundSchema,
21
22
  nullThreshold: z.number().optional(),
22
23
  type: z.literal("list"),
24
+ unit: z.string().optional(),
23
25
  }).transform((v) => {
24
26
  return remap$(v, {
25
27
  nullThreshold: "null_threshold",
@@ -29,7 +29,7 @@ export type ExtractionNumberAnswer = {
29
29
  */
30
30
  source?: ExtractionNumberAnswerSource | undefined;
31
31
  /**
32
- * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
32
+ * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. Absent for an answer that has no offsets in the state text, for example a null answer, one read from an image or a document, or one the provider returned without offsets that delimit it.
33
33
  */
34
34
  span?: Array<number> | undefined;
35
35
  /**
@@ -8,12 +8,18 @@ export type ExtractionNumberField = {
8
8
  * What the field should contain.
9
9
  */
10
10
  instructions?: string | undefined;
11
+ /**
12
+ * Whole numbers only.
13
+ */
11
14
  integer?: boolean | undefined;
12
15
  /**
13
16
  * Probability of null above which `value` is null. Default 0.5.
14
17
  */
15
18
  nullThreshold?: number | undefined;
16
19
  type: "number";
20
+ /**
21
+ * Unit label for the value.
22
+ */
17
23
  unit?: string | undefined;
18
24
  };
19
25
  /** @internal */
@@ -17,7 +17,7 @@ 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
- * 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.
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, unless `state` is empty or omitted, in which case the assets are read without a reference. 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), takes that form or an empty or omitted `state`: any other text around the key is state text and is rejected with 400.
21
21
  */
22
22
  assets?: {
23
23
  [k: string]: ExtractionAsset;
@@ -39,9 +39,9 @@ export type ExtractionsRequest = {
39
39
  */
40
40
  sessionId?: string | undefined;
41
41
  /**
42
- * The text to read from. May be empty only when the request carries image assets.
42
+ * The text to read from. May be empty or omitted only when the request carries assets, which are then read without being referenced by key.
43
43
  */
44
- state: string;
44
+ state?: string | undefined;
45
45
  /**
46
46
  * Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
47
47
  */
@@ -50,7 +50,7 @@ export const ExtractionsRequest$outboundSchema = z.object({
50
50
  provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
51
51
  referenceDate: z.string().optional(),
52
52
  sessionId: z.string().optional(),
53
- state: z.string(),
53
+ state: z.string().default(""),
54
54
  trace: TraceConfig$outboundSchema.optional(),
55
55
  user: z.string().optional(),
56
56
  }).transform((v) => {
@@ -29,7 +29,7 @@ export type ExtractionTextAnswer = {
29
29
  */
30
30
  source?: ExtractionTextAnswerSource | undefined;
31
31
  /**
32
- * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
32
+ * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. Absent for an answer that has no offsets in the state text, for example a null answer, one read from an image or a document, or one the provider returned without offsets that delimit it.
33
33
  */
34
34
  span?: Array<number> | undefined;
35
35
  /**
@@ -9,12 +9,17 @@ export type ExtractionTextField = {
9
9
  */
10
10
  nullThreshold?: number | undefined;
11
11
  type: "text";
12
+ /**
13
+ * Unit label for the value.
14
+ */
15
+ unit?: string | undefined;
12
16
  };
13
17
  /** @internal */
14
18
  export type ExtractionTextField$Outbound = {
15
19
  instructions?: string | undefined;
16
20
  null_threshold?: number | undefined;
17
21
  type: "text";
22
+ unit?: string | undefined;
18
23
  };
19
24
  /** @internal */
20
25
  export declare const ExtractionTextField$outboundSchema: z.ZodType<ExtractionTextField$Outbound, ExtractionTextField>;
@@ -9,6 +9,7 @@ export const ExtractionTextField$outboundSchema = z.object({
9
9
  instructions: z.string().optional(),
10
10
  nullThreshold: z.number().optional(),
11
11
  type: z.literal("text"),
12
+ unit: z.string().optional(),
12
13
  }).transform((v) => {
13
14
  return remap$(v, {
14
15
  nullThreshold: "null_threshold",
@@ -29,7 +29,7 @@ export type ExtractionTimeAnswer = {
29
29
  */
30
30
  source?: ExtractionTimeAnswerSource | undefined;
31
31
  /**
32
- * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once.
32
+ * Unicode code point offsets [start, end) into the state text: index code points (not UTF-16 code units or UTF-8 bytes), so an emoji or accented letter counts once. Absent for an answer that has no offsets in the state text, for example a null answer, one read from an image or a document, or one the provider returned without offsets that delimit it.
33
33
  */
34
34
  span?: Array<number> | undefined;
35
35
  /**
@@ -9,12 +9,17 @@ export type ExtractionTimeField = {
9
9
  */
10
10
  nullThreshold?: number | undefined;
11
11
  type: "time";
12
+ /**
13
+ * Unit label for the value.
14
+ */
15
+ unit?: string | undefined;
12
16
  };
13
17
  /** @internal */
14
18
  export type ExtractionTimeField$Outbound = {
15
19
  instructions?: string | undefined;
16
20
  null_threshold?: number | undefined;
17
21
  type: "time";
22
+ unit?: string | undefined;
18
23
  };
19
24
  /** @internal */
20
25
  export declare const ExtractionTimeField$outboundSchema: z.ZodType<ExtractionTimeField$Outbound, ExtractionTimeField>;
@@ -9,6 +9,7 @@ export const ExtractionTimeField$outboundSchema = z.object({
9
9
  instructions: z.string().optional(),
10
10
  nullThreshold: z.number().optional(),
11
11
  type: z.literal("time"),
12
+ unit: z.string().optional(),
12
13
  }).transform((v) => {
13
14
  return remap$(v, {
14
15
  nullThreshold: "null_threshold",
@@ -52,7 +52,7 @@ export type ListObservabilityDestinationsRequest = {
52
52
  */
53
53
  limit?: number | undefined;
54
54
  /**
55
- * Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace.
55
+ * Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace.
56
56
  */
57
57
  workspaceId?: string | undefined;
58
58
  };
@@ -3,7 +3,7 @@ import { ObservabilityDataRegionInput } from "./observabilitydataregioninput.js"
3
3
  import { ObservabilityFilterRulesConfigNullable, ObservabilityFilterRulesConfigNullable$Outbound } from "./observabilityfilterrulesconfignullable.js";
4
4
  export type UpdateObservabilityDestinationRequest = {
5
5
  /**
6
- * Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided.
6
+ * Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value, including any API key from another workspace that an organization-scoped key attached. Must contain at least one hash if provided. A workspace-scoped management key can only name API keys in its own workspace; any other hash returns 400.
7
7
  */
8
8
  apiKeyHashes?: Array<string> | null | undefined;
9
9
  /**
@@ -7,7 +7,7 @@ export declare class Observability extends ClientSDK {
7
7
  * List observability destinations
8
8
  *
9
9
  * @remarks
10
- * List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
10
+ * List the observability destinations configured for the authenticated entity's default workspace, or a workspace-scoped management key's own workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. A workspace-scoped management key can only list its own workspace; any other `workspace_id` returns 403. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
11
11
  */
12
12
  list(request?: operations.ListObservabilityDestinationsRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListObservabilityDestinationsResponse, {
13
13
  offset: number;
@@ -16,28 +16,28 @@ export declare class Observability extends ClientSDK {
16
16
  * Create an observability destination
17
17
  *
18
18
  * @remarks
19
- * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
21
  create(request: operations.CreateObservabilityDestinationRequest, options?: RequestOptions): Promise<models.CreateObservabilityDestinationResponse>;
22
22
  /**
23
23
  * Delete an observability destination
24
24
  *
25
25
  * @remarks
26
- * Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required.
26
+ * Delete an existing observability destination. This performs a soft delete. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
27
27
  */
28
28
  delete(request: operations.DeleteObservabilityDestinationRequest, options?: RequestOptions): Promise<models.DeleteObservabilityDestinationResponse>;
29
29
  /**
30
30
  * Get an observability destination
31
31
  *
32
32
  * @remarks
33
- * Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
33
+ * Fetch a single observability destination by its UUID. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34
34
  */
35
35
  get(request: operations.GetObservabilityDestinationRequest, options?: RequestOptions): Promise<models.GetObservabilityDestinationResponse>;
36
36
  /**
37
37
  * Update an observability destination
38
38
  *
39
39
  * @remarks
40
- * Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required.
40
+ * Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
41
41
  */
42
42
  update(request: operations.UpdateObservabilityDestinationRequest, options?: RequestOptions): Promise<models.UpdateObservabilityDestinationResponse>;
43
43
  }
@@ -15,7 +15,7 @@ export class Observability extends ClientSDK {
15
15
  * List observability destinations
16
16
  *
17
17
  * @remarks
18
- * List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
18
+ * List the observability destinations configured for the authenticated entity's default workspace, or a workspace-scoped management key's own workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. A workspace-scoped management key can only list its own workspace; any other `workspace_id` returns 403. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
19
  */
20
20
  async list(request, options) {
21
21
  return unwrapResultIterator(observabilityList(this, request, options));
@@ -24,7 +24,7 @@ export class Observability extends ClientSDK {
24
24
  * Create an observability destination
25
25
  *
26
26
  * @remarks
27
- * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.
27
+ * Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the `workspace_id` body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other `workspace_id` returns 403. [Management key](/docs/guides/overview/auth/management-api-keys) required.
28
28
  */
29
29
  async create(request, options) {
30
30
  return unwrapAsync(observabilityCreate(this, request, options));
@@ -33,7 +33,7 @@ export class Observability extends ClientSDK {
33
33
  * Delete an observability destination
34
34
  *
35
35
  * @remarks
36
- * Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required.
36
+ * Delete an existing observability destination. This performs a soft delete. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
37
37
  */
38
38
  async delete(request, options) {
39
39
  return unwrapAsync(observabilityDelete(this, request, options));
@@ -42,7 +42,7 @@ export class Observability extends ClientSDK {
42
42
  * Get an observability destination
43
43
  *
44
44
  * @remarks
45
- * Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
45
+ * Fetch a single observability destination by its UUID. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
46
46
  */
47
47
  async get(request, options) {
48
48
  return unwrapAsync(observabilityGet(this, request, options));
@@ -51,7 +51,7 @@ export class Observability extends ClientSDK {
51
51
  * Update an observability destination
52
52
  *
53
53
  * @remarks
54
- * Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required.
54
+ * Update an existing observability destination. Only the fields provided in the request body are updated. A workspace-scoped management key only reaches destinations in its own workspace; any other `id` returns 404. [Management key](/docs/guides/overview/auth/management-api-keys) required.
55
55
  */
56
56
  async update(request, options) {
57
57
  return unwrapAsync(observabilityUpdate(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.81",
5
+ "version": "1.5.82",
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.81",
3
+ "version": "1.5.82",
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",
@@ -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:watch": "vitest --watch --project unit",
77
- "prepare": "npm run build",
78
- "test": "vitest --run --project unit",
79
- "test:e2e": "vitest --run --project e2e",
80
76
  "test:transit": "exit 0",
81
77
  "typecheck": "tsc --noEmit",
78
+ "postinstall": "node scripts/check-types.js || true",
79
+ "test:watch": "vitest --watch --project unit",
82
80
  "typecheck:transit": "exit 0",
83
81
  "compile": "tsc && node scripts/unbarrel-imports.js",
84
- "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"
85
85
  },
86
86
  "peerDependencies": {
87
87