OpenAI just released a very powerful and cost-effective model called GPT-4o mini and it's now available in Relay.app.
While many people have used OpenAI models to extract information from text, they're also remarkably good at extracting data from images. In this short tutorial, I'll show you how to use an AI Extract step in Relay.app, with GPT-4o mini, to automatically identify the key information in a driver's license and write it to a Google Sheet.
1. Get Your Image File
First, you need to get the image file that you'd like GPT-4o mini to process. This could be from an email attachment, file storage app, or somewhere else. In this case, I'll trigger my Relay.app workflow when a file is added to a specific folder in Google Drive.
![](https://cdn.sanity.io/images/1h9u8aig/production/4cc07cfdcdc314d9d994211bb944da4ac8a2f02e-2148x1402.png?w=3840&q=75&fit=max&auto=format&dpr=2)
2. Set up your AI Extract Step
Next, select "AI Extract" from the AI submenu under the plus button to create a new step. To configure your AI Extract step, input the file, select the model, and specify what data you want to extract.
![](https://cdn.sanity.io/images/1h9u8aig/production/fe3f24d82916f46d67d8e5320aa544656d95d685-2036x1400.png?w=3840&q=75&fit=max&auto=format&dpr=2)
3. Use the Extracted Data
Finally, you can use the extracted data in a subsequent automation step. In this case, I'll write the driver's license information into a Google Sheet. You can access the data by selecting Data and navigating to the Model Response.
![](https://cdn.sanity.io/images/1h9u8aig/production/fadb54d21ec4646fadcb30fd7d9a856838731c4c-2064x1378.png?w=3840&q=75&fit=max&auto=format&dpr=2)
That's it! Now you can use an AI Extract step to get any date you need out of an image automatically.