The question to explore

Ask for a dog photo

What happens when a photo request works, or fails?

About 10 minutes / Suggested pace / No account needed

  • Tool
  • API
  • Response
Try the experiment

What this activity helps you do

Switch between a photo address and an error. Decide what the app can honestly show after each reply. Use the same check when an AI assistant says a tool succeeded.

Local teaching illustration / No AI model call

  1. Choose Success: photo address returned.
  2. Read the response, then choose Not found: unknown breed. Notice that no photo address comes back.
  3. Explain why a program should show the error or offer a retry instead of claiming it found a photo.
HTTP 200
{ "status": "success", "message": "https://images.dog.ceo/breeds/beagle/example.jpg" }

Change a control to explore the example when JavaScript is enabled.

The idea

An API is a way for one program to ask another for something. A tool is a function an assistant or program can use. Calling an API is one possible tool action.

These replies are written examples, not live requests. One contains a pretend photo address; the other reports a missing breed. Read the reply before claiming success. The Dog lab makes a real request.

Take this with you

What changed?

A request is an attempt. Read the response to find out what actually happened.

Try explaining it.

Can an AI assistant honestly say it found a photo if its tool returned an error?

Open a possible explanation

No. It should explain the failure and offer a useful next step. A fluent answer cannot substitute for a missing result.

Choose what to try next

Keep exploring, or stay here and try another variation.

By Jonathan Simone, with AI assistance. First edition, October 2026. Activities are fictional teaching examples, not measured AI performance. Help us improve this lesson.

An optional completion mark and your explanation preference can be saved to this browser. Exercise entries stay in this page unless you choose to download a file. View or clear your check-ins.