# Nabu

> Story-aware screenwriting software for developing, writing, and revising a screenplay.

Product overview: https://nabu.page/llms.txt

## API

- OpenAPI 3.1 spec: /api/openapi.json
- Agent quickstart: /docs/agent-quickstart.md
- Error catalog: /docs/api-errors.md

## Authentication

API keys: `Bearer nabu_sk_…`. Create via `POST /api/keys` (admin role
required). An existing admin-scoped key can also create keys, subject to
workspace role and plan checks. Scopes are cumulative: admin > write > read.
Keys are workspace-scoped. Omitted scopes default to read-only; select write
explicitly for mutations. Omitted capabilities default to none. CLI onboarding
starts read-only with agent_mode + auto_advance selected; these do not grant write.

## Capabilities

Enforced capabilities:
- `agent_mode` — permits `caller: "agent"`
- `autonomous_write` — direct mutation tools (write_scene, update_scene,
  revise_project_artifact)
- `auto_advance` — wizard auto-advance via `auto_select_pitch`

`dispatch_agents` and the `admin` capability are declared but inert;
admin access is governed by scope and user role, not that capability.

## Project discovery

GET /api/projects/{id}/capabilities returns capabilities and blocked arrays.
Discovery is a partial inspection, not authorization or billing admission:
available=true does not guarantee execution. Read admission.uncheckedRequirements.
Blocked and unknown actions include reason/remedy. All eight advertised actions
use POST; exports require viewer/read access, while mutations require editor/write.
Wizard state and artifact fields can be null: treat unknown as unknown, not BONES
or missing content. Request the actual action to perform its execution-time checks.

## Response envelope

The server agent-envelope builder and schema are retired. The CLI retains
a local result type with empty metadata fields; no route produces that envelope. Do not drive work from `agent_envelope` or `next_actions`.
Chat returns durable job/turn identity; follow its shared stream. Read
`GET /api/projects/{id}/wizard` for canonical wizard state and use the
quickstart stage loop. The CLI command matrix documents supported commands;
scene updates, notes and exports require REST.

## Error envelope

Every 4xx/5xx response carries `{ error: { code, message, category,
suggestedAction?, retryable?, retryAfter?, details? } }`. Use `retryable`
+ `retryAfter` to drive backoff.

## License + abuse

Production use requires a paid Nabu workspace. Probing / scraping at
significant volume will trip rate limits + may block keys.
