You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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]>
Copy file name to clipboardExpand all lines: openai/README.md
+35-13Lines changed: 35 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,9 @@ Get cost estimation, prompt and completion sampling, error tracking, performance
13
13
<!-- xxx tabs xxx -->
14
14
<!-- xxx tab "API Key" xxx -->
15
15
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.
17
19
18
20
### Installation
19
21
@@ -25,34 +27,43 @@ Datadog's OpenAI integration allows you to collect usage metrics, cost data, and
25
27
26
28
## Prerequisites
27
29
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.
31
34
32
35
## Setup
33
36
34
37
### 1. Generate an OpenAI API key
35
38
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].
37
49
2. Navigate to **API keys** under **Organization settings**.
38
50
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.
40
52
4. Copy the created API Key to your clipboard.
41
53
42
54
### 2. Configure Datadog's OpenAI integration
43
55
44
56
1. Navigate Datadog's [OpenAI integration tile][11] and open the **Configuration** tab.
45
57
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.
47
59
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]).
49
61
-**Use this API key to evaluate your LLM applications**: If enabled, evaluations are run through this API key in LLM Observability.
50
62
51
63
### Additional Notes
52
64
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.
56
67
57
68
## Additional Resources
58
69
@@ -470,9 +481,19 @@ To validate that the APM PHP library can communicate with your Agent, examine th
470
481
471
482
### Metrics
472
483
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.
474
495
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.
476
497
477
498
All remaining metrics below are collected with the APM setup methods.
478
499
@@ -515,3 +536,4 @@ Additional helpful documentation, links, and articles:
0 commit comments