Vibe Coder · Unit 10: APIs · Project
Milestone 10 of 16
One AI feature
A feature in your app that calls a model, with its key kept safe.
One product, built in sixteen steps
Vibe Coder has one project. You pick an idea in Unit 1 and every unit adds a piece to it, until Unit 16 launches it. This is where your product starts to think. This milestone adds one feature that calls a model, returns an answer in a shape your app can rely on, and keeps its key out of sight.
- 1Your builder’s kitA one-line product idea, your role, and five working accounts.
- 2A fact-checked product briefOne page on your idea, tested against how the models really behave.
- 3Your product project in ClaudeA project with instructions and files, and your first real piece of work from it.
- 4A brand kit and research fileA name, images and market research for your product, with a second opinion.
- 5Your prompt libraryThe prompts you will reuse to build the product, each one tested.
- 6Your product specThe problem, the people, the first version and how you will measure it.
- 7A clickable prototypeA version people can click through, shown to three of them.
- 8The first working versionYour app running on your computer, built with Claude Code.
- 9Your Claude Code setupProject instructions, a custom command and a skill made for your app.
- 10One AI featureA feature in your app that calls a model, with its key kept safe.
- 11An automated workflowYour app connected to a tool you already use.
- 12Sign-in and saved dataAccounts and a database behind your app.
- 13A tested, locked-down appEvery flow checked, and each person able to see only their own data.
- 14A launch videoThirty to sixty seconds, with voice, music and sound.
- 15Your app, liveOnline at its own address, updating every time you save.
- 16Your launched productThe finished product, in front of people, with a page that shows your work.
You start with
Your Claude Code setup
Project instructions, a custom command and a skill made for your app.
Milestone 9Your product gains
One AI feature
That makes 10 of 16 pieces in place.
Your role
The steps change with your role. Choose yours to see your version of this milestone.
Start with this prompt
Paste it into Claude or ChatGPT, or into Claude Code once you are building. Fill in the parts in square brackets with your own product.
I want to add one AI feature to my app. Here is what it should do for the person using it: [describe it in one or two sentences] Before writing code, tell me: what goes into the model, what should come back and in what shape, where the API key will live so that it never reaches the browser, and roughly what one call will cost. Then build it in small steps, and show me how to test it with a good input and a bad one.
Build it step by step
7 steps, one from each lesson of the unit. Do each step after its lesson. A box you tick here is ticked in the lesson too.
Step 1 of 7 · from the lesson The Messages API
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Implement the model call
Implement your AI feature with the official SDK in a server route, with a system prompt, streaming, usage logging and stop-reason handling. Add a test with a mocked client.
Done when
Keep the client behind one module so later lessons can extend it.
Step 2 of 7 · from the lesson Structured outputs
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Add a schema to your feature
Define a schema for your feature’s output, request structured output, validate it, and implement retry and fallback. Add tests for a valid, an invalid and a refused response.
Done when
Your database types will be generated from the same shapes in Unit 12.
Step 3 of 7 · from the lesson Tool use
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Add one tool
Give your feature one read-only tool that looks up data for the signed-in user. Implement the loop with authorisation, a round limit and logging, and test a permitted and a forbidden call.
Done when
This is the mechanism behind every agent, including Claude Code.
Step 4 of 7 · from the lesson Caching and batching
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Cache your prompt
Restructure your feature’s prompt so the stable part comes first, enable caching, and confirm from the usage data that later calls read from the cache. Record cost before and after.
Done when
Use a batch job when you add a backfill.
Step 5 of 7 · from the lesson The Responses API
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Add a second provider
Implement your feature against the Responses API behind the same interface, with the same schema and tests. Run your inputs through both and record quality, latency and cost.
Done when
A provider switch is now a configuration change.
Step 6 of 7 · from the lesson Other APIs
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Integrate one service
Add one non-model service your product needs, such as transactional email, using its SDK in test mode with the key in the environment. Verify any webhook signature and add a test.
Done when
Switch to live keys only in the Deploy unit.
Step 7 of 7 · from the lesson Errors and retries
Read the short notes and pictures.Do everything inside a blue frame.
ActivityBuild stepOne AI feature Harden your AI feature
Add timeouts, backoff retries for temporary errors, a clear error state that keeps the user’s input, and logging. Test by simulating a rate limit and a timeout.
Done when
Your AI feature is implemented, structured, tooled, cached and resilient.
When it is done
Every box above is ticked, and you can show the result to someone who has not seen it before. Then move on: milestone 11 is an automated workflow.