Complete, runnable solutions to things people actually build. Each recipe is one file you can paste into a project — no framework, no scaffolding.
The recipes#
| Recipe | Shows you |
|---|---|
| A streaming chatbot | Streaming to a browser without exposing your key, and keeping the conversation. |
| Extract structured data | Turning messy documents into rows that match a schema, with validation. |
| Read a screenshot | Sending an image and asking a specific question about it. |
| Handle errors and retries | A production-grade wrapper: what to retry, what never to, and how to back off. |
Read these two first
Quickstart gets you a working call; Errors is the one page that will save you the most time. Everything here assumes both.Conventions in these examples#
Every recipe reads the key from UPFYN_API_KEY, runs server-side, and sets max_retries=0 so retry policy is explicit rather than inherited. Model choices are deliberate and explained where they matter.
