Skip to content

Commit 70ecab1

Browse files
committed
docs: add configuration documentation
1 parent ad50774 commit 70ecab1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ $result = OpenAI::completions()->create([
5151
echo $result['choices'][0]['text']; // an open-source, widely-used, server-side scripting language.
5252
```
5353

54+
## Configuration
55+
56+
Configuration is done via environment variables or directly in the configuration file (`config/openai.php`).
57+
58+
### OpenAI API Key and Organization
59+
60+
Specify your OpenAI API Key and organization. This will be
61+
used to authenticate with the OpenAI API - you can find your API key
62+
and organization on your OpenAI dashboard, at https://openai.com.
63+
64+
```env
65+
OPENAI_API_KEY=
66+
OPENAI_ORGANIZATION=
67+
```
68+
69+
### Request Timeout
70+
71+
The timeout may be used to specify the maximum number of seconds to wait
72+
for a response. By default, the client will time out after 30 seconds.
73+
74+
```env
75+
OPENAI_REQUEST_TIMEOUT=
76+
```
77+
5478
## Usage
5579

5680
For usage examples, take a look at the [openai-php/client](https://github.com/openai-php/client) repository.

0 commit comments

Comments
 (0)