> For the complete documentation index, see [llms.txt](https://docs.ox.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ox.security/admin-settings/creating-api-keys.md).

# Creating API keys

You can create security keys to authenticate requests to the OX API and connect external tools and integrations to OX.

Each API key has a [role ](https://docs.ox.security/admin-settings/roles.md)that determines which actions it can perform, and a [scope ](https://docs.ox.security/admin-settings/scopes.md)that determines which applications it can access. For example, an API key can have a Viewer role with access to the entire organization, or an Admin role restricted to applications matching specific App Owners or Tags.

This lets you grant integrations only the permissions and application access they require.

API keys can be personal or organization-owned. Personal API keys inherit the permissions of the user who creates them. Organization-owned API keys have their own assigned permissions, which remain unchanged when the creator's role or scope changes.

Treat API keys like passwords. Store them securely, and do not commit them to source control or include them in application code.

**To create an API key:**

1. In OX, go to **Settings > API Keys**.
2. Select **Create API Key**.

<figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-76a465ec28a4579291403019f4c2feeaf52f199b%2Fapi_key%20(3).png?alt=media" alt="" width="511"><figcaption></figcaption></figure>

<figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-7345eeaad94c711326742a3989b9cfcdae5dcc41%2Fapi_key_org.png?alt=media" alt="" width="509"><figcaption></figcaption></figure>

3. Configure the following settings:

| Setting         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API Key Name    | Enter a descriptive name for the API key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Key Ownership   | <p>Select the ownership type:<br><br>Personal (User-Bound): The API key inherits the role and scope of its creator. Changes to the user's role or scope also change the API key's permissions.<br><br>Organization (Static Role): The API key has its own assigned role and scope. Changes to the creator's role or scope do not affect its permissions. Only administrators can create organization-owned API keys.</p>                                                                                                                                                                                                                                                                                              |
| API Key Type    | <p>Select the integration type:<br><br>CI/CD Integration: Authenticate CI/CD pipeline integrations.<br><br>API Integration: Authenticate applications that access the OX API.<br><br>IDE/CLI Integration: Authenticate IDE extensions or CLI tools.<br><br>K8s Inspector/Runtime Sensor Integration: Authenticate Kubernetes Inspector and Runtime Sensor integrations. This option is available when Organization (Static Role) ownership is selected.<br><br>MCP Integration: Authenticate MCP integrations.<br><br>VibeSec Agent: Authenticate VibeSec agents.</p><p>LLM Gateway: <a href="https://docs.ox.security/ox-integrations/3rd-party-integrations/ai-security-litellm.md">Authenticate Light LLM</a>.</p> |
| Assign role     | <p>For organization-owned API keys, select the role that determines which actions the key can perform in OX. The assigned role remains unchanged when the creator's role changes.<br><br>Personal API keys inherit the creator's role.<br><br>For information about available roles and their permissions, see the Roles documentation.</p>                                                                                                                                                                                                                                                                                                                                                                           |
| Assign scope    | <p>For organization-owned API keys, select which applications the API key can access:<br><br>Entire organization: Grants access to all applications in the organization.<br><br>Custom: Limits access to applications that match the selected App Owners and Tags.<br><br>Personal API keys inherit the creator's scope.</p>                                                                                                                                                                                                                                                                                                                                                                                          |
| Expiration Date | Select when the API key expires. After this date, the key can no longer be used to authenticate API requests.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

4. Select **Create**.
5. **Copy the generated API key and store it securely.** You cannot view it again after closing the dialog.
6. Select **CLOSE**. The new key appears on the **API Key Settings** page.

   <figure><img src="https://884876233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdK3XMLdV8zRg847RmGmZ%2Fuploads%2Fgit-blob-c9069799d044e63cca21e890f8fc21d15ebfc672%2FIDE_integration_key2.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ox.security/admin-settings/creating-api-keys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
