MCPcopy
hub / github.com/openai/openai-go / WithAPIKey

Function WithAPIKey

option/requestoption.go:272–277  ·  view source on GitHub ↗

WithAPIKey returns a RequestOption that sets the client setting "api_key".

(value string)

Source from the content-addressed store, hash-verified

270
271// WithAPIKey returns a RequestOption that sets the client setting "api_key".
272func WithAPIKey(value string) RequestOption {
273 return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error {
274 r.SetAPIKey(value)
275 return nil
276 })
277}
278
279// WithAdminAPIKey returns a RequestOption that sets the client setting "admin_api_key".
280func WithAdminAPIKey(value string) RequestOption {

Calls 2

RequestOptionFuncFuncType · 0.92
SetAPIKeyMethod · 0.80

Used in the wild real call sites across dependent graphs

searching dependent graphs…