> ## Documentation Index
> Fetch the complete documentation index at: https://usefused.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Serving agents

> Run the neutral API, event streams, approvals, client tools, and playground.

Harnest gives managed and advanced agents the same development server, neutral API, events, and playground.

<CodeGroup>
  ```bash From source theme={null}
  harnest serve AGENT_DIR
  ```

  ```bash From an artifact theme={null}
  harnest compile AGENT_DIR --output .harnest/my-agent
  .harnest/my-agent/harnest-agent serve
  ```
</CodeGroup>

Serving from source uses the shared development environment and
`harnest-development.lock`. `harnest compile` uses the lean production profile;
serve the resulting launcher in deployment so development tools are not packaged. Playground assets, including the Markdown parser, live in the native CLI—not in compiled agents or the Python runtime wheel. Local `harnest serve` provides those assets temporarily; the deployed launcher does not expose the playground, its trace viewer, or its evaluation routes.

Agent replies in the local playground support Markdown headings, lists, tables, links, and code blocks across responses, streams, and restored sessions. Raw HTML and automatic image loading are disabled; tool payloads remain plain text.

| URL                             | Purpose                                |
| ------------------------------- | -------------------------------------- |
| `http://127.0.0.1:1907/`        | Playground, local `harnest serve` only |
| `http://127.0.0.1:1907/docs`    | OpenAPI explorer                       |
| `http://127.0.0.1:1907/healthz` | Process health                         |

<CardGroup cols={2}>
  <Card title="Server configuration" icon="sliders" href="/docs/harnest/runtime/serving/server-configuration">
    Configure the bind, timeout, concurrency, limits, and playground.
  </Card>

  <Card title="Development reload" icon="rotate" href="/docs/harnest/runtime/serving/development-reload">
    Recompile changes and replace the local agent process safely.
  </Card>

  <Card title="Neutral API" icon="code" href="/docs/harnest/runtime/serving/neutral-api">
    Use sessions, JSON responses, SSE streams, and live WebSockets.
  </Card>

  <Card title="Custom HTTP endpoints" icon="route" href="/docs/harnest/runtime/custom-http-endpoints">
    Expose business-specific FastAPI routes through the managed agent runtime.
  </Card>

  <Card title="Approvals and client tools" icon="user-check" href="/docs/harnest/runtime/serving/approvals-and-client-tools">
    Handle required actions and resume suspended work.
  </Card>

  <Card title="Production deployment" icon="shield" href="/docs/harnest/runtime/serving/production">
    Add authentication, durable storage, TLS, supervision, and network policy.
  </Card>
</CardGroup>

## Response modes

Start with the [copyable curl requests](/docs/harnest/runtime/serving/neutral-api#send-your-first-request). For machine-readable discovery, fetch `/agent` and `/openapi.json`; `/docs` provides the interactive API explorer.

| Mode      | Start with                                      | Receive                             |
| --------- | ----------------------------------------------- | ----------------------------------- |
| JSON      | `POST /responses`                               | One completed response              |
| SSE       | `POST /responses` with `"stream": true`         | Named `response.*` events           |
| WebSocket | Connect to `/live`, then send `response.create` | The same events over a live channel |

Input and output Pydantic schemas apply to every mode and OpenAPI.
