Guide
The final steps before putting Morphis in front of real users. Work through it page by page.
Estimate your monthly volume before launch. Keep a 20% buffer above expected usage. If you cap out mid-month, API calls return HTTP 429 with a clear message — your frontend should catch this and show a polite "temporarily unavailable" state.
Every POST /api/generate-ui is a fresh model call. For repeated intents with stable data, cache by a hash of (intent, contextData) to save quota and latency.
Morphis responses can be any of the HTTP codes documented in the API reference. Design for these cases:
const res = await fetch('/api/generate-ui', { ... })
if (res.status === 429) return showQuotaNotice()
if (res.status === 504) return showSlowModelNotice() // free-tier model hit its SLA
if (!res.ok) return showErrorState('Generation unavailable')
const { html, metadata } = await res.json()
mountComponent(html)When the LLM is slow, metadata.source becomes fallback. The system renders a clean template table/card/chart rather than leaving users stuck. Your UI already handles this pattern — just be aware that content comes from deterministic templates in this mode, not model output.