Skip to main content
Choose the project’s Dev or Prod environment before setting a value. In a connected chat, read project_status and use the secret link described below. With the local CLI, read the environment IDs first:
ENVIRONMENT_ID is the actual environment ULID, not the word dev or prod. Choose it by name from project.environments in project status. Every CLI secret command requires —environment; there is no default.

Set a secret from a connected chat

Ask your agent to call secret_input_request once with the project, the environment (dev or prod) and up to ten distinct secret names. You get one URL. Open it or send it to the person who will enter the values. The form needs no sign-in. Each named field accepts a pasted value. Use the dice to generate a random value in your browser and the Copy icon next to the dice to copy that field’s current value. The eye shows or hides the value. Select Save secrets once to submit all fields. For a link requested with a single name, Generate token fills the field with a random value and copies it in your browser. If clipboard access is denied, you can still save the generated value or copy it manually. For pasted values, use the Copy icon in the field. Each value must be 1 to 5,120 bytes. If a field fails validation, correct the form and use the same link. The link expires after one hour and is used up by the first valid Save. Anyone holding an unused URL can submit its named fields. Share the URL only with the person entering the values. The URL token can appear in request logs and stops working once it is used or expires. Use local stdin for values with line breaks, such as PEM keys. The page and the agent’s connection_status result show each name as saved, failed or unconfirmed. After a partial save, ask for a fresh link for the failed names and check the configuration before retrying an unconfirmed value. Existing requests made with the single name argument keep their previous status behavior. Secret values stay in the form and out of chat and tool arguments. delivery_state: ready confirms that a stored value reached the deployed environment. not_deployed means it will arrive with the first deployment. Follow a pending or failed delivery without submitting the value again. Dev and Prod receive their own inputs. Promoting a deployment does not copy Dev secrets into Prod; enter the values intended for the target environment separately.

Local CLI and MCP input

The MCP secret_set_command tool returns the supported stdin command. For the CLI, keep the value in a private file:
Use the application’s real name: uppercase letters, digits and underscore, starting with a letter, at most 128 characters. The non-empty UTF-8 value is at most 5,120 bytes. Preserve the exact intended file contents; do not add an accidental newline. The private value must not appear in an MCP argument or shell command argument. The command from secret_set_command names the account it writes as: a saved login with --profile-name, --profile-user and --profile-organization, or, from an MCP server that uses OHMYHOST_TOKEN, that key’s user and organization with --token-user and --token-organization. Run it with those flags unchanged. A login of that name that belongs to another user or organization, for example on another computer, stops with profile_context_mismatch. The key form runs only where OHMYHOST_TOKEN holds a key of that user and organization, never with a saved login: without such a key it stops with environment_token_required, with another account’s key with environment_token_context_mismatch. Every refusal comes before the value is read or anything is written. secret set refuses every OHMYHOST_* name and BETTER_AUTH_SECRET, BETTER_AUTH_URL, DATABASE_URL, HYPERDRIVE, ASSETS, FILES, IMAGES, STORAGE because the platform sets/binds them. For application-owned Better Auth, use APP_AUTH_SECRET mapped to secret and APP_URL mapped to baseURL. secret delete can remove previously stored forbidden names except installed OHMYHOST_STORAGE_KEY, OHMYHOST_MAIL_KEY, OHMYHOST_AI_KEY and BETTER_AUTH_SECRET. A reserved-name rejection does not require disabling the guard or replacing the application’s auth provider. Read secret list and the returned operation to confirm delivery. Listing returns metadata and delivery state, not the original value. delivery_state is ready while the applied generation equals the desired one, pending or failed while a newer generation is still undelivered, and not_deployed before the first deployment; last_error names the most recent delivery failure and does not by itself mean the running application lost its secrets. Repeat an interrupted request with the same key/contents. secret set —wait may return status:stored with secret.delivery_state:not_deployed: saved for the next deployment, not delivered to a running app. Remove an authorized value with ohmyhost secret delete NAME --project "$PROJECT_ID" --environment "$ENVIRONMENT_ID" --idempotency-key "$SECRET_DELETE_KEY" --wait --json (MCP secret_delete).

AI gateway credentials

Enabling the AI gateway injects OHMYHOST_AI_KEY and OHMYHOST_AI_BASE_URL automatically into the deployed server runtime. Do not set either value yourself or expose the key to browsers, builds, prompts or logs.

Public and private configuration

Browser-facing identifiers may be public according to the auth provider’s contract. Server keys belong in the private runtime. The runtime injects no general public URL or environment-name variable; supply an application APP_URL separately for Dev/Prod. Runtime secrets never reach builds; framework-inlined NEXTPUBLIC_ or VITE__ values are public and belong in the committed source. Never copy the hosting token env file into application secrets, and never assume Dev credentials should become Prod credentials during promotion. Application auth · Environments.