Endpoints

4.1 Endpoint table

A conforming service MUST implement every endpoint marked required. It MAY implement the optional ones, and signals them through the capability flags of its service description.

Method Path Requirement Purpose
GET /.well-known/lmsp.json Required Service and capability discovery
GET /lmsp/v1/openapi.json Required Machine-readable interface specification
GET /lmsp/v1/health Required Liveness and readiness check
POST /lmsp/v1/pair Required Exchange a pairing code for a bearer token
GET /lmsp/v1/models Required List local models
GET /lmsp/v1/models/{model_id} Required Get one model
POST /lmsp/v1/responses Required Synchronous or streaming generation
GET /lmsp/v1/responses/{response_id} Optional Retrieve a stored response
POST /lmsp/v1/tasks Required Create an asynchronous generation task
GET /lmsp/v1/tasks/{task_id} Required Get an asynchronous task
POST /lmsp/v1/tasks/{task_id}/cancel Required Cancel an asynchronous task
GET /lmsp/v1/tasks/{task_id}/events Optional Subscribe to or resume the event stream
POST /lmsp/v1/models/{model_id}/load Optional Preload a model
POST /lmsp/v1/models/{model_id}/unload Optional Unload a model

The OpenAI-compatible endpoints under /v1 and the optional Ollama-compatible endpoints are listed in page 8.

4.2 Conventions

  • Bodies. Request and response bodies are JSON (application/json), except event streams (text/event-stream) and errors (application/problem+json).
  • Path parameters. A name in braces, such as {model_id}, is a placeholder. Values MUST be percent-encoded. A model id like qwen3:14b-q4_k_m is sent as qwen3%3A14b-q4_k_m.
  • Authentication. Every endpoint requires Authorization: Bearer <token>, except /.well-known/lmsp.json, /lmsp/v1/openapi.json, /lmsp/v1/health and /lmsp/v1/pair.
  • Optional endpoints. An optional endpoint that the service does not implement MUST answer 501 Not Implemented with the error code unsupported_capability.
  • Versions and errors. Requests may carry version headers, and every error uses one format. Both are defined in page 9.
  • Contract. The OpenAPI document published at /lmsp/1.0/openapi.json is the machine-readable form of this page. The text is normative where the two differ.