Skip to content

Commit 03f329d

Browse files
BoyangHuangmaycmleebrett0000FF
authored
[openai][usage] Really hammer it home that admin key is required for ccm + metrics (#22173)
* [openai][usage] Really hammer it home that admin key is required for ccm + metrics * Apply suggestions from code review Co-authored-by: May Lee <[email protected]> * Update openai/README.md Co-authored-by: Brett Blue <[email protected]> --------- Co-authored-by: May Lee <[email protected]> Co-authored-by: Brett Blue <[email protected]>
1 parent 1b75efd commit 03f329d

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

openai/README.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Get cost estimation, prompt and completion sampling, error tracking, performance
1313
<!-- xxx tabs xxx -->
1414
<!-- xxx tab "API Key" xxx -->
1515

16-
**Note**: Providing an admin key collects `audio_speeches`, `audio_transcriptions`, `code_interpreter_sessions`, `completions`, `embeddings`, `images`, `moderations`, and `vector_stores` metrics. To collect all metrics provided by this integration, also follow the APM setup instructions.
16+
**IMPORTANT**: An **admin-scoped API key** is **required** to collect usage metrics and Cloud Cost Management (CCM) data. Without an admin-scoped API key, this integration cannot ingest `audio_speeches`, `audio_transcriptions`, `code_interpreter_sessions`, `completions`, `embeddings`, `images`, `moderations`, and `vector_stores` metrics, and CCM cost data are not available.
17+
18+
**Note**: To collect all metrics provided by this integration, also follow the APM setup instructions in addition to the API key setup.
1719

1820
### Installation
1921

@@ -25,34 +27,43 @@ Datadog's OpenAI integration allows you to collect usage metrics, cost data, and
2527

2628
## Prerequisites
2729

28-
- An **OpenAI account** with the admin write permissions
29-
- A **valid OpenAI API key** with appropriate access for **usage and cost metrics** or **LLM Observability**.
30-
- An admin-scoped API key is required to ingest usage and cost data.
30+
- An **OpenAI account** with admin write permissions
31+
- A **valid OpenAI API key**:
32+
- **For Cloud Cost Management (CCM) and usage metrics**: An **admin-scoped API key is mandatory**. Project-scoped keys cannot collect this data.
33+
- **For LLM Observability only**: A standard API key with write permissions for model capabilities is sufficient.
3134

3235
## Setup
3336

3437
### 1. Generate an OpenAI API key
3538

36-
1. Login to your [OpenAI Account][10].
39+
**For Cloud Cost Management and usage metrics**, you must create an **admin-scoped API key**:
40+
41+
1. Log in to your [OpenAI Account][10].
42+
2. Navigate to the [Admin Keys page][20] or go to **API keys** under **Organization settings** and select the **Admin keys** tab.
43+
3. Click **Create a new secret key**.
44+
4. Copy the created admin API Key to your clipboard.
45+
46+
**For LLM Observability only** (without CCM and usage metrics), you can use a standard API key:
47+
48+
1. Log in to your [OpenAI Account][10].
3749
2. Navigate to **API keys** under **Organization settings**.
3850
3. Click **Create a new secret key**.
39-
- For LLM Observability, ensure that the API key has **write** permission for **model capabilities** to invoke models in your LLM account.
51+
- Ensure that the API key has **write** permission for **model capabilities** to invoke models in your LLM account.
4052
4. Copy the created API Key to your clipboard.
4153

4254
### 2. Configure Datadog's OpenAI integration
4355

4456
1. Navigate Datadog's [OpenAI integration tile][11] and open the **Configuration** tab.
4557
2. Click **Add Account**.
46-
3. Under **Account Name**, enter a name for your account. Under **API Key**, enter your OpenAI API key. Optionally, add a comma-separated list of tags for metrics associated with this account.
58+
3. Under **Account Name**, enter a name for your account. Under **API Key**, enter your OpenAI API key (**must be admin-scoped for CCM and usage metrics**). Optionally, add a comma-separated list of tags for metrics associated with this account.
4759
3. Under **Resources**, enable toggles depending on your use case:
48-
- **Collect Cost Data**: If enabled, cost data is visible in [Cloud Cost Management][14] within 24 hours. See ([collected data][15]).
60+
- **Collect Cost Data**: If enabled, cost data is visible in [Cloud Cost Management][14] within 24 hours. **Requires an admin-scoped API key.** See ([collected data][15]).
4961
- **Use this API key to evaluate your LLM applications**: If enabled, evaluations are run through this API key in LLM Observability.
5062

5163
### Additional Notes
5264

53-
- This integration only collects `audio_speeches`, `audio_transcriptions`, `code_interpreter_sessions`, `completions`, `embeddings`, `images`, `moderations`, and `vector_stores` metrics.
54-
- If you enable Cloud Cost Management for OpenAI, you have access to cost metrics.
55-
- An admin-scoped API key is required.
65+
- **Admin-scoped API key requirement**: An admin-scoped API key is **mandatory** for collecting usage metrics and Cloud Cost Management data. This integration only collects `audio_speeches`, `audio_transcriptions`, `code_interpreter_sessions`, `completions`, `embeddings`, `images`, `moderations`, and `vector_stores` metrics when an admin-scoped API key is provided.
66+
- If you enable Cloud Cost Management for OpenAI without an admin-scoped API key, cost metrics are not available.
5667

5768
## Additional Resources
5869

@@ -470,9 +481,19 @@ To validate that the APM PHP library can communicate with your Agent, examine th
470481

471482
### Metrics
472483

473-
The `openai.api.usage.*` metrics are collected when a project-scoped API key is provided. Project-scoped API key support will be deprecated in the near future.
484+
**IMPORTANT**: An **admin-scoped API key is required** to collect the following metrics and Cloud Cost Management data:
485+
- `audio_speeches`
486+
- `audio_transcriptions`
487+
- `code_interpreter_sessions`
488+
- `completions`
489+
- `embeddings`
490+
- `images`
491+
- `moderations`
492+
- `vector_stores`
493+
494+
Without an admin-scoped API key, these metrics and CCM cost data are not ingested.
474495

475-
The `audio_speeches`, `audio_transcriptions`, `code_interpreter_sessions`, `completions`, `embeddings`, `images`, `moderations`, and `vector_stores` metrics are collected when an admin-scoped API key is provided.
496+
**Note**: The `openai.api.usage.*` metrics are collected when a project-scoped API key is provided. Project-scoped API key support will be deprecated in the near future and does not support CCM data collection.
476497

477498
All remaining metrics below are collected with the APM setup methods.
478499

@@ -515,3 +536,4 @@ Additional helpful documentation, links, and articles:
515536
[17]: https://platform.openai.com/docs/
516537
[18]: https://platform.openai.com/
517538
[19]: https://www.datadoghq.com/product/llm-observability/
539+
[20]: https://platform.openai.com/settings/organization/admin-keys

0 commit comments

Comments
 (0)