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
Copy file name to clipboardExpand all lines: README.md
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,19 @@ To import the package, follow these steps:
13
13
### Setting Up Your OpenAI Account
14
14
To use the OpenAI API, you need to have an OpenAI account. Follow these steps to create an account and generate an API key:
15
15
16
-
Go to https://openai.com/api and sign up for an account
17
-
Once you have created an account, go to https://beta.openai.com/account/api-keys
18
-
Create a new secret key and save it
16
+
-Go to https://openai.com/api and sign up for an account
17
+
-Once you have created an account, go to https://beta.openai.com/account/api-keys
18
+
-Create a new secret key and save it
19
19
20
20
### Saving Your Credentials
21
21
To make requests to the OpenAI API, you need to use your API key and organization name (if applicable). To avoid exposing your API key in your Unity project, you can save it in your device's local storage.
22
22
23
23
To do this, follow these steps:
24
24
25
-
Create a folder called .openai in your home directory (e.g. C:User\UserName\ for Windows or ~\ for Linux or Mac)
26
-
Create a file called auth.json in the .openai folder
27
-
Add an api_key field and a organization field (if applicable) to the auth.json file and save it
28
-
Here is an example of what your auth.json file should look like:
25
+
-Create a folder called .openai in your home directory (e.g. `C:User\UserName\` for Windows or `~\` for Linux or Mac)
26
+
-Create a file called `auth.json` in the `.openai` folder
27
+
-Add an api_key field and a organization field (if applicable) to the auth.json file and save it
28
+
-Here is an example of what your auth.json file should look like:
29
29
30
30
```json
31
31
{
@@ -38,7 +38,8 @@ Do not share it with others or expose it in any client-side code (e.g. browsers,
38
38
If you are using OpenAI for production, make sure to run it on the server side, where your API key can be securely loaded from an environment variable or key management service.
39
39
40
40
### Making Requests to OpenAPI
41
-
You can use the `OpenAIApi` class to make async requests to the OpenAI API.
41
+
You can use the `OpenAIApi` class to make async requests to the OpenAI API.
42
+
42
43
All methods are asynchronous and can be accessed directly from an instance of the `OpenAIApi` class.
0 commit comments