Vibe Coder · Unit 10: APIs · Lesson 4 of 13
Calling OpenAI
The same feature through OpenAI’s API. Keeping the model call in one place makes switching providers a small change.
Read the short notes and pictures.Do everything inside a blue frame.
The same pattern, another provider
Every major model API follows the pattern you just used. Trying a second provider teaches you which parts are universal, and gives you a fallback if one service is down or a different model suits a task better.

Trying it
Add a second key
In the same environment file, with its own spending limit.
Ask for one function
"Put the model call behind one function so the provider can be switched."
Run the same inputs
Compare quality, speed and cost.
Choose a default
And keep the other as an option.

Make the provider switchable
Ask Claude Code to route the AI feature through one function with a setting for the provider. Run the same three inputs through both and note which you prefer and why.
Done when
Keep the comparison. You will revisit it when costs matter.
Keep these
- Model APIs share one pattern.
- Keep the call in one place.
- Compare providers on your own inputs.