beta
Nawa API
Create, edit and publish apps from code. Create a key in Settings → API keys and send it in the Authorization header.
Auth and limits
Authorization: Bearer nawa_live_…— shown once at creation; only its hash is stored.- A revoked or wrong key → 401 with {error, error_ar}.
- 60 requests per minute per key; then 429 with a Retry-After header.
- Not enough credits for the chosen tier → 402. Tiers: fast, smart, max.
Endpoints
| GET | /projects/ | Projects in the key's workspace |
| POST | /projects/ | Create a project from {prompt, locale} |
| POST | /projects/{id}/messages/ | Send {text, tier}: builds a new project or edits a ready app → job |
| GET | /jobs/{id}/ | Job status: queued | running | succeeded | failed |
| POST | /projects/{id}/publish/ | Publish the current version → job with the live url |
Full spec (OpenAPI 3.1): /api/v1/openapi.json
curl
# 1) Create a project
curl -X POST https://nawa-ebon.vercel.app/api/v1/projects/ \
-H "Authorization: Bearer $NAWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "A booking site for a dental clinic in Dubai", "locale": "en"}'
# 2) Build it (returns a job)
curl -X POST https://nawa-ebon.vercel.app/api/v1/projects/$PROJECT_ID/messages/ \
-H "Authorization: Bearer $NAWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Build it", "tier": "smart"}'
# 3) Poll the job
curl https://nawa-ebon.vercel.app/api/v1/jobs/$JOB_ID/ -H "Authorization: Bearer $NAWA_API_KEY"
# 4) Publish
curl -X POST https://nawa-ebon.vercel.app/api/v1/projects/$PROJECT_ID/publish/ -H "Authorization: Bearer $NAWA_API_KEY"JavaScript
const NAWA = "https://nawa-ebon.vercel.app/api/v1";
const h = { Authorization: `Bearer ${process.env.NAWA_API_KEY}`, "Content-Type": "application/json" };
const project = await (await fetch(`${NAWA}/projects/`, { method: "POST", headers: h,
body: JSON.stringify({ prompt: "Specialty coffee shop with online ordering", locale: "en" }) })).json();
let { job } = await (await fetch(`${NAWA}/projects/${project.id}/messages/`, { method: "POST", headers: h,
body: JSON.stringify({ text: "Build it", tier: "fast" }) })).json();
while (job.status === "queued" || job.status === "running") {
await new Promise((r) => setTimeout(r, 5000));
({ job } = await (await fetch(`${NAWA}/jobs/${job.id}/`, { headers: h })).json());
}
console.log(job.status, job.result); // version and credits usedNote: a full build takes several minutes and runs in stages in the background; poll the job until it is succeeded.