Using AI
AI-15L3
IUsing AIchecked 91 days ago16 min read
Calling AI From Your Own Code: The API, Explained Properly
You'll walk away with
A working script that sends a prompt to a model's API and uses the response
If it looks different⚠️ Version note. API endpoints, SDK names and field names change. The shape — authenticate, send messages, read the reply — is stable across providers. Code below is illustrative; check your provider's current docs for exact names. Last checked: 25 July 2026.
Members only
Finish the lesson. Make the thing.
Become a member to keep going. Every lesson and game, cancel any time in two clicks.
- 01Why call the API instead of using the chat app
- 02Get a key and store it safely
- 03Install the SDK
- 04Send your first request
- 05Understand the parameters you'll actually use
- 06Make it a real tiny program
- 07Common mistakes
- 40′Exercise, with a verifiable output
- 09Cheatsheet
- ▶The video and audio versions
Yearly$89/yrMonthly$9.99/moWeekly$4.99/wk
Got the output?
A working script that sends a prompt to a model's API and uses the response
Mark it when you've got the output in hand.