Reference
Base URL: https://getmorphis.com (client-side SDK) and https://api.getmorphis.com (direct backend integration).
Every generation request carries a tenant API key, either in the JSON body (public route) or in the Authorization: Bearer header (backend route). Keys are created in the dashboard under API Keys and are shown only once.
# Public platform API (key in body)
curl -X POST https://getmorphis.com/api/generate-ui \
-H "Content-Type: application/json" \
-d '{"apiKey":"mph_live_...","intent":"..."}'
# Backend directly (key in header)
curl -X POST https://api.getmorphis.com/v1/generate-ui \
-H "Content-Type: application/json" \
-H "Authorization: Bearer mph_live_..." \
-d '{"prompt":"...","host_state":{}}'Generate a sanitized UI component from a prompt and context data.
{
"apiKey": "mph_live_...", // required — tenant API key
"intent": "show a churn-risk table", // required — what to generate (1–2000 chars)
"contextData": { "mrr": 5400 }, // optional — live data for the UI
"theme": "light" // optional — "light" | "dark" (default light)
}{
"html": "<!DOCTYPE html><html>…</html>",
"metadata": {
"generationTime": 1830, // ms, wall clock
"tokensUsed": 1240, // LLM tokens (0 when source = fallback)
"sanitized": true, // content passed the sanitizer
"model": "nvidia/nemotron-3-ultra", // model used
"source": "llm" // "llm" | "fallback"
}
}| Code | Meaning | Fix |
|---|---|---|
| 400 | Invalid JSON body or missing fields | Check request shape; intent and apiKey are required. |
| 401 | Invalid or missing API key | Confirm the key is active — it may have been revoked. |
| 413 | contextData too large | Keep payloads under 50 KB on the platform route. |
| 422 | Schema validation failed | Prompt must be ≤ 2,000 chars; theme must be light or dark; host_state caps apply. |
| 429 | Monthly quota exceeded | Upgrade your plan or wait for the next billing period. |
| 500 | Generation failed or empty after sanitization | Retry — output was rejected by the sanitizer. Simplify the intent. |
| 504 | LLM generation timed out | Retry; the free-tier model sometimes runs slowly. |
metadata.source so you can monitor LLM vs fallback usage on your side.