OpenAI

Overview
To facilitate a secure data analysis for the OpenAI, your organization must provide a Restricted API Key along with the associated Project and Organization IDs. This configuration ensures that access is limited strictly to "Read-Only" permissions, preventing any modification, deletion, or creation of resources within your OpenAI environment.
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 |
|---|---|---|
| Assistants | Custom AI assistant configurations | Read |
| 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: 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.
Step 5: 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 6: Authenticate and Finalize
- Input Credentials: Enter the Restricted API Key, Organization ID, and Project ID captured in the previous steps.
- Verify Connection: Click Authenticate to establish the connection.
- Completion: Once the authentication is successful, the integration will begin its initial metadata scan.

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 } }
}