﻿---
title: openai module
description: This is the openai module. The openai module supports the standard configuration options that are described in Modules. Here is an example configuration:...
url: https://www.elastic.co/elastic/docs-builder/docs/2452/reference/beats/metricbeat/metricbeat-module-openai
applies_to:
  - Elastic Stack: Beta in 9.0+
---

# openai module
<warning>
  This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
</warning>

This is the openai module.

## Example configuration

The openai module supports the standard configuration options that are described in [Modules](https://www.elastic.co/elastic/docs-builder/docs/2452/reference/beats/metricbeat/configuration-metricbeat). Here is an example configuration:
```yaml
metricbeat.modules:
- module: openai
  metricsets: ["usage"]
  enabled: false
  period: 1h

  #
  # api_keys:
  # - key: "api_key1"
  # - key: "api_key2"

  #
  # ## Base URL for the OpenAI usage API endpoint
  # api_url: "https://api.openai.com/v1/usage"
  # ## Custom headers to be included in API requests
  # headers:
  # - "k1: v1"
  # - "k2: v2"
  ## Rate Limiting Configuration
  # rate_limit:
  #   limit: 12
  #   burst: 1 
  # ## Request Timeout Duration
  # timeout: 30s

  #
  # collection:
  #   ## Number of days to look back when collecting usage data
  #   lookback_days: 30
  #   ## Whether to collect usage data in realtime. Defaults to false as how
  #  
  #  
  #  
  #  
  #   realtime: false
```


## Metricsets

The following metricsets are available:
- [usage](https://www.elastic.co/elastic/docs-builder/docs/2452/reference/beats/metricbeat/metricbeat-metricset-openai-usage)  <applies-to>Elastic Stack: Beta in 9.0+</applies-to>