Skip to content
nexdoc.design Docs

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

  1. Sign in at app.nexdoc.design.
  2. Open API Keys and create a key.
  3. Copy the secret once — it is shown only at creation time.
code
export NXD_API_URL=https://api.nexdoc.design
export NXD_API_KEY=nxd_live_...

Confirm the key works:

code
curl -sS "$NXD_API_URL/v1/auth/me" \
  -H "Authorization: Bearer $NXD_API_KEY" | jq
code
{
  "user_id": "user_...",
  "org_id": "org_...",
  "email": "you@company.com",
  "name": "You",
  "scopes": ["files:rw", "jobs:rw", "runs:rw"]
}

2. Create a job

A job is a project container for related runs.

code
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.

code
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):

code
{
  "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:

code
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
done

If 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

GoalAction
Interactive previewOpen viewer_url (also has floating Export / Publish controls)
Download HTML ZIPPOST /v1/jobs/:id/export with {"format":"html"}
Download PDFPOST /v1/jobs/:id/export with {"format":"pdf"}
Public sitePOST /v1/jobs/:id/publishpublic_url (only when you want it live)
code
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"'"}' | jq

Publishing is optional — most flows stop at preview or download.

Next steps