OpenAI

Overview
Relyance AI connects to the OpenAI API platform (platform.openai.com). The connection uses these keys:
- Project API key (required). A restricted project key with Read access. Relyance uses this key to find your models, files, fine-tuning jobs, and vector stores.
- Admin key (optional). An organization Admin key with Read only access. Relyance uses this key to read model usage. Models that are in use then show in AI Models.
If you do not add the Admin key, Relyance finds your models but does not show them as in use.
You also give your Project ID and Organization ID. The keys give read access only. Relyance cannot create, change, or delete resources in your OpenAI organization.
Step 1: Locate Organization and Project IDs
Before creating the key, please retrieve the following identifiers required for API authentication:
- Organization ID: Navigate to Settings > Organization > General. Copy the string labeled "Organization ID" (starts with org- ).
- Project ID: Navigate to Settings > Project > General. Copy the string labeled "Project ID" (starts with proj- ).
Step 2: Initialize API Key Creation
- Log in to the OpenAI Developer Dashboard.
- Select Project: Confirm you are in the correct Project context via the dashboard selector in the top-left navigation.
- Navigate to API Keys: Select the "API Keys" section from the primary navigation menu.
- Create Key: Click "Create new secret key."
- Labeling: Assign a descriptive name to the key for auditing purposes (e.g., Relyance_Key).
- Set Scope: Change the permission setting from "All" to "Restricted."
Step 3: Define Restricted Permissions
In the permissions grid, locate the following endpoints and adjust the access levels to Read only. Ensure that no "Write," "Modify," or "Delete" permissions are enabled.
| Resource Endpoint | Description | Required Permission |
|---|---|---|
| Files | Metadata for uploaded datasets | Read |
| Fine-tuning | Fine-tuning job history and status | Read |
| Models | List of available base and custom models | Read |
| Vector Stores | Metadata for embedding stores | Read |
Note: For endpoints that provide a binary choice between "None" and "Read," ensure "Read" is selected to allow the application to view the necessary metadata.
Step 4: Create an Admin key (optional, for model usage)
Do this step if you want Relyance to show which models are in use. Only an organization Owner can create an Admin key.
- Log in to the OpenAI platform at https://platform.openai.com.
- Go to Settings > Organization > Admin keys.
- Select Create new admin key.
- Enter a name for the key (for example, Relyance_Usage).
- Set Expiration as your security policy requires.
- Select Read only.
- Create the key, then copy it.
OpenAI shows the key one time only. The key starts with sk-admin-. Keep it in a safe location until you enter it in Relyance AI.
Note. The Admin key cannot read models. You must also give the project API key from Steps 2 and 3.
Step 5: Initialize Integration in Relyance AI

Navigate to the Integrations page within the Relyance application.
Select the OpenAI integration card.
Review the integration overview and click Next.
The Authentication step asks for:
- API Key: Your OpenAI API key from https://platform.openai.com/api-keys; required; held as a secret.
- Project ID: OpenAI project ID (required for organization accounts); required; held as a secret.
- Organization ID: OpenAI organization ID (optional, for organization accounts); optional; held as a secret.
- Admin API Key (for model usage): The OpenAI Admin key from Step 4. Relyance uses it to read model usage; optional; held as a secret.
Step 6: Configure Scan Parameters

- Define the desired Scan Interval (the frequency at which the application will check for data updates).
- Recommendation: Utilize the default settings provided to ensure optimal performance and data currency.
- Click Next to proceed to authentication.
Step 7: Authenticate and Finalize
- Input Credentials: Enter the Restricted API Key, Organization ID, and Project ID from the previous steps. If you created an Admin key in Step 4, enter it in Admin API Key (for model usage).
- Verify Connection: Click Authenticate to establish the connection.
- Completion: Once the authentication is successful, the integration will begin its initial metadata scan.

Troubleshooting: models do not show as in use
If your models do not show as in use in AI Models, do these steps:
- Make sure that the connection has an Admin key in Admin API Key (for model usage).
- Make sure that the Admin key has Read only access and is not expired.
- Run a new scan.
Relyance shows model usage for the last 7 days of activity.
Manage this integration with Terraform
Connections for this integration can be managed as code with the Relyance Terraform provider. Non-secret fields go in auth.params; secret fields go in auth.secrets_wo, which is write-only — never stored in Terraform state. Rotate secrets by bumping auth.secrets_wo_version.
resource "relyance_integration_connection" "openai" {
vendor = "openai"
name = "<your connection name>"
auth = {
method = "api-key"
params = {
data_storage_location = "us"
}
# Secret fields are write-only: sent to Relyance, never stored in state.
secrets_wo = {
api_key = var.openai_api_key
project_id = var.openai_project_id
organization_id = var.openai_organization_id
}
secrets_wo_version = 1
}
scans = { "data-inspection" = { enabled = true } }
}