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

# HTTP API

> Every endpoint the Fleet Prime Agent web server exposes: chat, sessions, projects, workspace, and health.

The web workspace is served by process-agnostic `Request → Response` handlers in `web/server`, mounted as `/api` routes by `web/app`. All endpoints bind to loopback by default; there is no authentication layer. Set `VITE_FLEET_PI_CHAT_RUNTIME_URL` to point the browser at a remote runtime.

## Chat

| Method | Path                          | Purpose                                                                                                |
| ------ | ----------------------------- | ------------------------------------------------------------------------------------------------------ |
| POST   | `/api/chat`                   | Run a turn. Streams NDJSON `ChatStreamEvent` frames; the first frame advertises `adapterCapabilities`. |
| POST   | `/api/chat/abort`             | Abort the active turn and cancel its pending dialogs.                                                  |
| POST   | `/api/chat/question`          | Answer a pending interactive dialog.                                                                   |
| GET    | `/api/chat/events?sessionId=` | SSE channel for out-of-turn pushes, with ring-buffer replay via `Last-Event-ID`.                       |
| POST   | `/api/chat/command`           | Execute a slash command.                                                                               |
| GET    | `/api/chat/commands`          | Slash command autocomplete.                                                                            |
| PUT    | `/api/chat/artifacts`         | Store an OpenUI HTML artifact.                                                                         |

## Sessions

| Method | Path                      | Purpose                                                                  |
| ------ | ------------------------- | ------------------------------------------------------------------------ |
| POST   | `/api/chat/new`           | Create a session (`{ cwd, model?, thinkingLevel? }`).                    |
| POST   | `/api/chat/resume`        | Resume by `sessionId` or `sessionFile`.                                  |
| GET    | `/api/chat/session`       | One session with its messages; with `attachmentId`, fetch an attachment. |
| POST   | `/api/chat/session`       | Upload attachments to a session.                                         |
| PUT    | `/api/chat/session`       | Store a plan presentation.                                               |
| GET    | `/api/chat/sessions?cwd=` | List sessions for the session picker.                                    |
| PATCH  | `/api/chat/sessions`      | Rename a session.                                                        |
| DELETE | `/api/chat/sessions`      | Delete a session.                                                        |
| POST   | `/api/chat/model`         | Switch the session's model.                                              |

## Models, providers, and settings

| Method | Path                        | Purpose                                                   |
| ------ | --------------------------- | --------------------------------------------------------- |
| GET    | `/api/chat/models`          | Model catalog from the engine's model registry.           |
| POST   | `/api/chat/models/discover` | Probe an OpenAI-compatible endpoint's `/v1/models`.       |
| GET    | `/api/chat/providers`       | Provider catalog and credential status.                   |
| POST   | `/api/chat/providers/oauth` | Run a provider OAuth flow.                                |
| GET    | `/api/chat/settings`        | Resolved engine settings.                                 |
| PATCH  | `/api/chat/settings`        | Persist settings through the engine's settings manager.   |
| GET    | `/api/chat/resources`       | Skills, prompts, and extensions available to the session. |

## Projects

| Method | Path                   | Purpose                                           |
| ------ | ---------------------- | ------------------------------------------------- |
| GET    | `/api/projects`        | List projects with their sessions and statuses.   |
| POST   | `/api/projects`        | Create a project.                                 |
| PATCH  | `/api/projects`        | Rename a project.                                 |
| DELETE | `/api/projects`        | Delete a project.                                 |
| POST   | `/api/projects/fork`   | Fork a project session.                           |
| GET    | `/api/projects/browse` | Directory picker for binding a project to a path. |

## Workspace

| Method | Path                    | Purpose                                |
| ------ | ----------------------- | -------------------------------------- |
| GET    | `/api/workspace/tree`   | File tree of the bound workspace root. |
| GET    | `/api/workspace/file`   | File preview.                          |
| GET    | `/api/workspace/browse` | Directory picker.                      |
| POST   | `/api/workspace/root`   | Rebind the default working directory.  |

## Health

| Method | Path          | Purpose                                 |
| ------ | ------------- | --------------------------------------- |
| GET    | `/api/health` | Liveness plus IPython kernel readiness. |

For the frame shapes on the streaming endpoints, see [Streaming](/fleet-prime-agent/concepts/streaming).
