Overview
Store host-bound secrets for a workspace or for one intern. Scope is selected by the API key. Responses return metadata only, never secret values. See https://openrouter.ai/docs/guides/ori/vault.Available Operations
- listInternVaultSecrets - List intern secrets
- deleteInternVaultSecret - Delete an intern secret
- storeInternVaultSecret - Store an intern secret
- copyVaultSecretsToIntern - Copy workspace secrets to an intern
- listVaultSecrets - List workspace secrets
- deleteVaultSecret - Delete a workspace secret
- storeVaultSecret - Store a workspace secret
listInternVaultSecrets
Lists secret metadata stored for one intern. Responses contain names, bound hosts, fingerprints and creation times, never secret values. Results are ordered by name and paginated withlimit 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 required.
Example Usage
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.listInternVaultSecrets({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
limit: 50,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultListInternVaultSecrets } from "@openrouter/sdk/funcs/vaultListInternVaultSecrets.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultListInternVaultSecrets(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
limit: 50,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultListInternVaultSecrets failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListInternVaultSecretsRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.VaultSecretListResponse>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.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
deleteInternVaultSecret
Deletes a secret stored for one intern. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. 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 aseu.openrouter.ai are refused. API key required.
Example Usage
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
await openRouter.vault.deleteInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
});
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultDeleteInternVaultSecret } from "@openrouter/sdk/funcs/vaultDeleteInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultDeleteInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("vaultDeleteInternVaultSecret failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteInternVaultSecretRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>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.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
storeInternVaultSecret
Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames inhosts. 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 required.
Example Usage: body-timed-out
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: body-too-large
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: internal-error
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: invalid-or-missing-api-key
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: invalid-vault-request
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: invalid-vault-response
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: not-found
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: rate-limited
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: regional-hostname
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: route-deadline
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: transfer-in-progress
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: vault-request-failed
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: vault-timed-out
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: vault-unavailable
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: workspace-scope-unavailable
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Example Usage: writes-disabled
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeInternVaultSecret({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreInternVaultSecret } from "@openrouter/sdk/funcs/vaultStoreInternVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreInternVaultSecret(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreInternVaultSecret failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.StoreInternVaultSecretRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.VaultSecretResponse>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.PayloadTooLargeResponseError | 413 | application/json |
| errors.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
copyVaultSecretsToIntern
Copies the named workspace secrets into one intern’s scope, replacing any intern secret with the same name. Each copy keeps the source value and host bindings. Every name must exist in the workspace scope or the request fails with 404 and nothing is copied. A workspace secret whosehosts is null cannot be copied: the request fails with 409 and nothing is copied until that secret is stored again with 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 required.
Example Usage: body-timed-out
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: body-too-large
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: copy-conflict
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: internal-error
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: invalid-or-missing-api-key
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: invalid-vault-request
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: invalid-vault-response
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: not-found
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: rate-limited
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: regional-hostname
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: route-deadline
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: vault-request-failed
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: vault-timed-out
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: vault-unavailable
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: workspace-scope-unavailable
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Example Usage: writes-disabled
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.copyVaultSecretsToIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultCopyVaultSecretsToIntern } from "@openrouter/sdk/funcs/vaultCopyVaultSecretsToIntern.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultCopyVaultSecretsToIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
vaultSecretCopyRequest: {
names: [
"github_token",
],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultCopyVaultSecretsToIntern failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CopyVaultSecretsToInternRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.VaultSecretCopyResponse>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.PayloadTooLargeResponseError | 413 | application/json |
| errors.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
listVaultSecrets
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 withlimit 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 required.
Example Usage
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.listVaultSecrets();
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultListVaultSecrets } from "@openrouter/sdk/funcs/vaultListVaultSecrets.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultListVaultSecrets(openRouter);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultListVaultSecrets failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListVaultSecretsRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.VaultSecretListResponse>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.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
deleteVaultSecret
Deletes a secret from the workspace of the authenticated API key. Returns 204 with no body on success and 404 when the secret does not exist in the selected scope. 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 aseu.openrouter.ai are refused. API key required.
Example Usage
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
await openRouter.vault.deleteVaultSecret({
name: "github_token",
});
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultDeleteVaultSecret } from "@openrouter/sdk/funcs/vaultDeleteVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultDeleteVaultSecret(openRouter, {
name: "github_token",
});
if (res.ok) {
const { value: result } = res;
} else {
console.log("vaultDeleteVaultSecret failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteVaultSecretRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<void>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.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |
storeVaultSecret
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 inhosts. 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 required.
Example Usage: body-timed-out
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: body-too-large
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: internal-error
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: invalid-or-missing-api-key
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: invalid-vault-request
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: invalid-vault-response
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: not-found
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: rate-limited
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: regional-hostname
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: route-deadline
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: vault-request-failed
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: vault-timed-out
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: vault-unavailable
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: workspace-scope-unavailable
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Example Usage: writes-disabled
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.vault.storeVaultSecret({
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { vaultStoreVaultSecret } from "@openrouter/sdk/funcs/vaultStoreVaultSecret.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: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await vaultStoreVaultSecret(openRouter, {
name: "github_token",
vaultSecretWriteRequest: {
hosts: [
"api.github.com",
],
value: "ghp_exampleTokenValue",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("vaultStoreVaultSecret failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.StoreVaultSecretRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | 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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.VaultSecretResponse>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.PayloadTooLargeResponseError | 413 | application/json |
| errors.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.BadGatewayResponseError | 502 | application/json |
| errors.ServiceUnavailableResponseError | 503 | application/json |
| errors.GatewayTimeoutResponseError | 504 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |