Set Up Once, Build Forever
environment and API key
Part of: How to Build with AI: The Playbook
You set this up one time, then stop thinking about it. The goal of this lesson is a single Python file that makes a real model call and prints a reply. What you need - Python 3.10 or newer installed. Check with python --version in a terminal. - A code editor . VS Code is free and works well. - An API key from a model provider. This track uses simple HTTP calls, so any provider works. You paste your key once. The next lesson recommends a specific free one if you don't have a preference yet. Install the basics That's the only library you need to start. requests makes HTTP calls. Provider SDKs are convenient later, but plain HTTP shows you exactly what is going over the wire. The one rule about keys: never hard-code them A key is a password that can spend money. Do not paste it into your code, where it can end up on GitHub for the world to find. Put it in an environment variable instead: Then read it in Python: If that prints a length instead of an error, you are ready. If it crashes, the variable isn't set in this terminal, so run the export line again. Why bother Hard-coded keys are the most common way beginners leak credentials and rack up surprise bills. Reading from the environme