> For the complete documentation index, see [llms.txt](https://nytshift.gitbook.io/nytshift-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nytshift.gitbook.io/nytshift-docs/agents-identity-and-data/development-api.md).

# Development API

`apps/api` is an optional local development tool, not a NIGHTSHIFT production dependency. It cannot sign or submit a live order. Its paper state is process-local and every stateful response declares `executionCapability: "none"`.

Start an intentional session from a fresh PowerShell window:

```powershell
$env:NIGHTSHIFT_DEV_API_ENABLED = "true"
$env:NIGHTSHIFT_DEV_API_HOST = "127.0.0.1"
$env:NIGHTSHIFT_DEV_API_PORT = "4100"
$env:NIGHTSHIFT_DEV_API_TOKEN = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(48))
pnpm --filter @terminal/api build
pnpm --filter @terminal/api start
```

Call authenticated routes with `Authorization: Bearer <NIGHTSHIFT_DEV_API_TOKEN>`. Health at `http://127.0.0.1:4100/health` is the only unauthenticated route. Invalid bearer guesses are limited to 10/minute without locking out the correct token; authenticated reads allow 60/minute and mutations 20/minute per process capability. Bodies are capped at 64 KiB.

Stop with Ctrl+C, then remove the four `NIGHTSHIFT_DEV_API_*` variables from that shell. Never persist or reuse the token. Startup must fail when enablement/token is absent, the token is a placeholder or outside 32–4096 bytes, the port is outside 1024–65535, or the host differs from `127.0.0.1`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nytshift.gitbook.io/nytshift-docs/agents-identity-and-data/development-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
