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

# HTTP and WebSocket routes

> Find the route a model serves, its request limits and its readiness response.

Start with `GET /v1/models` to identify the deployed base model and any LoRA adapters. The [model catalog](https://docs.m-star.org/models.md#matrix) lists each launch key’s OpenAI capabilities. Every model can receive a native request at `/generate` or `/generate/ws`.

## Routes

| Method | Path | Serves | Guide |
| - | - | - | - |
| `POST` | `/generate` | A native request from form fields; JSON or NDJSON reply. Every model. | [Native /generate](https://docs.m-star.org/clients.md#native-generate) |
| `WS` | `/generate/ws` | `/generate` requests over one socket, JSON or msgpack frames, with live input. Every model. | [WebSocket](https://docs.m-star.org/clients.md#websocket-generatews) |
| `WS` | `/` | openpi's policy protocol, on a deployment whose config has an `openpi:` block. | [openpi](https://docs.m-star.org/clients.md#openpi-websocket) |
| `GET` | `/healthz` | openpi's health probe, plain `OK`; 404 without an `openpi:` block. | [Health](#health) |
| `GET` | `/health` | Health check. | [Health](#health) |
| `GET` | `/metrics` | Prometheus metrics with `--enable-metrics`; 404 without it. | [Metrics](https://docs.m-star.org/metrics.md) |
| `GET` | `/v1/models` | The served model and its LoRA adapters. Every model. | [LoRA adapters](https://docs.m-star.org/models/lora.md) |
| `POST` | `/v1/load_lora_adapter` | Load a LoRA adapter while serving, when the config allows it. | [LoRA adapters](https://docs.m-star.org/models/lora.md#runtime-updates) |
| `POST` | `/v1/unload_lora_adapter` | Unload a LoRA adapter. | [LoRA adapters](https://docs.m-star.org/models/lora.md#runtime-updates) |
| `POST` | `/v1/chat/completions` | OpenAI chat. | [Chat](https://docs.m-star.org/clients.md#chat) |
| `POST` | `/v1/audio/speech` | OpenAI text-to-speech. | [Speech](https://docs.m-star.org/clients.md#speech) |
| `GET` | `/v1/audio/voices` | The `voice` ids a speech model accepts, and its default. | [Speech](https://docs.m-star.org/clients.md#speech) |
| `POST` | `/v1/audio/transcriptions` | OpenAI speech-to-text, multipart upload. | [Transcription](https://docs.m-star.org/clients.md#transcription) |
| `WS` | `/v1/realtime` | OpenAI Realtime: a conversation, or `?intent=transcription`. | [Realtime](https://docs.m-star.org/clients.md#realtime) |
| `POST` | `/v1/images/generations` | Text-to-image. | [Images](https://docs.m-star.org/clients.md#images) |
| `POST` | `/v1/images/edits` | Image editing, multipart upload. | [Images](https://docs.m-star.org/clients.md#images) |
| `POST` | `/v1/videos/generations` | Text-, image- and video-to-video. | [Videos](https://docs.m-star.org/clients.md#videos) |

With bearer authentication enabled, `/health`, `/metrics` and openpi’s `/healthz` remain public. The openpi policy socket also accepts an `Api-Key` credential. `MSTAR_ROOT_PATH` adds a reverse-proxy prefix to the routes. [Authentication](https://docs.m-star.org/serving.md#api-key)

| Limit | Result |
| - | - |
| Request body above `MSTAR_MAX_BODY_MB` (default 128 MiB) | HTTP 413. Transcription supports files up to 512 MiB. |
| Rust frontend at `MSTAR_MAX_CONCURRENT_REQUESTS` (default 512) | HTTP 503 on a generation POST. Health, metrics and model discovery bypass the cap. |
| WebSocket message above `ws_max_message_mb` | Close code `1009`. |
| Duplicate active native `request_id` | HTTP 409, or an in-band WebSocket error. |

## OpenAI compatibility

The base model determines the available endpoints. A registered adapter can expose only a subset. For example, Orpheus exposes speech and voices, Whisper exposes transcription, and BAGEL exposes chat and image generation/editing. `nemotron_duplex` exposes realtime conversation as well as native live input. `pi05` uses native generation and, with an `openpi:` config, the policy socket at `/`.

Use the [model matrix](https://docs.m-star.org/models.md#matrix) to find a key’s supported routes, then follow its model guide for accepted modalities and settings. An unsupported route returns 404. Unsupported realtime sessions close with `1008`. A supported route can still return 400 for an input the model cannot use. [Adapter registry](https://github.com/mstar-project/mstar/blob/main/mstar/api_server/openai/adapters.py)

## Health

`GET /health` checks the serving backend. Use it for readiness after worker setup and configured warmups. Before the frontend binds, clients receive a connection error. [Startup sequence](https://docs.m-star.org/cold-start.md#startup-sequence)

| Response | Interpretation |
| - | - |
| 200 `{"status":"healthy"}` | The serving path answered the probe. |
| 503 `{"status":"unhealthy","reason":"backend bridge unreachable"}` | The Rust frontend could not obtain a backend reply. |
| 503 `{"detail":"…"}` | The Python frontend recorded a fatal error. |

On an openpi deployment, `/healthz` returns plain `OK` for a healthy policy. Other deployments return 404 on that route.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.