Just like with previous entries, you need to deploy a model capable of the image processing like gpt-5-mini. In the example below, we use the deployment name, API key, and the deployment endpoint which are available in the deploymetn page.
To provide the prompt to the model to help recognize the joystick.png image, we provide input_text with the prompt and input_image with the URL.
from openai import OpenAI
endpoint = "https://redactedsource.services.ai.azure.com/openai/v1"
deployment_name = "gpt-5-mini"
api_key = "redacted_apikey"
client = OpenAI(
base_url=endpoint,
api_key=api_key
)
response = client.responses.create(
model=deployment_name,
input=[{
"role": "user",
"content": [
{"type": "input_text", "text": "what's in this image?"},
{"type": "input_image", "image_url": "https://microsoftlearning.github.io/mslearn-ai-fundamentals/data/joystick.png"},
],
}],
)
print(f"answer: {response.output_text}")
Below is the output of running the Python client that calls the deployment model with prompt and an image URL analyze the image.
azvision.py
answer: A vintage-style video game joystick/controller: a cream/beige rectangular plastic base with scuffs and yellowing, a black vertical shaft with a shiny red ball handle, a black rubber gaiter around the shaft, a single red push button on the top-right, and a coiled black cable trailing off to the side. It's sitting on a dark surface.