OpenAI
openai
is the OpenAI chat model provider.
It uses the OPENAI_API_...
environment variables.
Upgrade your account to get access to the models. You will get 404s if you do not have a paying account.
Create a new secret key from the OpenAI API Keys portal.
Update the
.env
file with the secret key..env OPENAI_API_KEY=sk_...Find the model you want to use from the OpenAI API Reference or the OpenAI Chat Playground.
Set the
model
field inscript
to the model you want to use.script({model: "openai:gpt-4o",...})
Logging
Section titled “Logging”You can enable the genaiscript:openai
and genaiscript:openai:msg
logging namespaces for more information about the requests and responses:
Aliases
The following model aliases are attempted by default in GenAIScript.
Alias | Model identifier |
---|---|
large | gpt-4.1 |
small | gpt-4.1-mini |
tiny | gpt-4.1-nano |
vision | gpt-4.1 |
vision_small | gpt-4.1-mini |
embeddings | text-embedding-3-small |
reasoning | o1 |
reasoning_small | o3-mini |
transcription | whisper-1 |
speech | tts-1 |
image | dall-e-3 |
intent | gpt-4.1-mini |