> For the complete documentation index, see [llms.txt](https://docs.spice.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.spice.ai/docs/portal/apps/secrets.md).

# Secrets

Project Secrets are key-value pairs that are passed to the Spice Runtime instance as environment secrets. Secrets are securely encrypted and accessible only through the project in which they were created. To share one secret across several projects, use an [organization secret](/docs/portal/organizations/organization-secrets.md) instead.

Once a secret is saved, its value cannot be retrieved through Spice Cloud. Editing a secret replaces its value; the name cannot be changed.

The **Secrets** section is available to organization owners, admins, and members. Viewers cannot view or manage secrets.

### Create a new secret

1. Select your project.
2. Navigate to **Settings** tab and select **Secrets** section.
3. Fill **Secret Name** and **Secret Value** fields and click **Add**.
4. Saved secrets can be referenced in the Spicepod configuration as\
   `${secrets:<SECRET_NAME>}`, for example:

```yaml
models:   
  - from: openai:gpt-4o
    name: gpt-4o
    params:
      openai_api_key: ${secrets:OPENAI_API_KEY}
```

5. To apply secrets, you must initiate a new spicepod deployment. [Learn more about deployments.](/docs/portal/app-spicepod/deployments.md)

Secret names must start with a letter or an underscore and may contain only letters, numbers, and underscores.

### Linked Organization Secrets

Secrets defined for the organization are listed under **Linked Organization Secrets**. Only the secrets selected and saved here are available to the project at runtime and in secret pickers. When a project secret and a linked organization secret have the same name, the project secret takes precedence.

[Learn more about organization secrets.](/docs/portal/organizations/organization-secrets.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.spice.ai/docs/portal/apps/secrets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
