Skip to main content

🔑 Admin Key Creation & Data Logging Configuration Guide in OpenAI for Authentication

This guide walks OpenAI account administrators through generating a new Admin API key and enabling data logging in the Data Controls section for audit, compliance, and operational purposes.

Prerequisites

Ensure you meet these prerequisites before starting:
  • Admin access to AirMDR application
  • You must have access to the OpenAI Developer Platform with Admin privileges in your OpenAI organization
  • Permissions to manage API keys and system-wide data settings

Generate a New Admin API Key

To generate an Admin key in the OpenAI Platform for integrating with AirMDR, follow these steps:
1

Login to the OpenAI Platform

  1. Navigate to Open AI Platform.
  2. Click Login in the top-right corner, and authenticate with your admin credentials.
2

Create a New Admin Key

  1. In the Left Navigation pane, enter the value “Admin API Keys” in the Search bar.
  2. Go to Admin Keys management page.
  3. Click on the “+ Create new Admin key” button. A pop-up modal will show up. Open AI10 Pn
  4. In the Create new admin key pop-up modal
    • Provide a descriptive name for the API key (e.g., AirMDR Integration).
    • In the Permissions, select the Read only option.
    Open AI11 Pn
  5. Click Create admin key to generate the key.
3

Copy and Store the API Key

  1. A modal will display your new secret API key.
  2. Click Copy to save it to your clipboard.
    This is the only time the API Key will be displayed.
    Copy and securely save the secret API key in your preferred password manager or secure storage solution.
  3. Once you successfully copy and securely saved the Key, click Done. Open AI12 Pn
    You can Edit the Name and Permissions or Delete the Secret Key entirely.
    Open AI3 Pn
    Email the Admin API key to AirMDR
    or
    Self configure OpenAI in the AirMDR Integrations Dashboard.

Enable Data Logging in Data Controls

1

Access Data Controls

  1. Go to Organization → Data Controls → Data retention.
  2. Locate the Audit Logging toggle.
  3. Set it to Enabled (ON).
  4. Click Save. Open AI13 Pn
  5. Review the logging policy and retention notice.
  6. Confirm your changes if prompted.
2

Verify Logging Behavior

  1. Perform a test API call using the new Admin key.
  2. Confirm activity is recorded under Usage or via your audit log provider (if integrated).

Post-Setup Security Best Practices (Optional)

  • Rotate keys periodically and delete unused ones.
  • Regularly review your organization’s data control settings for compliance.
  • Monitor usage under: https://platform.openai.com/account/usage
  • Never share your API key publicly.
  • Use environment variables or secret vaults (like AWS Secrets Manager, Azure Key Vault).
  • Rotate keys regularly and revoke unused keys from the API Key page.

Skills Provided by this Integration

Skill IDPurpose
Get OpenAI Audit LogsRetrieve audit logs from the OpenAI platform with filtering capabilities for time ranges, actors, and event types.
To view the details of Input Parameters and Output for the respective skills
  • Go to AirMDR → OpenAI Integration page.
  • Select the Skills tab and click on the required listed skills.

OpenAI API Testing

Open cURL and run the following command to check if your API Key is working: Sample cURLCommand

curl --location 'https://api.openai.com/v1/organization/audit_logs' \
--header 'Authorization: Bearer <ADMIN_API_KEY>' \
--header 'Content-Type: application/json'
Replace ADMIN_API_KEY with your actual secret API key.
Sample JSON Response

{
    "object": "list",
    "data": [
        {
            "object": "organization.audit_log",
            "id": "audit_log-YuMhFDGx9KyuKeCzOlgMUQmK",
            "type": "login.succeeded",
            "effective_at": 1751865809,
            "actor": {
                "type": "session",
                "session": {
                    "user": {
                        "id": "user-mT5AyiS89mUCGccNnsiiFTFg",
                        "email": "user@company.com"
                    },
                    "ip_address": "209.35.227.192",
                    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
                    "ja3": "dc34fcc82fa919512cc12b7def99183c",
                    "ja4": "q13d0313h3_55b375c5d22e_226f3f127bbe",
                    "ip_address_details": {
                        "country": "GB",
                        "city": "Manchester",
                        "region": "England",
                        "region_code": "ENG",
                        "asn": "213176",
                        "latitude": "53.48095",
                        "longitude": "-2.23743"
                    }
                }
            }
        }
    ],
    "first_id": "audit_log-YuMhFDGx9KyuKeCzOlgMUQmK",
    "last_id": "audit_log-YuMhFDGx9KyuKeCzOlgMUQmK",
    "has_more": true
}

Configure OpenAI in the AirMDR Integrations Dashboard

  1. Navigate to AirMDR, provide the credentials, and click Login
  2. Navigate to the AirMDR Integrations Dashboard in the left navigation pane and select Integrations. Slack24 Pn
  3. Use the search option, enter the keyword “OpenAI”, select the Connections tab, and click Create. Open AI6 Pn
  4. Enter an unique name to the Instance (e.g., your org name-OpenAI) to easily identify the user connection by AirMDR.
  5. Enter the generated API Token (Admin API Key) in the Authentication Details field params, and click Create. Open AI4 Pn