Call a real API: token in, JSON out.
In this interactive Infrastructure lesson from Stencel Academy you don't just read — you type real commands like curl -s https://api.stencel.ai/v1/messages -H "Authorization: Bearer sk-demo-123" -d '{"prompt":"hi"}', curl -s https://api.stencel.ai/v1/messages -d '{"prompt":"hi"}', curl -s https://api.stencel.ai/v1/messages -H "Authorization: Bearer sk-demo-123" -d '{"prompt":"hi"}' | jq .usage and watch the machine respond on a live, animated map. It is part of the free How Infrastructure Works course.
Builds on: Anatomy of HTTP.
curl -s https://api.stencel.ai/v1/messages -H "Authorization: Bearer sk-oops" -d '{"prompt":"hi"}' — A wrong key is still a 401 — the gate checks, it doesn't just look.curl -s https://api.stencel.ai/v1/messages -H "Authorization: Bearer sk-demo-123" -d '{}' — 400 = your JSON was wrong; the error body says exactly what.echo '{"prompt":"hi"}' | jq . — jq pretty-prints any JSON — your everyday API magnifier.curl -s https://api.stencel.ai/v1/messages -H "Authorization: Bearer sk-demo-123" -d '{"prompt":"hi"}' | jq -r '.content[0].text' — -r gives raw text — pull the model's reply out of the envelope.