OpenAI Monitoring
LogicMonitor’s monitoring package for OpenAI provides REST API-based visibility into API usage and cost metrics for OpenAI services. The package enables you to track consumption across core OpenAI features—such as text and audio completions, image generation, and daily billing—using an administrative API key.
The monitoring suite collects detailed usage data including input/output tokens, cached token reuse, and model-specific statistics. It also tracks cost metrics associated with daily OpenAI API consumption, helping you stay within project budgets and enabling the configuration of alerts.
This package supports scalable, structured monitoring and is ideal for teams looking to optimize their OpenAI API usage within the LogicMonitor platform.
Requirements for OpenAI Monitoring
- AnOpenAI admin-level API key with access to organization-wide usage and billing endpoints.
Note: Personal or project-level API keys are not sufficient. The key must have organization-level visibility.
Adding Resources into Monitoring
- In LogicMonitor, navigate to Resource Tree and selectthe Add button. Select AI and LLMs, then select Add for OpenAI.
- In the Name field, enter a name for the OpenAI resource.
- (Optional) In the Description, enter a short description of the resource.
- In the Parent Group, find and select a parent group for OpenAI resource. For more information, see Resource Group Overview.
- Select Add Properties to configure properties for the resource.
- Select a property name from the Add Properties dropdown list. For more information, see Resource and Instance Properties.
- In the Value field, enter a value related to the property name.
- In the Permissions section, enter an OpenAI authentication API key in the Admin Key field. For more information, see Admin API Keysfrom OpenAI.
- Select Save.
To configure additional settings after creating the OpenAI resource, locate the resource in the Resource tree and select Manage to open the Manage Resource dialog.
Import LogicModules
From the LogicMonitor Exchange, import all OpenAI LogicModules included in the package. For more information, see LogicModules in Package.
If you have previously imported these modules, ensure they are updated to the latest version to benefit from latest improvements or fixes.
Troubleshooting
- Admin Key Requirements—This package requires an OpenAI admin-level API key with access to usage and billing data. Personal or project-scoped keys are not supported.
- Key Management—Admin keys grant broad access. Store them securely, rotate them periodically, and monitor usage through OpenAI’s audit features.
- No Support for Proxies or Limited Scope Tokens—The package is designed for direct access to OpenAI’s API endpoints. It does not support API proxies or restricted-scope keys.
- Authentication Errors (401/403)—These indicate that the API key is invalid or expired. Verify the value and key scope in OpenAI’s dashboard.
- Rate Limiting (HTTP 429)—OpenAI may limit request volume. If this occurs, reduce polling frequency or stagger requests across collectors.
LogicModules in Package
LogicMonitor’s package for OpenAI consists of the following LogicModules. For full coverage, import the following LogicModules into your platform:
Display Name | Type | Description |
SaaS OpenAI Images By Model | DataSource | Collects image generation activity grouped by model. |
SaaS OpenAI Cost By Organization | DataSource | Captures and reports daily cost metrics by OpenAI organization. |
SaaS OpenAI Completion By Model | DataSource | Tracks text and audio completion usage, including token input/output stats. |
When setting static datapoint thresholds on the various metrics tracked by this package’s DataSources, LogicMonitor follows the technology owner’s best practice KPI recommendations.
Recommendation: If necessary, adjust these predefined thresholds to meet the unique needs of your environment. For more information on tuning datapoint thresholds, see Alert Threshold Overview.