File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed
articles/ai-foundry/openai/includes/language-overview Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -32,22 +32,6 @@ pip install openai --upgrade
32
32
33
33
## Authentication
34
34
35
- # [ API Key] ( #tab/python-key )
36
-
37
- [ !INCLUDE [ Azure key vault] ( ~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md )]
38
-
39
- ``` python
40
- import os
41
- from openai import OpenAI
42
-
43
- client = OpenAI(
44
- api_key = os.getenv(" AZURE_OPENAI_API_KEY" ),
45
- base_url = " https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
46
- )
47
-
48
- ```
49
-
50
-
51
35
# [ Microsoft Entra ID] ( #tab/python-secure )
52
36
53
37
``` python
@@ -71,6 +55,21 @@ response = client.responses.create(
71
55
print (response.model_dump_json(indent = 2 ))
72
56
```
73
57
58
+ # [ API Key] ( #tab/python-key )
59
+
60
+ [ !INCLUDE [ Azure key vault] ( ~/reusable-content/ce-skilling/azure/includes/ai-services/security/azure-key-vault.md )]
61
+
62
+ ``` python
63
+ import os
64
+ from openai import OpenAI
65
+
66
+ client = OpenAI(
67
+ api_key = os.getenv(" AZURE_OPENAI_API_KEY" ),
68
+ base_url = " https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
69
+ )
70
+
71
+ ```
72
+
74
73
75
74
---
76
75
You can’t perform that action at this time.
0 commit comments