Quickstart
Create an API key, run your first design job, and open the viewer in under five minutes.
This walkthrough generates a landing page end to end.
1. Get an API key
- Sign in at app.nexdoc.design.
- Open API Keys and create a key.
- Copy the secret once — it is shown only at creation time.
export NXD_API_URL=https://api.nexdoc.design
export NXD_API_KEY=nxd_live_...Confirm the key works:
curl -sS "$NXD_API_URL/v1/auth/me" \
-H "Authorization: Bearer $NXD_API_KEY" | jq{
"user_id": "user_...",
"org_id": "org_...",
"email": "[email protected]",
"name": "You",
"scopes": ["files:rw", "jobs:rw", "runs:rw"]
}2. Create a job
A job is a project container for related runs.
JOB=$(curl -sS -X POST "$NXD_API_URL/v1/jobs" \
-H "Authorization: Bearer $NXD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Acme Landing Page"}' | jq -r .job_id)
echo "$JOB"3. Start a run
Pass format, instructions, and content. The agent rewrites content for the medium and designs the layout.
RUN=$(curl -sS -X POST "$NXD_API_URL/v1/jobs/$JOB/runs" \
-H "Authorization: Bearer $NXD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "landing-page",
"instructions": "Dark editorial landing page. Hero with CTA, three feature cards, footer.",
"content": "# Acme\n\nAPI-first design for product teams.\n\n- Fast generation\n- Brand-aware layouts\n- Export to PDF or HTML"
}')
echo "$RUN" | jq
RUN_ID=$(echo "$RUN" | jq -r .run_id)Response (202 Accepted):
{
"job_id": "job_...",
"run_id": "run_...",
"status": "queued",
"notify_email": false,
"created_at": "2026-09-03T00:00:00Z"
}Save both IDs immediately. If the wallet cannot cover a run you get 402 — add credits at app.nexdoc.design (minimum $10). See Billing.
4. Wait until completed
A short landing page typically takes 1–5 minutes. A long wait is not a hang. Poll every few seconds:
while true; do
STATUS=$(curl -sS "$NXD_API_URL/v1/jobs/$JOB/runs/$RUN_ID" \
-H "Authorization: Bearer $NXD_API_KEY")
echo "$STATUS" | jq '{status, charge_usd, viewer_url, error}'
S=$(echo "$STATUS" | jq -r .status)
case "$S" in completed|failed|cancelled) break ;; esac
sleep 5
doneIf you cannot hold the connection, set "notify_email": true on create (or POST /v1/jobs/$JOB/runs/$RUN_ID/notify-email) and keep the IDs. webhook_url is accepted but delivery is not guaranteed.
On success you get viewer_url (valid 24 hours; remint anytime) and charge_usd. Failed runs are not charged.
5. Preview or download
| Goal | Action |
|---|---|
| Interactive preview | Open viewer_url (also has floating Export / Publish controls) |
| Download HTML ZIP | POST /v1/jobs/:id/export with {"format":"html"} |
| Download PDF | POST /v1/jobs/:id/export with {"format":"pdf"} |
| Public site | POST /v1/jobs/:id/publish → public_url (only when you want it live) |
curl -sS -X POST "$NXD_API_URL/v1/jobs/$JOB/export" \
-H "Authorization: Bearer $NXD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"format":"pdf","run_id":"'"$RUN_ID"'"}' | jqPublishing is optional — most flows stop at preview or download.
Next steps
- Your first document — assets, multipart upload, reports
- Formats — pick the right medium
- Updating a design — iterate on the same job
- MCP / Skills — use NexDoc from an AI client