> ## Documentation Index > Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt > Use this file to discover all available pages before exploring further. # Private Endpoints > Private Endpoints endpoints ## Overview Private Endpoints endpoints ### Available Operations * [list](#list) - List private endpoints * [create](#create) - Create a private endpoint * [delete](#delete) - Delete a private endpoint * [get](#get) - Get a private endpoint * [update](#update) - Update a private endpoint * [activate](#activate) - Activate a validated private endpoint * [disable](#disable) - Disable a private endpoint * [enable](#enable) - Enable a private endpoint * [validate](#validate) - Validate a draft private endpoint ## list List the organization's private endpoints, including drafts. Requires the private endpoints entitlement. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.list(); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsList } from "@openrouter/sdk/funcs/privateEndpointsList.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsList(openRouter); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsList failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.ListPrivateEndpointsRequest](../../models/operations/listprivateendpointsrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ListPrivateEndpointsResponse](../../models/listprivateendpointsresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## create Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools`. The response does not echo `declared_parameters` or `tested_parameters`; read them with `GET /private-endpoints/{id}`. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.create({ createPrivateEndpointRequest: { modelPermaslug: "openai/gpt-4o-2024-08-06", providerSlug: "azure", upstreamModelId: "gpt-4o-prod", }, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsCreate } from "@openrouter/sdk/funcs/privateEndpointsCreate.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsCreate(openRouter, { createPrivateEndpointRequest: { modelPermaslug: "openai/gpt-4o-2024-08-06", providerSlug: "azure", upstreamModelId: "gpt-4o-prod", }, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsCreate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.CreatePrivateEndpointRequest](../../models/operations/createprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ManagedPrivateEndpointResponse](../../models/managedprivateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.CreatePrivateEndpointValidationFailedResponseError | 404 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.CreatePrivateEndpointValidationFailedResponseError | 409 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.CreatePrivateEndpointValidationFailedResponseError | 422 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.CreatePrivateEndpointValidationFailedResponseError | 500 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.CreatePrivateEndpointValidationFailedResponseError | 502 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## delete Delete a private endpoint and stop routing to it. Pass `draft_only=true` to refuse (409) when the endpoint has been activated. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.delete({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsDelete } from "@openrouter/sdk/funcs/privateEndpointsDelete.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsDelete(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsDelete failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.DeletePrivateEndpointRequest](../../models/operations/deleteprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.DeletePrivateEndpointResponse](../../models/deleteprivateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## get Get one private endpoint with its upstream configuration and current pricing. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.get({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsGet } from "@openrouter/sdk/funcs/privateEndpointsGet.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsGet(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsGet failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.GetPrivateEndpointRequest](../../models/operations/getprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.PrivateEndpointResponse](../../models/privateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## update Change any of the endpoint fields you own in one call; only the fields present change, and the response is the whole endpoint. `pricing` and `declared_parameters` replace their stored value, `settings` changes only the fields it names (`null` clears a limit or restores the provider default); routing picks these up for subsequent requests on drafts and active endpoints alike. `declared_zdr` and `declared_region` change on drafts and active endpoints alike; on an active endpoint the change keeps its validation and tested parameters, and routing applies it to subsequent requests. `upstream_model_id` and `base_url` re-point a draft: an omitted `upstream_model_id` or `base_url` keeps the stored one, omitted data-policy declarations are kept while the upstream is unchanged and cleared when it changes, and any change to the upstream or declarations of a draft clears earlier validation. Naming `upstream_model_id` or `base_url` on an active endpoint returns 409 `already_active` and writes nothing, even alongside other fields; delete and re-create instead. Every group is checked before anything is written: 400 `parameters_invalid` when `tool_choice` is declared without `tools` tested or declared, 400 `settings_invalid` when `max_prompt_tokens` exceeds the context length, both completion APIs are off, or `excluded_parameters` names a tested parameter, 422 `pricing_invalid` for rates the provider strategy cannot represent, or `pricing_cache_read_unsupported` or `pricing_cache_write_unsupported` when that rate is a cache rate the strategy has no SKU for. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.update({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", updatePrivateEndpointRequest: {}, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsUpdate } from "@openrouter/sdk/funcs/privateEndpointsUpdate.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsUpdate(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", updatePrivateEndpointRequest: {}, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsUpdate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.UpdatePrivateEndpointRequest](../../models/operations/updateprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.PrivateEndpointResponse](../../models/privateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## activate Make a validated draft routable. Returns 409 when the endpoint was never validated, the validation is stale, or it is already active. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.activate({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsActivate } from "@openrouter/sdk/funcs/privateEndpointsActivate.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsActivate(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsActivate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.ActivatePrivateEndpointRequest](../../models/operations/activateprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ManagedPrivateEndpointResponse](../../models/managedprivateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## disable Stop routing to an active endpoint without deleting it. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.disable({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsDisable } from "@openrouter/sdk/funcs/privateEndpointsDisable.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsDisable(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsDisable failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.DisablePrivateEndpointRequest](../../models/operations/disableprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ManagedPrivateEndpointResponse](../../models/managedprivateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## enable Resume routing to a disabled endpoint. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.enable({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsEnable } from "@openrouter/sdk/funcs/privateEndpointsEnable.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsEnable(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsEnable failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.EnablePrivateEndpointRequest](../../models/operations/enableprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.ManagedPrivateEndpointResponse](../../models/managedprivateendpointresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | ## validate Send a live test request to the draft endpoint using the given workspace's BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](https://openrouter.ai/docs/client-sdks/typescript/docs/guides/overview/auth/management-api-keys) required. ### Example Usage ```typescript theme={null} import { OpenRouter } from "@openrouter/sdk"; const openRouter = new OpenRouter({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const result = await openRouter.privateEndpoints.validate({ id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", validatePrivateEndpointRequest: { workspaceId: "550e8400-e29b-41d4-a716-446655440000", }, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript theme={null} import { OpenRouterCore } from "@openrouter/sdk/core.js"; import { privateEndpointsValidate } from "@openrouter/sdk/funcs/privateEndpointsValidate.js"; // Use `OpenRouterCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const openRouter = new OpenRouterCore({ httpReferer: "", appTitle: "", appCategories: "", apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); async function run() { const res = await privateEndpointsValidate(openRouter, { id: "5b1c4c4e-7d0a-4a8e-9f3a-2d6c1b0e8a11", validatePrivateEndpointRequest: { workspaceId: "550e8400-e29b-41d4-a716-446655440000", }, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("privateEndpointsValidate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `request` | [operations.ValidatePrivateEndpointRequest](../../models/operations/validateprivateendpointrequest.mdx) | ✔️ | The request object to use for the request. | | `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[models.PrivateEndpointValidationResponse](../../models/privateendpointvalidationresponse.mdx)>** ### Errors | Error Type | Status Code | Content Type | | - | - | - | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | | errors.ForbiddenResponseError | 403 | application/json | | errors.NotFoundResponseError | 404 | application/json | | errors.RequestTimeoutResponseError | 408 | application/json | | errors.ConflictResponseError | 409 | application/json | | errors.UnprocessableEntityResponseError | 422 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.BadGatewayResponseError | 502 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |