MCPcopy Create free account
hub / github.com/dariubs/goAI / WithAPIKey

Function WithAPIKey

options.go:34–38  ·  view source on GitHub ↗

WithAPIKey sets the API key for the provider Example: client := goai.New("openai", "gpt-4o", goai.WithAPIKey(os.Getenv("OPENAI_API_KEY")), )

(key string)

Source from the content-addressed store, hash-verified

32// goai.WithAPIKey(os.Getenv("OPENAI_API_KEY")),
33// )
34func WithAPIKey(key string) Option {
35 return func(o *Options) {
36 o.APIKey = key
37 }
38}
39
40// WithEndpoint sets a custom API endpoint
41//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected