Vault

Store an intern secret

Changed on

Creates or replaces a secret stored for one intern. The value is encrypted at rest and released only to the exact hostnames in hosts. The response carries metadata only. Writes return 503 while vault writes are disabled for the caller. The scope is selected by the API key: workspace routes act on the key's active workspace and intern routes act on one intern inside that workspace. There is no default workspace and no fallback to another scope. Every vault route, including reads, requires access to the Intern API programme and returns 404 outside it. An intern's own API key is confined to that intern: it can always read the intern's secrets and effective secrets, writes to them follow the rules above, and every other intern and every workspace route answers 404. Requests on regional hostnames such as eu.openrouter.ai are refused. API key required.

put/vault/interns/{internId}/secrets/{name}

Request

  • Base URL
    https://openrouter.ai/api/v1
  • Auth
    HTTP bearer

Path parameters

internId, string uuid required

UUID of an intern in the workspace selected by the API key.

Example:7c9e6679-7425-40de-944b-e07fc1f90ae7
name, string required

Secret name. Lowercase letters, digits and single underscores, starting with a letter and not ending with an underscore, 1 to 255 characters.

Example:github_token

Request body

VaultSecretWriteRequest required

Secret value and the exact hostnames it may be released to.

hosts, string[] required

Exact DNS hostnames the secret may be sent to, 1 to 100 entries. Each entry is lowercased and a trailing dot is removed, so API.Example.com. is stored as api.example.com. Schemes, ports, paths, wildcards and empty values are rejected. Duplicates after normalization are collapsed. Matching is exact: a secret bound to api.example.com is never released to example.com or any other hostname.

value, string required

Secret value, 1 to 65536 characters; a header-set credential (a JSON object of header name to value) may run to 985721 characters. It is encrypted at rest and never returned.

Example request

{
  "hosts": [
    "api.github.com"
  ],
  "value": "ghp_exampleTokenValue"
}

Response

Metadata for the stored secret.

VaultSecretResponse required

Metadata for the stored secret.

data, VaultSecret required

Metadata for one stored secret. The secret value is never returned. fingerprint is an HMAC-SHA-256 of the value keyed with that vault's own data key, so it is comparable only within one vault: equal fingerprints in one vault mean equal values, and rewriting the same value keeps its fingerprint. The same value stored in two vaults (for example a workspace secret and its intern copy) carries different fingerprints, so comparing fingerprints across vaults cannot show that a copy matches or that a rotation propagated. hosts and fingerprint are null only for legacy rows written before host binding was required; storing the secret again assigns hosts.

Example response

{
  "data": {
    "created_at": "2026-09-15T17:44:00.000Z",
    "fingerprint": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
    "hosts": [
      "api.github.com"
    ],
    "name": "github_token"
  }
}

Changes