OpenAI-compatible API
mirmir serve listens on http://127.0.0.1:8080 by default. The 0.2.0 public
HTTP contract contains:
| Method | Path | Purpose |
|---|---|---|
GET | /health | Server and private protocol versions. |
GET | /v1/models | Models ready in the shared runtime. |
POST | /v1/chat/completions | Text or single-image chat, JSON or SSE. |
POST | /v1/embeddings | Single or batched text embeddings. |
POST | /v1/rerank | TEI-style document relevance scoring. |
The dashboard management API under /api/mirmir/v1 is private to the embedded
web application. It is versioned separately and is not an OpenAI client API.
Quick start
mirmir serve
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/v1/models
Bearer authentication is optional on loopback unless an API key has been
configured. When configured, send it on every /v1 request:
curl http://127.0.0.1:8080/v1/models \
-H "Authorization: Bearer $MIRMIR_HTTP_API_KEY"
Errors
Errors use an OpenAI-style envelope:
{
"error": {
"message": "model is not loaded",
"type": "invalid_request_error",
"param": null,
"code": "not_found"
}
}
MiRMiR maps invalid requests to 400, authentication to 401, permission
failures to 403, missing resources to 404, state conflicts to 409,
capacity exhaustion to 429, unavailable runtime state to 503, and
unexpected runtime failures to 500.