Skip to main content
POST
Get Secret(s)

SDK usage

url and api_key (or apiKey) default to the OPENLIT_URL and OPENLIT_API_KEY environment variables if you don’t pass them explicitly.
Output
should_set_env is client-side only: it doesn’t change what’s sent to OpenLIT, or what comes back in the response. It only controls whether the SDK, after receiving the secrets, also sets them directly as environment variables in your running process.
This endpoint always responds successfully (HTTP 200), even for an invalid API key. Check the err field in the response body rather than relying on the HTTP status code alone to know whether the request actually succeeded.

Cross-origin browser requests

POST /api/vault/get-secrets is an API-key authenticated endpoint for retrieving Vault secrets. Browser requests from a different origin are blocked unless the calling origin is explicitly allowed. To allow a browser application hosted on another domain, configure the OpenLIT deployment with a comma-separated origin allowlist:
OPENLIT_ALLOWED_ORIGINS is also supported as a backward-compatible alias. NEXTAUTH_URL is automatically treated as an allowed same-site origin. Use complete origins such as https://app.example.com. Do not configure wildcard origins for this endpoint.
Server-to-server SDK or REST requests usually do not need CORS configuration because CORS is enforced by browsers.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

text/plain
key
string
Example:

"OPENAI_API_KEY"

tags
string[]
Example:

Response

200 - application/json

Successfully retrieved secret(s).

err
object | null
res
object
Example: