@openrouter/sdk 1.2.133 → 1.2.135

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 (64) hide show
  1. package/esm/funcs/internsCreateIntern.d.ts +21 -0
  2. package/esm/funcs/internsCreateIntern.js +103 -0
  3. package/esm/funcs/internsDeleteIntern.d.ts +21 -0
  4. package/esm/funcs/internsDeleteIntern.js +105 -0
  5. package/esm/funcs/internsGetIntern.d.ts +21 -0
  6. package/esm/funcs/internsGetIntern.js +105 -0
  7. package/esm/funcs/internsListInterns.d.ts +21 -0
  8. package/esm/funcs/internsListInterns.js +106 -0
  9. package/esm/funcs/internsProvisionIntern.d.ts +21 -0
  10. package/esm/funcs/internsProvisionIntern.js +105 -0
  11. package/esm/funcs/internsSuspendIntern.d.ts +21 -0
  12. package/esm/funcs/internsSuspendIntern.js +105 -0
  13. package/esm/funcs/internsUpdateIntern.d.ts +21 -0
  14. package/esm/funcs/internsUpdateIntern.js +108 -0
  15. package/esm/lib/config.d.ts +2 -2
  16. package/esm/lib/config.js +2 -2
  17. package/esm/models/anthropicimageblockparam.d.ts +5 -4
  18. package/esm/models/anthropicimageblockparam.js +3 -0
  19. package/esm/models/createinternrequest.d.ts +43 -0
  20. package/esm/models/createinternrequest.js +24 -0
  21. package/esm/models/deleteinternresponse.d.ts +10 -0
  22. package/esm/models/deleteinternresponse.js +14 -0
  23. package/esm/models/errors/index.d.ts +1 -0
  24. package/esm/models/errors/index.js +1 -0
  25. package/esm/models/errors/internlifecycleerror.d.ts +25 -0
  26. package/esm/models/errors/internlifecycleerror.js +35 -0
  27. package/esm/models/index.d.ts +8 -0
  28. package/esm/models/index.js +8 -0
  29. package/esm/models/intern.d.ts +108 -0
  30. package/esm/models/intern.js +58 -0
  31. package/esm/models/internlifecycleerror.d.ts +15 -0
  32. package/esm/models/internlifecycleerror.js +23 -0
  33. package/esm/models/internlistresponse.d.ts +18 -0
  34. package/esm/models/internlistresponse.js +21 -0
  35. package/esm/models/operations/createintern.d.ts +61 -0
  36. package/esm/models/operations/createintern.js +25 -0
  37. package/esm/models/operations/deleteintern.d.ts +58 -0
  38. package/esm/models/operations/deleteintern.js +21 -0
  39. package/esm/models/operations/getintern.d.ts +58 -0
  40. package/esm/models/operations/getintern.js +21 -0
  41. package/esm/models/operations/index.d.ts +7 -0
  42. package/esm/models/operations/index.js +7 -0
  43. package/esm/models/operations/listinterns.d.ts +82 -0
  44. package/esm/models/operations/listinterns.js +38 -0
  45. package/esm/models/operations/provisionintern.d.ts +58 -0
  46. package/esm/models/operations/provisionintern.js +21 -0
  47. package/esm/models/operations/suspendintern.d.ts +58 -0
  48. package/esm/models/operations/suspendintern.js +21 -0
  49. package/esm/models/operations/updateintern.d.ts +61 -0
  50. package/esm/models/operations/updateintern.js +24 -0
  51. package/esm/models/provisioninternresponse.d.ts +10 -0
  52. package/esm/models/provisioninternresponse.js +14 -0
  53. package/esm/models/responseserrorfield.d.ts +4 -4
  54. package/esm/models/responseserrorfield.js +4 -4
  55. package/esm/models/suspendinternresponse.d.ts +10 -0
  56. package/esm/models/suspendinternresponse.js +14 -0
  57. package/esm/models/updateinternrequest.d.ts +33 -0
  58. package/esm/models/updateinternrequest.js +16 -0
  59. package/esm/sdk/interns.d.ts +55 -0
  60. package/esm/sdk/interns.js +79 -0
  61. package/esm/sdk/sdk.d.ts +3 -0
  62. package/esm/sdk/sdk.js +4 -0
  63. package/jsr.json +1 -1
  64. package/package.json +5 -5
@@ -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
+ * Suspend an intern
14
+ *
15
+ * @remarks
16
+ * Stops the intern runtime while keeping its disk and configuration for a later provision call. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. 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 internsSuspendIntern(client: OpenRouterCore, request: operations.SuspendInternRequest, options?: RequestOptions): APIPromise<Result<models.SuspendInternResponse, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
21
+ //# sourceMappingURL=internsSuspendIntern.d.ts.map
@@ -0,0 +1,105 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 5928ef254c09
4
+ */
5
+ import { 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
+ * Suspend an intern
18
+ *
19
+ * @remarks
20
+ * Stops the intern runtime while keeping its disk and configuration for a later provision call. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. 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 internsSuspendIntern(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.SuspendInternRequest$outboundSchema.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 pathParams = {
35
+ internId: encodeSimple("internId", payload.internId, {
36
+ explode: false,
37
+ charEncoding: "percent",
38
+ }),
39
+ };
40
+ const path = pathToFunc("/interns/{internId}/suspend")(pathParams);
41
+ const headers = new Headers(compactMap({
42
+ Accept: "application/json",
43
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
44
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
45
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
46
+ }));
47
+ const secConfig = await extractSecurity(client._options.apiKey);
48
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
49
+ const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
50
+ const context = {
51
+ options: client._options,
52
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
53
+ operationID: "suspendIntern",
54
+ oAuth2Scopes: null,
55
+ resolvedSecurity: requestSecurity,
56
+ securitySource: client._options.apiKey,
57
+ retryConfig: options?.retries
58
+ || client._options.retryConfig
59
+ || {
60
+ strategy: "backoff",
61
+ backoff: {
62
+ initialInterval: 500,
63
+ maxInterval: 60000,
64
+ exponent: 1.5,
65
+ maxElapsedTime: 3600000,
66
+ },
67
+ retryConnectionErrors: true,
68
+ }
69
+ || { strategy: "none" },
70
+ retryCodes: options?.retryCodes || ["5XX"],
71
+ };
72
+ const requestRes = client._createRequest(context, {
73
+ security: requestSecurity,
74
+ method: "POST",
75
+ baseURL: options?.serverURL,
76
+ path: path,
77
+ headers: headers,
78
+ body: body,
79
+ userAgent: client._options.userAgent,
80
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
81
+ }, options);
82
+ if (!requestRes.ok) {
83
+ return [requestRes, { status: "invalid" }];
84
+ }
85
+ const req = requestRes.value;
86
+ const doResult = await client._do(req, {
87
+ context,
88
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
89
+ retryConfig: context.retryConfig,
90
+ retryCodes: context.retryCodes,
91
+ });
92
+ if (!doResult.ok) {
93
+ return [doResult, { status: "request-error", request: req }];
94
+ }
95
+ const response = doResult.value;
96
+ const responseFields = {
97
+ HttpMeta: { Response: response, Request: req },
98
+ };
99
+ const [result] = await M.match(M.json(200, models.SuspendInternResponse$inboundSchema), M.jsonErr([401, 403, 404, 408, 409], errors.InternLifecycleError$inboundSchema), M.jsonErr([500, 502], errors.InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
100
+ if (!result.ok) {
101
+ return [result, { status: "complete", request: req, response }];
102
+ }
103
+ return [result, { status: "complete", request: req, response }];
104
+ }
105
+ //# sourceMappingURL=internsSuspendIntern.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
+ * Update an intern
14
+ *
15
+ * @remarks
16
+ * Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. 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 internsUpdateIntern(client: OpenRouterCore, request: operations.UpdateInternRequest, options?: RequestOptions): APIPromise<Result<models.Intern, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
21
+ //# sourceMappingURL=internsUpdateIntern.d.ts.map
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 1d493469e489
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
+ * Update an intern
18
+ *
19
+ * @remarks
20
+ * Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. 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 internsUpdateIntern(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.UpdateInternRequest$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.UpdateInternRequest, {
34
+ explode: true,
35
+ });
36
+ const pathParams = {
37
+ internId: encodeSimple("internId", payload.internId, {
38
+ explode: false,
39
+ charEncoding: "percent",
40
+ }),
41
+ };
42
+ const path = pathToFunc("/interns/{internId}")(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: "updateIntern",
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: "PATCH",
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.Intern$inboundSchema), M.jsonErr([400, 401, 403, 404, 408, 413], errors.InternLifecycleError$inboundSchema), M.jsonErr(500, errors.InternLifecycleError$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=internsUpdateIntern.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.133";
53
+ readonly sdkVersion: "1.2.135";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.133 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.2.135 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.133",
32
+ sdkVersion: "1.2.135",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.133 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.135 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,25 +1,26 @@
1
1
  import * as z from "zod/v4";
2
2
  import { AnthropicBase64ImageSource, AnthropicBase64ImageSource$Outbound } from "./anthropicbase64imagesource.js";
3
3
  import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
4
+ import { AnthropicFileDocumentSource, AnthropicFileDocumentSource$Outbound } from "./anthropicfiledocumentsource.js";
4
5
  import { AnthropicUrlImageSource, AnthropicUrlImageSource$Outbound } from "./anthropicurlimagesource.js";
5
- export type AnthropicImageBlockParamSource = AnthropicBase64ImageSource | AnthropicUrlImageSource;
6
+ export type AnthropicImageBlockParamSource = AnthropicBase64ImageSource | AnthropicFileDocumentSource | AnthropicUrlImageSource;
6
7
  export type AnthropicImageBlockParam = {
7
8
  /**
8
9
  * Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
9
10
  */
10
11
  cacheControl?: AnthropicCacheControlDirective | undefined;
11
- source: AnthropicBase64ImageSource | AnthropicUrlImageSource;
12
+ source: AnthropicBase64ImageSource | AnthropicFileDocumentSource | AnthropicUrlImageSource;
12
13
  type: "image";
13
14
  };
14
15
  /** @internal */
15
- export type AnthropicImageBlockParamSource$Outbound = AnthropicBase64ImageSource$Outbound | AnthropicUrlImageSource$Outbound;
16
+ export type AnthropicImageBlockParamSource$Outbound = AnthropicBase64ImageSource$Outbound | AnthropicFileDocumentSource$Outbound | AnthropicUrlImageSource$Outbound;
16
17
  /** @internal */
17
18
  export declare const AnthropicImageBlockParamSource$outboundSchema: z.ZodType<AnthropicImageBlockParamSource$Outbound, AnthropicImageBlockParamSource>;
18
19
  export declare function anthropicImageBlockParamSourceToJSON(anthropicImageBlockParamSource: AnthropicImageBlockParamSource): string;
19
20
  /** @internal */
20
21
  export type AnthropicImageBlockParam$Outbound = {
21
22
  cache_control?: AnthropicCacheControlDirective$Outbound | undefined;
22
- source: AnthropicBase64ImageSource$Outbound | AnthropicUrlImageSource$Outbound;
23
+ source: AnthropicBase64ImageSource$Outbound | AnthropicFileDocumentSource$Outbound | AnthropicUrlImageSource$Outbound;
23
24
  type: "image";
24
25
  };
25
26
  /** @internal */
@@ -6,10 +6,12 @@ import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../lib/primitives.js";
7
7
  import { AnthropicBase64ImageSource$outboundSchema, } from "./anthropicbase64imagesource.js";
8
8
  import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
9
+ import { AnthropicFileDocumentSource$outboundSchema, } from "./anthropicfiledocumentsource.js";
9
10
  import { AnthropicUrlImageSource$outboundSchema, } from "./anthropicurlimagesource.js";
10
11
  /** @internal */
11
12
  export const AnthropicImageBlockParamSource$outboundSchema = z.union([
12
13
  AnthropicBase64ImageSource$outboundSchema,
14
+ AnthropicFileDocumentSource$outboundSchema,
13
15
  AnthropicUrlImageSource$outboundSchema,
14
16
  ]);
15
17
  export function anthropicImageBlockParamSourceToJSON(anthropicImageBlockParamSource) {
@@ -20,6 +22,7 @@ export const AnthropicImageBlockParam$outboundSchema = z.object({
20
22
  cacheControl: AnthropicCacheControlDirective$outboundSchema.optional(),
21
23
  source: z.union([
22
24
  AnthropicBase64ImageSource$outboundSchema,
25
+ AnthropicFileDocumentSource$outboundSchema,
23
26
  AnthropicUrlImageSource$outboundSchema,
24
27
  ]),
25
28
  type: z.literal("image"),
@@ -0,0 +1,43 @@
1
+ import * as z from "zod/v4";
2
+ /**
3
+ * Settings for a new intern in an explicit workspace.
4
+ */
5
+ export type CreateInternRequest = {
6
+ /**
7
+ * Free-form description, or null.
8
+ */
9
+ description?: string | null | undefined;
10
+ /**
11
+ * Standing instructions the intern boots with, or null.
12
+ */
13
+ instructions?: string | null | undefined;
14
+ /**
15
+ * Intern name, unique per creator within the workspace.
16
+ */
17
+ name: string;
18
+ /**
19
+ * Start provisioning during this create operation. Defaults to false.
20
+ */
21
+ provision?: boolean | undefined;
22
+ /**
23
+ * Vault owned by another intern in this workspace to attach as a borrowed vault.
24
+ */
25
+ vaultId?: string | undefined;
26
+ /**
27
+ * Workspace that will own the intern. It must match the API key workspace.
28
+ */
29
+ workspaceId: string;
30
+ };
31
+ /** @internal */
32
+ export type CreateInternRequest$Outbound = {
33
+ description?: string | null | undefined;
34
+ instructions?: string | null | undefined;
35
+ name: string;
36
+ provision: boolean;
37
+ vault_id?: string | undefined;
38
+ workspace_id: string;
39
+ };
40
+ /** @internal */
41
+ export declare const CreateInternRequest$outboundSchema: z.ZodType<CreateInternRequest$Outbound, CreateInternRequest>;
42
+ export declare function createInternRequestToJSON(createInternRequest: CreateInternRequest): string;
43
+ //# sourceMappingURL=createinternrequest.d.ts.map
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 98307ca98901
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ /** @internal */
8
+ export const CreateInternRequest$outboundSchema = z.object({
9
+ description: z.nullable(z.string()).optional(),
10
+ instructions: z.nullable(z.string()).optional(),
11
+ name: z.string(),
12
+ provision: z.boolean().default(false),
13
+ vaultId: z.string().optional(),
14
+ workspaceId: z.string(),
15
+ }).transform((v) => {
16
+ return remap$(v, {
17
+ vaultId: "vault_id",
18
+ workspaceId: "workspace_id",
19
+ });
20
+ });
21
+ export function createInternRequestToJSON(createInternRequest) {
22
+ return JSON.stringify(CreateInternRequest$outboundSchema.parse(createInternRequest));
23
+ }
24
+ //# sourceMappingURL=createinternrequest.js.map
@@ -0,0 +1,10 @@
1
+ import * as z from "zod/v4";
2
+ import { Result as SafeParseResult } from "../types/fp.js";
3
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
+ export type DeleteInternResponse = {
5
+ deleting: true;
6
+ };
7
+ /** @internal */
8
+ export declare const DeleteInternResponse$inboundSchema: z.ZodType<DeleteInternResponse, unknown>;
9
+ export declare function deleteInternResponseFromJSON(jsonString: string): SafeParseResult<DeleteInternResponse, SDKValidationError>;
10
+ //# sourceMappingURL=deleteinternresponse.d.ts.map
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 280574b56b8f
4
+ */
5
+ import * as z from "zod/v4";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ /** @internal */
8
+ export const DeleteInternResponse$inboundSchema = z.object({
9
+ deleting: z.literal(true),
10
+ });
11
+ export function deleteInternResponseFromJSON(jsonString) {
12
+ return safeParse(jsonString, (x) => DeleteInternResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteInternResponse' from JSON`);
13
+ }
14
+ //# sourceMappingURL=deleteinternresponse.js.map
@@ -7,6 +7,7 @@ export * from "./gatewaytimeoutresponseerror.js";
7
7
  export * from "./goneresponseerror.js";
8
8
  export * from "./httpclienterrors.js";
9
9
  export * from "./internalserverresponseerror.js";
10
+ export * from "./internlifecycleerror.js";
10
11
  export * from "./notfoundresponseerror.js";
11
12
  export * from "./oautherrorresponse.js";
12
13
  export * from "./openrouterdefaulterror.js";
@@ -11,6 +11,7 @@ export * from "./gatewaytimeoutresponseerror.js";
11
11
  export * from "./goneresponseerror.js";
12
12
  export * from "./httpclienterrors.js";
13
13
  export * from "./internalserverresponseerror.js";
14
+ export * from "./internlifecycleerror.js";
14
15
  export * from "./notfoundresponseerror.js";
15
16
  export * from "./oautherrorresponse.js";
16
17
  export * from "./openrouterdefaulterror.js";
@@ -0,0 +1,25 @@
1
+ import * as z from "zod/v4";
2
+ import * as models from "../index.js";
3
+ import { OpenRouterError } from "./openroutererror.js";
4
+ /**
5
+ * Intern lifecycle request failure.
6
+ */
7
+ export type InternLifecycleErrorData = {
8
+ error: models.InternLifecycleErrorError;
9
+ };
10
+ /**
11
+ * Intern lifecycle request failure.
12
+ */
13
+ export declare class InternLifecycleError extends OpenRouterError {
14
+ error: models.InternLifecycleErrorError;
15
+ /** The original data that was passed to this error instance. */
16
+ data$: InternLifecycleErrorData;
17
+ constructor(err: InternLifecycleErrorData, httpMeta: {
18
+ response: Response;
19
+ request: Request;
20
+ body: string;
21
+ });
22
+ }
23
+ /** @internal */
24
+ export declare const InternLifecycleError$inboundSchema: z.ZodType<InternLifecycleError, unknown>;
25
+ //# sourceMappingURL=internlifecycleerror.d.ts.map
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 31cfc72977f7
4
+ */
5
+ import * as z from "zod/v4";
6
+ import * as models from "../index.js";
7
+ import { OpenRouterError } from "./openroutererror.js";
8
+ /**
9
+ * Intern lifecycle request failure.
10
+ */
11
+ export class InternLifecycleError extends OpenRouterError {
12
+ constructor(err, httpMeta) {
13
+ const message = err.error?.message
14
+ || `API error occurred: ${JSON.stringify(err)}`;
15
+ super(message, httpMeta);
16
+ this.data$ = err;
17
+ this.error = err.error;
18
+ this.name = "InternLifecycleError";
19
+ }
20
+ }
21
+ /** @internal */
22
+ export const InternLifecycleError$inboundSchema = z.object({
23
+ error: z.lazy(() => models.InternLifecycleErrorError$inboundSchema),
24
+ request$: z.custom(x => x instanceof Request),
25
+ response$: z.custom(x => x instanceof Response),
26
+ body$: z.string(),
27
+ })
28
+ .transform((v) => {
29
+ return new InternLifecycleError(v, {
30
+ request: v.request$,
31
+ response: v.response$,
32
+ body: v.body$,
33
+ });
34
+ });
35
+ //# sourceMappingURL=internlifecycleerror.js.map
@@ -180,6 +180,7 @@ export * from "./createbyokkeyrequest.js";
180
180
  export * from "./createbyokkeyresponse.js";
181
181
  export * from "./createguardrailrequest.js";
182
182
  export * from "./createguardrailresponse.js";
183
+ export * from "./createinternrequest.js";
183
184
  export * from "./createobservabilitydestinationrequest.js";
184
185
  export * from "./createobservabilitydestinationresponse.js";
185
186
  export * from "./createpresetfrominferenceresponse.js";
@@ -200,6 +201,7 @@ export * from "./debugevent.js";
200
201
  export * from "./defaultparameters.js";
201
202
  export * from "./deletebyokkeyresponse.js";
202
203
  export * from "./deleteguardrailresponse.js";
204
+ export * from "./deleteinternresponse.js";
203
205
  export * from "./deleteobservabilitydestinationresponse.js";
204
206
  export * from "./deletescimgroupmappingresponse.js";
205
207
  export * from "./deleteworkspacebudgetresponse.js";
@@ -304,7 +306,10 @@ export * from "./inputsunion.js";
304
306
  export * from "./inputtext.js";
305
307
  export * from "./inputvideo.js";
306
308
  export * from "./instructtype.js";
309
+ export * from "./intern.js";
307
310
  export * from "./internalserverresponseerrordata.js";
311
+ export * from "./internlifecycleerror.js";
312
+ export * from "./internlistresponse.js";
308
313
  export * from "./itemreferenceitem.js";
309
314
  export * from "./keyassignment.js";
310
315
  export * from "./legacychatcontentvideo.js";
@@ -477,6 +482,7 @@ export * from "./providerpreferences.js";
477
482
  export * from "./providerresponse.js";
478
483
  export * from "./providersort.js";
479
484
  export * from "./providersortconfig.js";
485
+ export * from "./provisioninternresponse.js";
480
486
  export * from "./publicendpoint.js";
481
487
  export * from "./publicpricing.js";
482
488
  export * from "./quantization.js";
@@ -570,6 +576,7 @@ export * from "./subagentservertoolconfig.js";
570
576
  export * from "./subagentservertoolopenrouter.js";
571
577
  export * from "./submitgenerationfeedbackrequest.js";
572
578
  export * from "./submitgenerationfeedbackresponse.js";
579
+ export * from "./suspendinternresponse.js";
573
580
  export * from "./taskclassificationitem.js";
574
581
  export * from "./taskclassificationmacrocategory.js";
575
582
  export * from "./taskclassificationmodel.js";
@@ -602,6 +609,7 @@ export * from "./updatebyokkeyrequest.js";
602
609
  export * from "./updatebyokkeyresponse.js";
603
610
  export * from "./updateguardrailrequest.js";
604
611
  export * from "./updateguardrailresponse.js";
612
+ export * from "./updateinternrequest.js";
605
613
  export * from "./updateobservabilitydestinationrequest.js";
606
614
  export * from "./updateobservabilitydestinationresponse.js";
607
615
  export * from "./updatescimgroupmappingrequest.js";
@@ -184,6 +184,7 @@ export * from "./createbyokkeyrequest.js";
184
184
  export * from "./createbyokkeyresponse.js";
185
185
  export * from "./createguardrailrequest.js";
186
186
  export * from "./createguardrailresponse.js";
187
+ export * from "./createinternrequest.js";
187
188
  export * from "./createobservabilitydestinationrequest.js";
188
189
  export * from "./createobservabilitydestinationresponse.js";
189
190
  export * from "./createpresetfrominferenceresponse.js";
@@ -204,6 +205,7 @@ export * from "./debugevent.js";
204
205
  export * from "./defaultparameters.js";
205
206
  export * from "./deletebyokkeyresponse.js";
206
207
  export * from "./deleteguardrailresponse.js";
208
+ export * from "./deleteinternresponse.js";
207
209
  export * from "./deleteobservabilitydestinationresponse.js";
208
210
  export * from "./deletescimgroupmappingresponse.js";
209
211
  export * from "./deleteworkspacebudgetresponse.js";
@@ -308,7 +310,10 @@ export * from "./inputsunion.js";
308
310
  export * from "./inputtext.js";
309
311
  export * from "./inputvideo.js";
310
312
  export * from "./instructtype.js";
313
+ export * from "./intern.js";
311
314
  export * from "./internalserverresponseerrordata.js";
315
+ export * from "./internlifecycleerror.js";
316
+ export * from "./internlistresponse.js";
312
317
  export * from "./itemreferenceitem.js";
313
318
  export * from "./keyassignment.js";
314
319
  export * from "./legacychatcontentvideo.js";
@@ -481,6 +486,7 @@ export * from "./providerpreferences.js";
481
486
  export * from "./providerresponse.js";
482
487
  export * from "./providersort.js";
483
488
  export * from "./providersortconfig.js";
489
+ export * from "./provisioninternresponse.js";
484
490
  export * from "./publicendpoint.js";
485
491
  export * from "./publicpricing.js";
486
492
  export * from "./quantization.js";
@@ -574,6 +580,7 @@ export * from "./subagentservertoolconfig.js";
574
580
  export * from "./subagentservertoolopenrouter.js";
575
581
  export * from "./submitgenerationfeedbackrequest.js";
576
582
  export * from "./submitgenerationfeedbackresponse.js";
583
+ export * from "./suspendinternresponse.js";
577
584
  export * from "./taskclassificationitem.js";
578
585
  export * from "./taskclassificationmacrocategory.js";
579
586
  export * from "./taskclassificationmodel.js";
@@ -606,6 +613,7 @@ export * from "./updatebyokkeyrequest.js";
606
613
  export * from "./updatebyokkeyresponse.js";
607
614
  export * from "./updateguardrailrequest.js";
608
615
  export * from "./updateguardrailresponse.js";
616
+ export * from "./updateinternrequest.js";
609
617
  export * from "./updateobservabilitydestinationrequest.js";
610
618
  export * from "./updateobservabilitydestinationresponse.js";
611
619
  export * from "./updatescimgroupmappingrequest.js";