Prompts voor AI-builders
Een builder schrijft de code sneller dan jij. Wat hij niet weet, zijn twee dingen over een specifieke API: waar de sleutel moet komen en waarom een verzoek vanuit de browser niet doorkomt. Allebei kosten ze uren debuggen, en allebei los je op met één alinea in de prompt.
Hieronder eerst die alinea, daarna zeven recepten.
De regel die je vóór elk recept moet invoegen
Section titled “De regel die je vóór elk recept moet invoegen”Kopieer dit blok in de builder vóór de tekst van het recept. Het gaat niet over codestijl, het gaat over wat anders niet gaat werken.
AstroWay API house rules. Apply these to every request you generate.
1. The API key is a server secret. Never put aw_live_* or aw_test_* into client code, into a VITE_* or NEXT_PUBLIC_* variable, or into a fetch that runs in the browser. Create a server route and call the API from there.2. The browser cannot call https://api.astroway.info/v1/* with that key. The one exception is a publishable pk_live_* key created for your app's origin: responses to that origin carry access-control-allow-origin, and the key works only from origins on its own list. Two prefixes answer any browser with no key: /v1/public/* returns JSON you can use, and /v1/embed/* returns a finished HTML page meant for an iframe, not for fetch.3. The auth header is exactly "X-Api-Key: <key>". Authorization: Bearer is rejected with 401, and so is an api_key query parameter.4. Send the birth time zone as an IANA name: "timezone": "Europe/Kyiv". Do not compute a UTC offset yourself. Kyiv in May 1990 was UTC+4, not the +3 it is today, and a wrong offset moves every house cusp.5. Every response is {"ok": true, "data": {...}} or {"ok": false, "error": {"code": "...", "message": "..."}}. Read data on success and show error.message to the user on failure. Do not assume a bare object.6. Planet positions arrive as ecliptic longitude in degrees, with no sign name. Derive it: SIGNS[Math.floor(longitude / 30)] where SIGNS runs Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio, Sagittarius, Capricorn, Aquarius, Pisces. Degrees inside the sign are longitude % 30.7. Responses carry X-Credits-Used and X-Credits-Remaining. Log both on the server so the cost of a feature is visible before the bill is.8. Ask for the fields you will render. Every endpoint takes ?fields= as a comma-separated list of dotted paths and ?precision= as decimal places: POST /v1/chart?fields=planets.name,planets.longitude,houses.cusp&precision=2 answers in 559 bytes where the full response is 32,410. Same credits, and the tokens are yours to pay either way.9. Get a free key at https://api.astroway.info/dashboard/sign-up and use an aw_test_* sandbox key while building: it spends no credits.1. Geboortehoroscoop met wiel
Section titled “1. Geboortehoroscoop met wiel”Twee responses op één actie van de gebruiker: de data van de horoscoop en een kant-en-klare SVG.
| Endpoint | Credits |
|---|---|
/v1/chart | 20 |
/v1/render/wheel-western | 10 |
Build a single-page app: a birth data form (date, time, city with latitude andlongitude, IANA time zone) that renders a natal chart.
Server route POST /api/chart does two calls to AstroWay, in parallel: POST https://api.astroway.info/v1/chart POST https://api.astroway.info/v1/render/wheel-westernBoth take the same body: { "date": "1990-05-15", "time": "14:30:00", "timezone": "Europe/Kyiv", "latitude": 50.45, "longitude": 30.52 }Both need the X-Api-Key header.
/v1/chart returns data.planets (array with name, longitude, isRetrograde),data.houses.cusps (array of 12 longitudes) and data.aspects (array withplanet1, planet2 and a type object carrying name, symbol and color)./v1/render/wheel-western returns data.svg as a string.
The page shows the SVG at the top, then a table of planets with sign anddegree derived from longitude, then the aspect list using type.symbol andtype.color. Mark retrograde planets with an R.
Do not call AstroWay from the browser. The page calls /api/chart only.Controleer na het genereren: de SVG is als markup ingevoegd, niet in <img src>; de tijd is als string HH:mm:ss verstuurd; de sleutel is niet in de bundle beland (zoeken op aw_ in de gebouwde bestanden moet niets opleveren).
2. Compatibiliteit van twee horoscopen
Section titled “2. Compatibiliteit van twee horoscopen”Eén getal en de onderdelen ervan, zonder uitleggende tekst. /v1/synastry/attraction-score, 50 credits per paar.
Build a compatibility page: two birth-data forms side by side, one button.
Server route POST /api/compat calls POST https://api.astroway.info/v1/synastry/attraction-scorewith body { "chart1": {...}, "chart2": {...} }, where each chart is { "date", "time", "timezone", "latitude", "longitude" }.
The response has data.score (a number), data.components (the parts that madeit) and data.notes. Render score as a large number with a progress ring, thencomponents as labelled bars, then notes as a list.
Never show the score without the components: a single number with no reasonbehind it is the thing users distrust.3. Daghoroscoop, helemaal zonder sleutel
Section titled “3. Daghoroscoop, helemaal zonder sleutel”Het enige recept waarbij geen serverroute nodig is: dit endpoint antwoordt de browser en kost geen credits.
Add a daily horoscope block to the page. Call this directly from the browser,no key and no server route needed:
GET https://api.astroway.info/v1/public/horoscope/daily?sign=leo&lang=en
Response: data.sign, data.date, data.period, data.horoscope (the text),data.disclaimer and data.language. Render a sign picker with the twelve signs,remember the choice in localStorage, and always show data.disclaimer under thetext.
The first request for a date that has not been generated yet can take a while,so show a skeleton, not a spinner that looks stuck.4. Human Design
Section titled “4. Human Design”Type, strategie, autoriteit, profiel, centra en kanalen in één aanroep van /v1/human-design, 50 credits.
Build a Human Design page: birth data form, then the chart summary.
Server route POST /api/hd calls POST https://api.astroway.info/v1/human-designwith { "date", "time", "timezone", "latitude", "longitude" }.
The response has data.type, data.strategy, data.notSelfTheme, data.authority,data.profile, data.definition, data.cross, data.centers, and the activationarrays data.personalityActivations and data.designActivations.
Lay it out as: type and strategy as the headline, authority and profile as twocards, centers as a list with defined ones filled and undefined ones outlined,activations in a collapsible table. Birth time matters here more than anywhereelse, so refuse to submit without it and say why.5. PDF-rapport onder het merk van de gebruiker
Section titled “5. PDF-rapport onder het merk van de gebruiker”Voor wie rapporten verkoopt in plaats van schermen toont. /v1/reports/natal, 5000 credits per document, en de link leeft 24 uur.
Build a report generator: birth data form plus a branding form (company name,report title, accent colour), and a Generate button.
Server route POST /api/report calls POST https://api.astroway.info/v1/reports/natalwith { "chart": { "date", "time", "timezone", "latitude", "longitude" }, "whitelabel": { "companyName": "...", "reportName": "...", "themeColor": "#7c3aed", "footerText": "..." } }
The response has data.url, data.page_count, data.byte_length anddata.expires_at. The URL is valid for 24 hours only, so the server mustdownload the PDF immediately and store it on your side, then hand the useryour own link. Never give the AstroWay URL to the end user.
Show page_count and a download button. One report costs 5000 credits: put aconfirmation step before the call, not after.De volledige catalogus van zestien rapporten, wat er in elk zit en hoeveel pagina’s: Reports API.
6. Transitkalender voor een maand
Section titled “6. Transitkalender voor een maand”Een lijst met gebeurtenissen in een datumvenster, waar zowel een tijdlijn als een kalender uit voortkomt. /v1/transit-calendar, 100 credits per venster.
Build a month view of transits.
Server route POST /api/transits calls POST https://api.astroway.info/v1/transit-calendarwith { "natal": { "date", "time", "timezone", "latitude", "longitude" }, "startDate": "2026-10-01", "endDate": "2026-10-31" }
The response has data.count and data.events, plus the echoed startDate,endDate and maxOrb. Render events on a month grid, one dot per day withevents, and a day panel listing that day's events.
One call covers the whole window, so fetch the month once and filter in theclient. Do not call the API per day: that is thirty-one calls and thirty-onetimes the credits for the same answer.7. Tarotlegging
Section titled “7. Tarotlegging”De goedkoopste manier om dagelijkse interactie toe te voegen. /v1/tarot/rider-waite/draw/three-card, 10 credits per legging, of nul voor de dagkaart.
Add a three-card tarot spread.
Server route POST /api/tarot calls POST https://api.astroway.info/v1/tarot/rider-waite/draw/three-cardwith an optional { "seed": 7 }. The response has data.spread, data.seed anddata.drawn.
Pass a seed derived from the user id and today's date, so the same person getsthe same spread all day and a new one tomorrow. Without a seed every reloaddeals a new hand, which reads as a slot machine.
For a zero-cost daily card the browser can call GET https://api.astroway.info/v1/public/tarot/dailydirectly, no key.Acht builders, één verschil
Section titled “Acht builders, één verschil”De recepten hierboven zijn voor iedereen gelijk. Het verschil zit alleen in waar de serverroute leeft en waar je de sleutel neerzet.
| Builder | Waar de serveraanroep leeft | Waar de sleutel komt |
|---|---|---|
| Lovable | edge function in Supabase | Secrets van het Supabase-project |
| Bolt | server function | het Secrets-paneel in Bolt |
| v0 | Next.js route handler op Vercel Functions | environment variable in Vercel, van het type Secret |
| Replit | een gewoon serverproces | Replit Secrets, en apart nog een keer in Deployments |
| Cursor, Claude Code, Devin Desktop, Copilot | die uit jouw stack | .env buiten git plus de opslag van je hosting |
Vier aparte valkuilen, elk kost een avond.
- Lovable en Bolt bouwen de frontend met Vite, en Vite geeft elke variabele met het prefix
VITE_aan de browser. De sleutel zet je daar zelfs niet tijdelijk in: hij belandt in een bundle die aan iedereen wordt uitgedeeld. - Bolt toont de preview binnen een WebContainer, en dat is een echte browser met echte CORS, die je daar niet uitzet. Een serverfunctie is hier niet “beter”, maar de enige manier waarop de aanroep überhaupt plaatsvindt.
- v0 bakt
NEXT_PUBLIC_*in de bundle tijdens de build. De waarde in het dashboard veranderen is niet genoeg: zolang er geen nieuwe deploy is, draait de app met de oude sleutel. Een sleutel roteren is roteren plus opnieuw bouwen. - Replit houdt de secrets van de werkruimte en de secrets van Deployments gescheiden. Wat in de editor werkte, crasht na publicatie met een lege sleutel, totdat je hem nog een keer toevoegt in het Deployments-paneel.
De laatste vier regels van de tabel zijn geen platforms, maar agents in je repository, en elk heeft een eigen netwerk-allowlist voor zijn sandbox. Wil de agent de net geschreven code testen, dan kan een aanroep naar api.astroway.info geblokkeerd worden totdat het domein is toegevoegd. Voor hen is er ook een kortere weg: koppel onze MCP en de agent roept de API zelf aan, zonder jouw code. Instructies staan op Agent instellen.
Als je agent function calling spreekt in plaats van MCP
Section titled “Als je agent function calling spreekt in plaats van MCP”Neem de kant-en-klare tooldefinities en geef ze direct aan het model. Ze worden gegenereerd uit het OpenAPI-document, dus het schema dat het model invult is hetzelfde dat het endpoint valideert.
curl "https://api.astroway.info/v1/agent/tools?format=openai&select=starter" \-H "X-Api-Key: aw_live_YOUR_KEY"format accepteert openai en anthropic, select beperkt de catalogus tot de startset in plaats van alle tools.