Skip to content

Commit e62d6ef

Browse files
authored
Merge pull request alexrudall#398 from alexrudall/add-add-headers-docs
Add docs for extra extra headers
2 parents 26672af + 7aa01e4 commit e62d6ef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ OpenAI.configure do |config|
108108
end
109109
```
110110

111+
#### Extra Headers per Client
112+
113+
You can dynamically pass headers per client object, which will be merged with any headers set globally with OpenAI.configure:
114+
115+
```ruby
116+
client = OpenAI::Client.new(access_token: "access_token_goes_here")
117+
client.add_headers("X-Proxy-TTL" => "43200")
118+
```
119+
111120
#### Verbose Logging
112121

113122
You can pass [Faraday middleware](https://lostisland.github.io/faraday/#/middleware/index) to the client in a block, eg. to enable verbose logging with Ruby's [Logger](https://ruby-doc.org/3.2.2/stdlibs/logger/Logger.html):

0 commit comments

Comments
 (0)