LM StudioLM Studio

LM Studio API

LM Studio's REST API for local inference and model management

Ask Bionic to read this page

Copy this prompt, open Bionic, and paste it into a new chat.

Read https://lmstudio.ai/docs/developer/rest, I want to ask questions about it.

LM Studio offers a powerful REST API with first-class support for local inference and model management. In addition to our native API, we provide OpenAI-compatible endpoints (learn more) and Anthropic-compatible endpoints (learn more).

What's new

Previously, there was a v0 REST API. With LM Studio 0.4.0, we have officially released our native v1 REST API at /api/v1/* endpoints and recommend using it.

The v1 REST API includes enhanced features such as:

Supported endpoints

The following endpoints are available in LM Studio's v1 REST API.

EndpointMethodDocs
/api/v1/chatPOSTChat
/api/v1/modelsGETList Models
/api/v1/models/loadPOSTLoad
/api/v1/models/unloadPOSTUnload
/api/v1/models/downloadPOSTDownload
/api/v1/models/download/statusGETDownload Status

Inference endpoint comparison

The table below compares the features of LM Studio's /api/v1/chat endpoint with OpenAI-compatible and Anthropic-compatible inference endpoints.

Feature/api/v1/chat/v1/responses/v1/chat/completions/v1/messages
Streaming✅✅✅✅
Stateful chat✅✅❌❌
Remote MCPs✅✅❌❌
MCPs you have in LM Studio✅✅❌❌
Custom tools❌✅✅✅
Include assistant messages in the request❌✅✅✅
Model load streaming events✅❌❌❌
Prompt processing streaming events✅❌❌❌
Specify context length in the request✅❌❌❌

Please report bugs by opening an issue on Github.