By the end of this lesson you will have a working chat page on your laptop that talks to a real model through your own server route, with the key safely in .env.local and a system prompt that gives your bot a clear job.
You need: VS Code, Node.js and a coding agent (set up in First web MVP), an AllModelAPI account with some credit or a plan (Pricing), your 5 lines from lesson 1 · Time: 9 minutes
Use a new key for every app. If it leaks, you revoke one key and nothing else breaks.
- Open API keys and click Create API key.
- Key name:
exam-buddy-dev(use your bot's name). - Model access: if you can choose models, pick only the ones this app will use, for example
glm-5.3-flash. If it only offers All models, keep that; your server's allow-list in lesson 3 does this job too. - Tick Allow streaming responses. You need it in lesson 3.
- Under Safety controls: set an Expiry date a few months away, a Spend limit of $5 Per month, and tick Notify me at 80% usage. Requests stop automatically when the limit is reached.
- Copy the key and keep it in your password manager. Do not paste it into WhatsApp, a screenshot or a chat with your AI agent.
Why?A spend limit decides how bad a bad day can be. With $5 per month, even a leaked key cannot cost you more than about ₹450 before it stops.
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- Start the project and add the key
- Test the key from the terminal
- Let the agent build the route and the chat page
- Give your bot a job: the system prompt
- Test it like a student
- Recap