﻿---
title: openai usage metricset
description: This is the usage metricset of the module openai. For a description of each field in the metricset, see the exported fields section. Here is an example...
url: https://docs-v3-preview.elastic.dev/elastic/beats/pull/47883/reference/metricbeat/metricbeat-metricset-openai-usage
---

# openai usage metricset
<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 usage metricset of the module openai.

## Fields

For a description of each field in the metricset, see the [exported fields](https://docs-v3-preview.elastic.dev/elastic/beats/pull/47883/reference/metricbeat/exported-fields-openai) section.
Here is an example document generated by this metricset:
```json
{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "event": {
        "dataset": "openai.usage",
        "duration": 115000,
        "module": "openai"
    },
    "metricset": {
        "name": "usage",
        "period": 10000
    },
    "openai": {
        "usage": {
            "api_key_id": null,
            "api_key_name": null,
            "api_key_redacted": null,
            "api_key_type": null,
            "data": {
                "cached_context_tokens_total": 0,
                "context_tokens_total": 118,
                "email": null,
                "generated_tokens_total": 35,
                "operation": "completion-realtime",
                "request_type": "",
                "requests_total": 1,
                "snapshot_id": "gpt-4o-realtime-preview-2024-10-01"
            },
            "organization_id": "org-dummy",
            "organization_name": "Personal",
            "project_id": null,
            "project_name": null
        }
    },
    "service": {
        "type": "openai"
    }
}
```