Skip to main content
The source-fidelity code uses gpt-image-1. Replace it with gpt-image-2 before running the example.
openai_tools.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Update the image model

When saving the code, replace gpt-image-1 with gpt-image-2.
5

Run the example

Save the code above as openai_tools.py, then run:
Full source: cookbook/91_tools/models/openai_tools.py