Add artificial intelligence to your app and build a complete example, ready for a real course.
Lesson 1
Adding AI to your teaching app
So far, Copilot has helped you write the code of your app. This lesson goes further: adding an AI feature your students can use directly, like an “explain this differently” button that queries an AI model live.
Ask Copilot to help you build this integration: a button that sends a question to an AI model and displays the answer on your page.
Try it yourselfAdd one AI-powered button to an existing project — even a placeholder that just echoes the question back — to see the wiring end to end.
Several families of AI models exist (GPT, Claude, Gemini, among others), with differences in quality, speed, and cost. Inside Copilot Chat, you can already pick between several models depending on the task.
For the AI built into your teaching app, start simple with an inexpensive model, and only move to a more powerful one if you really need to.
Try it yourselfAsk the same question to two different models inside Copilot Chat and compare the answers for quality, tone, and speed.
To use an AI model in your app, you need an access key (API key): a kind of password for that service. Never put this key directly in code that is visible on GitHub.
Ask Copilot to help you store it as a protected secret (environment variable or GitHub secret): your institution's IT department can help with this if needed.
TipA key exposed by mistake can be used by others: if that happens, regenerate it immediately.
Try it yourselfStore one API key as a protected secret instead of directly in your code, and confirm your code still works by reading it from there.
Build a concrete example: on your course page, an “I don't understand” button that sends the student's question to an AI model and shows a different explanation, simpler or with another example.
Ask Copilot to build this feature step by step, testing each part before moving to the next.
Try it yourselfBuild the “I don't understand” button end to end on a real page you own — your Quick Poll or another project.
An AI integration should never expose your access key in the student's browser. Ask Copilot to set up a small server-side function that receives the question, calls the AI model with the hidden key, and returns only the answer.
Platforms like Vercel or Netlify let you host this kind of function for free for a small project, in a few clicks straight from your GitHub repository.
Try it yourselfDeploy your AI feature through a small serverless function, and check your browser's network tab to confirm the key never appears there.
An AI model costs something for every question asked. On paid organisational Copilot plans, model-heavy features such as Chat, CLI, Spaces, the cloud agent, and similar agentic tools use AI credits — but code completions and next edit suggestions stay unlimited and are not billed in credits.
Business includes 1,900 AI credits per user per month and Enterprise includes 3,900. Those credits are pooled across the whole billing entity, so heavy and light users balance out instead of every person being trapped inside a silo. GitHub runs promotional allowances from time to time — check the official plans page for what applies today.
Try it yourselfWrite down which part of your workflow needs unlimited autocomplete and which part truly needs model-heavy agentic work. That distinction is the basis of honest cost control.
AI isn't limited to text: some models can describe an image, transcribe an audio recording, or even generate an image from a description. For a course, this opens possibilities like marking a hand-drawn diagram or transcribing an oral presentation.
These features need a bit more preparation, but the method stays the same: describe precisely what you want to Copilot, test, adjust.
Try it yourselfTry asking an AI model to describe or summarise one image or recording relevant to your own role.
To close this track, here is a complete example you can build end to end: an interactive quiz with automatic grading, scores saved to a database, and an AI explanation button for every missed question, all published online through GitHub.
You now have every tool you need to build, test, publish, and evolve your own teaching apps. The only real limit now is the time you want to spend on it: thank you for following this track, and happy vibe coding!
Try it yourselfWrite down one thing you'll build next with what you've learned in this course — then go build it.