API Discovery & Instructions
LocalAI exposes a set of discovery endpoints that let external agents, coding assistants, and automation tools programmatically learn what the instance can do and how to control it - without reading documentation ahead of time.
Quick start
Authentication and discovery
You can read these discovery surfaces without authentication. This remains true when LocalAI uses database authentication or legacy API keys:
GET /.well-known/localai.jsonGET /api/instructionsGET /api/instructions/{name}- Swagger
GETrequests at/swaggerand under/swagger/
Discovery does not grant access to the endpoints it advertises. Those endpoints require credentials unless the authentication guide lists them as a public discovery or bootstrap route. For example, GET /version requires credentials even though the well-known response includes the instance version.
Well-Known Discovery Endpoint
GET /.well-known/localai.json
Returns the instance version, all available endpoint URLs (flat and categorized), and runtime capabilities.
Example response (abbreviated):
The capabilities object reflects the current runtime configuration - for example, mcp is only true if MCP is enabled, chats and agent_jobs are false with --disable-chats, collections is false with --disable-collections, and backend_install is false when the server runs with --disable-backend-install (backend install and upgrade endpoints then answer 403).
Instructions API
Instructions are curated groups of related API endpoints. Each instruction maps to one or more Swagger tags and provides a focused, LLM-readable guide.
List all instructions
GET /api/instructions
Returns a compact list of instruction areas:
Available instructions:
| Instruction | Description |
|---|---|
motion | Live human pose capture with Protobuf over WebSocket |
agent-jobs | Agent tasks and jobs: saved prompt templates run in the background, with webhooks |
collections | Collections: the knowledge base of documents the chats can search |
chats | Chats the server keeps: steering, sub-agents and live events |
addons | Owner-routed addon lifecycle and response relays |
library-sources | Library sources of add-ons, backends and models |
addon-navigation | The built-in tiles and the per-user pins of the Add-ons drawer |
fine-tuning-quantization | Export status of the fine-tuning and quantization add-ons |
chat-inference | OpenAI-compatible chat completions, text completions, and embeddings |
moderation | OpenAI-compatible text moderation using a local completion model |
audio | Text-to-speech, voice activity detection, transcription, speaker diarization, sound classification, and sound generation |
voice-library | Create, preview, list, and delete reusable voice-cloning reference profiles |
images | Image generation and inpainting |
model-management | Browse the gallery, install, delete, and manage models and backends |
config-management | Discover, read, and modify model configuration fields with VRAM estimation |
monitoring | System metrics, backend status, API and backend traces, backend process logs, and system information |
mcp | Model Context Protocol — tool-augmented chat with MCP servers |
video | Video generation from text prompts with optional image or audio conditioning |
3d | 3D mesh generation, remeshing, and animation (binary glTF / GLB) |
forecast | Time-series forecasting: quantile trajectories for numeric series, with optional covariates |
face-recognition | Face verification (1:1), identification (1:N), embedding, and demographic analysis |
voice-recognition | Speaker verification (1:1), embedding, and demographic analysis from voice |
decisions | Typed local decisions through OpenAI-compatible /v1/decisions and SystemOne APIs |
branding | Whitelabel the instance: configure name, tagline, logo, and favicon |
usage-and-billing | Per-user token usage and request counts, with optional cost tracking |
pii-filtering | Inspect the NER-based PII filter applied to chat requests |
middleware-admin | Inspect and configure the routing-module middleware (PII filter and routing) |
failover | Model failover chains: target health, pinning and switch events |
intelligent-routing | Per-model router: configuration that classifies requests and rewrites the served model |
Get an instruction guide
GET /api/instructions/:name
By default, returns a markdown guide suitable for LLMs and humans:
Add ?format=json to get a raw OpenAPI fragment (filtered Swagger spec with only the relevant paths and definitions):
Model Capabilities
GET /v1/models/capabilities
An additive, LocalAI-specific superset of /v1/models. It returns the same set of models but enriches each entry with the capabilities the model supports and the input/output modalities it accepts and produces. Use it to decide, before sending a request, whether a given model can take an image, audio, or video attachment directly - or whether the input needs converting/transcribing first.
The reported context_size uses a positive model-level value first.
If the model does not set context_size, it uses Settings → Performance → Default Context Size when positive.
Otherwise, it uses the backend fallback of 4096 tokens.
For llama.cpp with separate KV caches, the reported value accounts for the number of parallel slots.
An entry has a description when the model configuration sets one. With authentication on, a user whose account has a model allow-list sees only the models on it.
Because it is purely additive, clients that only understand /v1/models keep working unchanged; they simply never call this route.
capabilities- canonical usecase strings (e.g.chat,vision,transcript,tts,embeddings,image,video) plus the modifierstoolsandthinking.input_modalities/output_modalities- the subsets of{text, image, audio, video}the model accepts and produces. LocalAI combines usecase-based inference, backend settings such as vLLMlimit_mm_per_prompt, and explicit model-levelknown_input_modalities/known_output_modalities. The explicit fields cover distinctions a usecase cannot express, such as a video model that also accepts speech.
The same query parameters as /v1/models are honored (filter, excludeConfigured), and the same per-user model allowlist is applied when authentication is enabled.
Configuration Management APIs
These endpoints let agents discover model configuration fields, read current settings, modify them, and estimate VRAM usage.
Config metadata
GET /api/models/config-metadata
Returns structured metadata for all model configuration fields, organized by section. Each field includes its YAML path, Go type, UI type, label, description, default value, validation constraints, and available options.
Autocomplete values
GET /api/models/config-metadata/autocomplete/:provider
Returns runtime values for dynamic fields. Providers include backends, models, models:chat, models:tts, models:transcript, models:vad.
Read model config
GET /api/models/config-json/:name
Returns the full model configuration as JSON:
Update model config
PATCH /api/models/config-json/:name
Deep-merges a JSON patch into the existing model configuration. Only include the fields you want to change:
The endpoint validates the merged config and writes it to disk as YAML.
Config management endpoints require admin authentication when authentication is configured. The well-known endpoint, instructions API, and Swagger GET routes remain available without authentication.
Model storage report
GET /api/models/storage (admin)
Reports the on-disk footprint of the installed model configurations: per-model sizes with the portion shared with other models split out, every referenced file with the models referencing it, and references whose files are missing from disk.
VRAM estimation
POST /api/models/vram-estimate
Estimates VRAM usage for an installed model based on its weight files, context size, and GPU layer offloading:
Optional parameters: gpu_layers (number of layers to offload, 0 = all), kv_quant_bits (KV cache quantization, 0 = fp16).
Integration guide
A recommended workflow for agent/tool builders:
- Discover: Fetch
/.well-known/localai.jsonto learn available endpoints and capabilities. - Browse instructions: Fetch
/api/instructionsfor an overview of instruction areas. - Deep dive: Fetch
/api/instructions/{name}for a markdown API guide on a specific area. - Authenticate: Obtain credentials before you call an advertised protected endpoint.
- Explore config: Use admin credentials with
/api/models/config-metadatato understand configuration fields. - Interact: Use credentials with inference endpoints and configuration APIs.
Swagger UI
The full interactive API documentation is available without authentication at /swagger/index.html. Requests sent to protected endpoints from Swagger still require credentials.