@openrouter/sdk 1.2.131 → 1.2.133

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 (55) hide show
  1. package/esm/funcs/sttCreateTranscriptionMultipart.js +9 -0
  2. package/esm/funcs/vaultCopyVaultSecretsToIntern.d.ts +21 -0
  3. package/esm/funcs/vaultCopyVaultSecretsToIntern.js +108 -0
  4. package/esm/funcs/vaultDeleteInternVaultSecret.d.ts +20 -0
  5. package/esm/funcs/vaultDeleteInternVaultSecret.js +109 -0
  6. package/esm/funcs/vaultDeleteVaultSecret.d.ts +20 -0
  7. package/esm/funcs/vaultDeleteVaultSecret.js +105 -0
  8. package/esm/funcs/vaultListInternVaultSecrets.d.ts +21 -0
  9. package/esm/funcs/vaultListInternVaultSecrets.js +110 -0
  10. package/esm/funcs/vaultListVaultSecrets.d.ts +21 -0
  11. package/esm/funcs/vaultListVaultSecrets.js +104 -0
  12. package/esm/funcs/vaultStoreInternVaultSecret.d.ts +21 -0
  13. package/esm/funcs/vaultStoreInternVaultSecret.js +112 -0
  14. package/esm/funcs/vaultStoreVaultSecret.d.ts +21 -0
  15. package/esm/funcs/vaultStoreVaultSecret.js +108 -0
  16. package/esm/lib/config.d.ts +2 -2
  17. package/esm/lib/config.js +2 -2
  18. package/esm/models/index.d.ts +6 -0
  19. package/esm/models/index.js +6 -0
  20. package/esm/models/operations/copyvaultsecretstointern.d.ts +61 -0
  21. package/esm/models/operations/copyvaultsecretstointern.js +24 -0
  22. package/esm/models/operations/createaudiotranscriptionsmultipart.d.ts +15 -0
  23. package/esm/models/operations/createaudiotranscriptionsmultipart.js +4 -0
  24. package/esm/models/operations/deleteinternvaultsecret.d.ts +63 -0
  25. package/esm/models/operations/deleteinternvaultsecret.js +22 -0
  26. package/esm/models/operations/deletevaultsecret.d.ts +58 -0
  27. package/esm/models/operations/deletevaultsecret.js +21 -0
  28. package/esm/models/operations/index.d.ts +7 -0
  29. package/esm/models/operations/index.js +7 -0
  30. package/esm/models/operations/listinternvaultsecrets.d.ts +68 -0
  31. package/esm/models/operations/listinternvaultsecrets.js +23 -0
  32. package/esm/models/operations/listvaultsecrets.d.ts +63 -0
  33. package/esm/models/operations/listvaultsecrets.js +22 -0
  34. package/esm/models/operations/storeinternvaultsecret.d.ts +66 -0
  35. package/esm/models/operations/storeinternvaultsecret.js +25 -0
  36. package/esm/models/operations/storevaultsecret.d.ts +61 -0
  37. package/esm/models/operations/storevaultsecret.js +24 -0
  38. package/esm/models/vaultsecret.d.ts +16 -0
  39. package/esm/models/vaultsecret.js +23 -0
  40. package/esm/models/vaultsecretcopyrequest.d.ts +18 -0
  41. package/esm/models/vaultsecretcopyrequest.js +13 -0
  42. package/esm/models/vaultsecretcopyresponse.d.ts +14 -0
  43. package/esm/models/vaultsecretcopyresponse.js +15 -0
  44. package/esm/models/vaultsecretlistresponse.d.ts +18 -0
  45. package/esm/models/vaultsecretlistresponse.js +21 -0
  46. package/esm/models/vaultsecretresponse.d.ts +17 -0
  47. package/esm/models/vaultsecretresponse.js +15 -0
  48. package/esm/models/vaultsecretwriterequest.d.ts +23 -0
  49. package/esm/models/vaultsecretwriterequest.js +14 -0
  50. package/esm/sdk/sdk.d.ts +3 -0
  51. package/esm/sdk/sdk.js +4 -0
  52. package/esm/sdk/vault.d.ts +55 -0
  53. package/esm/sdk/vault.js +79 -0
  54. package/jsr.json +1 -1
  55. package/package.json +6 -6
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: f701a28ac32e
4
+ */
5
+ import { encodeFormQuery, 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
+ * List workspace secrets
18
+ *
19
+ * @remarks
20
+ * Lists secret metadata for the workspace of the authenticated API key. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated with `limit` and `offset`. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
21
+ *
22
+ * If set, this operation will use {@link Security.apiKey} from the global security.
23
+ */
24
+ export function vaultListVaultSecrets(client, request, options) {
25
+ return new APIPromise($do(client, request, options));
26
+ }
27
+ async function $do(client, request, options) {
28
+ const parsed = safeParse(request, (value) => operations.ListVaultSecretsRequest$outboundSchema.optional().parse(value), "Input validation failed");
29
+ if (!parsed.ok) {
30
+ return [parsed, { status: "invalid" }];
31
+ }
32
+ const payload = parsed.value;
33
+ const body = null;
34
+ const path = pathToFunc("/vault/secrets")();
35
+ const query = encodeFormQuery({
36
+ "limit": payload?.limit,
37
+ "offset": payload?.offset,
38
+ });
39
+ const headers = new Headers(compactMap({
40
+ Accept: "application/json",
41
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload?.["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
42
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload?.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
43
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload?.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
44
+ }));
45
+ const secConfig = await extractSecurity(client._options.apiKey);
46
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
47
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
48
+ const context = {
49
+ options: client._options,
50
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
51
+ operationID: "listVaultSecrets",
52
+ oAuth2Scopes: null,
53
+ resolvedSecurity: requestSecurity,
54
+ securitySource: client._options.apiKey,
55
+ retryConfig: options?.retries
56
+ || client._options.retryConfig
57
+ || {
58
+ strategy: "backoff",
59
+ backoff: {
60
+ initialInterval: 500,
61
+ maxInterval: 60000,
62
+ exponent: 1.5,
63
+ maxElapsedTime: 3600000,
64
+ },
65
+ retryConnectionErrors: true,
66
+ }
67
+ || { strategy: "none" },
68
+ retryCodes: options?.retryCodes || ["5XX"],
69
+ };
70
+ const requestRes = client._createRequest(context, {
71
+ security: requestSecurity,
72
+ method: "GET",
73
+ baseURL: options?.serverURL,
74
+ path: path,
75
+ headers: headers,
76
+ query: query,
77
+ body: body,
78
+ userAgent: client._options.userAgent,
79
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
80
+ }, options);
81
+ if (!requestRes.ok) {
82
+ return [requestRes, { status: "invalid" }];
83
+ }
84
+ const req = requestRes.value;
85
+ const doResult = await client._do(req, {
86
+ context,
87
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
88
+ retryConfig: context.retryConfig,
89
+ retryCodes: context.retryCodes,
90
+ });
91
+ if (!doResult.ok) {
92
+ return [doResult, { status: "request-error", request: req }];
93
+ }
94
+ const response = doResult.value;
95
+ const responseFields = {
96
+ HttpMeta: { Response: response, Request: req },
97
+ };
98
+ const [result] = await M.match(M.json(200, models.VaultSecretListResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(408, errors.RequestTimeoutResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(504, errors.GatewayTimeoutResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
99
+ if (!result.ok) {
100
+ return [result, { status: "complete", request: req, response }];
101
+ }
102
+ return [result, { status: "complete", request: req, response }];
103
+ }
104
+ //# sourceMappingURL=vaultListVaultSecrets.js.map
@@ -0,0 +1,21 @@
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
+ * Store an intern secret
14
+ *
15
+ * @remarks
16
+ * Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
17
+ *
18
+ * If set, this operation will use {@link Security.apiKey} from the global security.
19
+ */
20
+ export declare function vaultStoreInternVaultSecret(client: OpenRouterCore, request: operations.StoreInternVaultSecretRequest, options?: RequestOptions): APIPromise<Result<models.VaultSecretResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.ConflictResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.GatewayTimeoutResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
21
+ //# sourceMappingURL=vaultStoreInternVaultSecret.d.ts.map
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8216704a5d50
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
+ * Store an intern secret
18
+ *
19
+ * @remarks
20
+ * Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
21
+ *
22
+ * If set, this operation will use {@link Security.apiKey} from the global security.
23
+ */
24
+ export function vaultStoreInternVaultSecret(client, request, options) {
25
+ return new APIPromise($do(client, request, options));
26
+ }
27
+ async function $do(client, request, options) {
28
+ const parsed = safeParse(request, (value) => operations.StoreInternVaultSecretRequest$outboundSchema.parse(value), "Input validation failed");
29
+ if (!parsed.ok) {
30
+ return [parsed, { status: "invalid" }];
31
+ }
32
+ const payload = parsed.value;
33
+ const body = encodeJSON("body", payload.VaultSecretWriteRequest, {
34
+ explode: true,
35
+ });
36
+ const pathParams = {
37
+ internId: encodeSimple("internId", payload.internId, {
38
+ explode: false,
39
+ charEncoding: "percent",
40
+ }),
41
+ name: encodeSimple("name", payload.name, {
42
+ explode: false,
43
+ charEncoding: "percent",
44
+ }),
45
+ };
46
+ const path = pathToFunc("/vault/interns/{internId}/secrets/{name}")(pathParams);
47
+ const headers = new Headers(compactMap({
48
+ "Content-Type": "application/json",
49
+ Accept: "application/json",
50
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
51
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
52
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
53
+ }));
54
+ const secConfig = await extractSecurity(client._options.apiKey);
55
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
56
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
57
+ const context = {
58
+ options: client._options,
59
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
60
+ operationID: "storeInternVaultSecret",
61
+ oAuth2Scopes: null,
62
+ resolvedSecurity: requestSecurity,
63
+ securitySource: client._options.apiKey,
64
+ retryConfig: options?.retries
65
+ || client._options.retryConfig
66
+ || {
67
+ strategy: "backoff",
68
+ backoff: {
69
+ initialInterval: 500,
70
+ maxInterval: 60000,
71
+ exponent: 1.5,
72
+ maxElapsedTime: 3600000,
73
+ },
74
+ retryConnectionErrors: true,
75
+ }
76
+ || { strategy: "none" },
77
+ retryCodes: options?.retryCodes || ["5XX"],
78
+ };
79
+ const requestRes = client._createRequest(context, {
80
+ security: requestSecurity,
81
+ method: "PUT",
82
+ baseURL: options?.serverURL,
83
+ path: path,
84
+ headers: headers,
85
+ body: body,
86
+ userAgent: client._options.userAgent,
87
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
88
+ }, options);
89
+ if (!requestRes.ok) {
90
+ return [requestRes, { status: "invalid" }];
91
+ }
92
+ const req = requestRes.value;
93
+ const doResult = await client._do(req, {
94
+ context,
95
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
96
+ retryConfig: context.retryConfig,
97
+ retryCodes: context.retryCodes,
98
+ });
99
+ if (!doResult.ok) {
100
+ return [doResult, { status: "request-error", request: req }];
101
+ }
102
+ const response = doResult.value;
103
+ const responseFields = {
104
+ HttpMeta: { Response: response, Request: req },
105
+ };
106
+ const [result] = await M.match(M.json(200, models.VaultSecretResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(408, errors.RequestTimeoutResponseError$inboundSchema), M.jsonErr(409, errors.ConflictResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(504, errors.GatewayTimeoutResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
107
+ if (!result.ok) {
108
+ return [result, { status: "complete", request: req, response }];
109
+ }
110
+ return [result, { status: "complete", request: req, response }];
111
+ }
112
+ //# sourceMappingURL=vaultStoreInternVaultSecret.js.map
@@ -0,0 +1,21 @@
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
+ * Store a workspace secret
14
+ *
15
+ * @remarks
16
+ * Creates or replaces a secret in the workspace of the authenticated API key. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
17
+ *
18
+ * If set, this operation will use {@link Security.apiKey} from the global security.
19
+ */
20
+ export declare function vaultStoreVaultSecret(client: OpenRouterCore, request: operations.StoreVaultSecretRequest, options?: RequestOptions): APIPromise<Result<models.VaultSecretResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.RequestTimeoutResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.GatewayTimeoutResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
21
+ //# sourceMappingURL=vaultStoreVaultSecret.d.ts.map
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 2a58f9053954
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
+ * Store a workspace secret
18
+ *
19
+ * @remarks
20
+ * Creates or replaces a secret in the workspace of the authenticated API key. The value is encrypted at rest and released only to the exact hostnames in `hosts`. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
21
+ *
22
+ * If set, this operation will use {@link Security.apiKey} from the global security.
23
+ */
24
+ export function vaultStoreVaultSecret(client, request, options) {
25
+ return new APIPromise($do(client, request, options));
26
+ }
27
+ async function $do(client, request, options) {
28
+ const parsed = safeParse(request, (value) => operations.StoreVaultSecretRequest$outboundSchema.parse(value), "Input validation failed");
29
+ if (!parsed.ok) {
30
+ return [parsed, { status: "invalid" }];
31
+ }
32
+ const payload = parsed.value;
33
+ const body = encodeJSON("body", payload.VaultSecretWriteRequest, {
34
+ explode: true,
35
+ });
36
+ const pathParams = {
37
+ name: encodeSimple("name", payload.name, {
38
+ explode: false,
39
+ charEncoding: "percent",
40
+ }),
41
+ };
42
+ const path = pathToFunc("/vault/secrets/{name}")(pathParams);
43
+ const headers = new Headers(compactMap({
44
+ "Content-Type": "application/json",
45
+ Accept: "application/json",
46
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
47
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
48
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
49
+ }));
50
+ const secConfig = await extractSecurity(client._options.apiKey);
51
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
52
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
53
+ const context = {
54
+ options: client._options,
55
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
56
+ operationID: "storeVaultSecret",
57
+ oAuth2Scopes: null,
58
+ resolvedSecurity: requestSecurity,
59
+ securitySource: client._options.apiKey,
60
+ retryConfig: options?.retries
61
+ || client._options.retryConfig
62
+ || {
63
+ strategy: "backoff",
64
+ backoff: {
65
+ initialInterval: 500,
66
+ maxInterval: 60000,
67
+ exponent: 1.5,
68
+ maxElapsedTime: 3600000,
69
+ },
70
+ retryConnectionErrors: true,
71
+ }
72
+ || { strategy: "none" },
73
+ retryCodes: options?.retryCodes || ["5XX"],
74
+ };
75
+ const requestRes = client._createRequest(context, {
76
+ security: requestSecurity,
77
+ method: "PUT",
78
+ baseURL: options?.serverURL,
79
+ path: path,
80
+ headers: headers,
81
+ body: body,
82
+ userAgent: client._options.userAgent,
83
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
84
+ }, options);
85
+ if (!requestRes.ok) {
86
+ return [requestRes, { status: "invalid" }];
87
+ }
88
+ const req = requestRes.value;
89
+ const doResult = await client._do(req, {
90
+ context,
91
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
92
+ retryConfig: context.retryConfig,
93
+ retryCodes: context.retryCodes,
94
+ });
95
+ if (!doResult.ok) {
96
+ return [doResult, { status: "request-error", request: req }];
97
+ }
98
+ const response = doResult.value;
99
+ const responseFields = {
100
+ HttpMeta: { Response: response, Request: req },
101
+ };
102
+ const [result] = await M.match(M.json(200, models.VaultSecretResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(408, errors.RequestTimeoutResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(504, errors.GatewayTimeoutResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
103
+ if (!result.ok) {
104
+ return [result, { status: "complete", request: req, response }];
105
+ }
106
+ return [result, { status: "complete", request: req, response }];
107
+ }
108
+ //# sourceMappingURL=vaultStoreVaultSecret.js.map
@@ -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.2.131";
53
+ readonly sdkVersion: "1.2.133";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.131 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.133 2.914.0 1.0.0 @openrouter/sdk";
56
56
  };
57
57
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
29
29
  export const SDK_METADATA = {
30
30
  language: "typescript",
31
31
  openapiDocVersion: "1.0.0",
32
- sdkVersion: "1.2.131",
32
+ sdkVersion: "1.2.133",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.131 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.133 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -611,6 +611,12 @@ export * from "./updateworkspaceresponse.js";
611
611
  export * from "./upsertworkspacebudgetrequest.js";
612
612
  export * from "./upsertworkspacebudgetresponse.js";
613
613
  export * from "./urlcitation.js";
614
+ export * from "./vaultsecret.js";
615
+ export * from "./vaultsecretcopyrequest.js";
616
+ export * from "./vaultsecretcopyresponse.js";
617
+ export * from "./vaultsecretlistresponse.js";
618
+ export * from "./vaultsecretresponse.js";
619
+ export * from "./vaultsecretwriterequest.js";
614
620
  export * from "./videogenerationrequest.js";
615
621
  export * from "./videogenerationresponse.js";
616
622
  export * from "./videogenerationusage.js";
@@ -615,6 +615,12 @@ export * from "./updateworkspaceresponse.js";
615
615
  export * from "./upsertworkspacebudgetrequest.js";
616
616
  export * from "./upsertworkspacebudgetresponse.js";
617
617
  export * from "./urlcitation.js";
618
+ export * from "./vaultsecret.js";
619
+ export * from "./vaultsecretcopyrequest.js";
620
+ export * from "./vaultsecretcopyresponse.js";
621
+ export * from "./vaultsecretlistresponse.js";
622
+ export * from "./vaultsecretresponse.js";
623
+ export * from "./vaultsecretwriterequest.js";
618
624
  export * from "./videogenerationrequest.js";
619
625
  export * from "./videogenerationresponse.js";
620
626
  export * from "./videogenerationusage.js";
@@ -0,0 +1,61 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ export type CopyVaultSecretsToInternGlobals = {
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 CopyVaultSecretsToInternRequest = {
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
+ /**
45
+ * UUID of an intern in the workspace selected by the API key.
46
+ */
47
+ internId: string;
48
+ vaultSecretCopyRequest: models.VaultSecretCopyRequest;
49
+ };
50
+ /** @internal */
51
+ export type CopyVaultSecretsToInternRequest$Outbound = {
52
+ "HTTP-Referer"?: string | undefined;
53
+ appTitle?: string | undefined;
54
+ appCategories?: string | undefined;
55
+ internId: string;
56
+ VaultSecretCopyRequest: models.VaultSecretCopyRequest$Outbound;
57
+ };
58
+ /** @internal */
59
+ export declare const CopyVaultSecretsToInternRequest$outboundSchema: z.ZodType<CopyVaultSecretsToInternRequest$Outbound, CopyVaultSecretsToInternRequest>;
60
+ export declare function copyVaultSecretsToInternRequestToJSON(copyVaultSecretsToInternRequest: CopyVaultSecretsToInternRequest): string;
61
+ //# sourceMappingURL=copyvaultsecretstointern.d.ts.map
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b4e134f9886d
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 CopyVaultSecretsToInternRequest$outboundSchema = z.object({
10
+ httpReferer: z.string().optional(),
11
+ appTitle: z.string().optional(),
12
+ appCategories: z.string().optional(),
13
+ internId: z.string(),
14
+ vaultSecretCopyRequest: models.VaultSecretCopyRequest$outboundSchema,
15
+ }).transform((v) => {
16
+ return remap$(v, {
17
+ httpReferer: "HTTP-Referer",
18
+ vaultSecretCopyRequest: "VaultSecretCopyRequest",
19
+ });
20
+ });
21
+ export function copyVaultSecretsToInternRequestToJSON(copyVaultSecretsToInternRequest) {
22
+ return JSON.stringify(CopyVaultSecretsToInternRequest$outboundSchema.parse(copyVaultSecretsToInternRequest));
23
+ }
24
+ //# sourceMappingURL=copyvaultsecretstointern.js.map
@@ -58,6 +58,10 @@ export type CreateAudioTranscriptionsMultipartRequestBody = {
58
58
  * The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).
59
59
  */
60
60
  responseFormat?: ResponseFormat | undefined;
61
+ /**
62
+ * A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.
63
+ */
64
+ sessionId?: string | undefined;
61
65
  /**
62
66
  * The sampling temperature.
63
67
  */
@@ -66,6 +70,14 @@ export type CreateAudioTranscriptionsMultipartRequestBody = {
66
70
  * Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array.
67
71
  */
68
72
  timestampGranularities?: Array<TimestampGranularities> | undefined;
73
+ /**
74
+ * JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object.
75
+ */
76
+ trace?: string | undefined;
77
+ /**
78
+ * A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.
79
+ */
80
+ user?: string | undefined;
69
81
  };
70
82
  export type CreateAudioTranscriptionsMultipartRequest = {
71
83
  /**
@@ -107,8 +119,11 @@ export type CreateAudioTranscriptionsMultipartRequestBody$Outbound = {
107
119
  language?: string | undefined;
108
120
  model: string;
109
121
  response_format?: string | undefined;
122
+ session_id?: string | undefined;
110
123
  temperature?: number | undefined;
111
124
  "timestamp_granularities[]"?: Array<string> | undefined;
125
+ trace?: string | undefined;
126
+ user?: string | undefined;
112
127
  };
113
128
  /** @internal */
114
129
  export declare const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema: z.ZodType<CreateAudioTranscriptionsMultipartRequestBody$Outbound, CreateAudioTranscriptionsMultipartRequestBody>;
@@ -41,12 +41,16 @@ export const CreateAudioTranscriptionsMultipartRequestBody$outboundSchema = z.ob
41
41
  language: z.string().optional(),
42
42
  model: z.string(),
43
43
  responseFormat: ResponseFormat$outboundSchema.optional(),
44
+ sessionId: z.string().optional(),
44
45
  temperature: z.number().optional(),
45
46
  timestampGranularities: z.array(TimestampGranularities$outboundSchema)
46
47
  .optional(),
48
+ trace: z.string().optional(),
49
+ user: z.string().optional(),
47
50
  }).transform((v) => {
48
51
  return remap$(v, {
49
52
  responseFormat: "response_format",
53
+ sessionId: "session_id",
50
54
  timestampGranularities: "timestamp_granularities[]",
51
55
  });
52
56
  });
@@ -0,0 +1,63 @@
1
+ import * as z from "zod/v4";
2
+ export type DeleteInternVaultSecretGlobals = {
3
+ /**
4
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
5
+ *
6
+ * @remarks
7
+ * This is used to track API usage per application.
8
+ */
9
+ httpReferer?: string | undefined;
10
+ /**
11
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
12
+ *
13
+ * @remarks
14
+ */
15
+ appTitle?: string | undefined;
16
+ /**
17
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
18
+ *
19
+ * @remarks
20
+ */
21
+ appCategories?: string | undefined;
22
+ };
23
+ export type DeleteInternVaultSecretRequest = {
24
+ /**
25
+ * The app identifier should be your app's URL and is used as the primary identifier for rankings.
26
+ *
27
+ * @remarks
28
+ * This is used to track API usage per application.
29
+ */
30
+ httpReferer?: string | undefined;
31
+ /**
32
+ * The app display name allows you to customize how your app appears in OpenRouter's dashboard.
33
+ *
34
+ * @remarks
35
+ */
36
+ appTitle?: string | undefined;
37
+ /**
38
+ * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
39
+ *
40
+ * @remarks
41
+ */
42
+ appCategories?: string | undefined;
43
+ /**
44
+ * UUID of an intern in the workspace selected by the API key.
45
+ */
46
+ internId: string;
47
+ /**
48
+ * Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.
49
+ */
50
+ name: string;
51
+ };
52
+ /** @internal */
53
+ export type DeleteInternVaultSecretRequest$Outbound = {
54
+ "HTTP-Referer"?: string | undefined;
55
+ appTitle?: string | undefined;
56
+ appCategories?: string | undefined;
57
+ internId: string;
58
+ name: string;
59
+ };
60
+ /** @internal */
61
+ export declare const DeleteInternVaultSecretRequest$outboundSchema: z.ZodType<DeleteInternVaultSecretRequest$Outbound, DeleteInternVaultSecretRequest>;
62
+ export declare function deleteInternVaultSecretRequestToJSON(deleteInternVaultSecretRequest: DeleteInternVaultSecretRequest): string;
63
+ //# sourceMappingURL=deleteinternvaultsecret.d.ts.map
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: b715772a86c5
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ /** @internal */
8
+ export const DeleteInternVaultSecretRequest$outboundSchema = z.object({
9
+ httpReferer: z.string().optional(),
10
+ appTitle: z.string().optional(),
11
+ appCategories: z.string().optional(),
12
+ internId: z.string(),
13
+ name: z.string(),
14
+ }).transform((v) => {
15
+ return remap$(v, {
16
+ httpReferer: "HTTP-Referer",
17
+ });
18
+ });
19
+ export function deleteInternVaultSecretRequestToJSON(deleteInternVaultSecretRequest) {
20
+ return JSON.stringify(DeleteInternVaultSecretRequest$outboundSchema.parse(deleteInternVaultSecretRequest));
21
+ }
22
+ //# sourceMappingURL=deleteinternvaultsecret.js.map