1. Learn
  2. /
  3. Courses
  4. /
  5. Working with the OpenAI Responses API

Connected

Exercise

Prompting with Images from URLs

You're building an automated product cataloging system for an online marketplace. The system needs to analyze product images and generate accurate descriptions for the catalog. You'll use role-based messages to send an image URL to the model and request both a classification and a description.

A URL string to a photo of a winter jacket has been stored as image_url, and the visualize_image() function has been defined for you to compare the image with the generated description.

Instructions

100 XP
  • Add a user message containing both a text prompt asking to classify and describe the product, and the image URL (image_url) using the appropriate content types.
  • Create the request to the "gpt-5-mini" model using your messages list and extract the output text.