Skip to main content
Before building an agent that uses an OpenAI model, you’ll need to create an OpenAI developer account and get an API key.

Configuration

OpenAiModel
The name of the OpenAI model you want your agent to use. By default, your agent will use gpt-4o-mini.
string
The name of the secret which contains your OpenAI API key. NOTE: This is the name of the secret, not your actual secret key!

Creating the Model

Calling openai() with no arguments will use all default values:
Passing a single string argument will set the model name:
Or, you can set every parameter by passing a configuration object: