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
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, and agents is true only if the agent pool is running.
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 |
|---|---|
chat-inference | Chat completions, text completions, embeddings (OpenAI-compatible) |
audio | Text-to-speech, transcription, voice activity detection, sound generation |
images | Image generation and inpainting |
model-management | Browse gallery, install, delete, manage models and backends |
config-management | Discover, read, and modify model config fields with VRAM estimation |
monitoring | System metrics, backend status, system information |
mcp | Model Context Protocol — tool-augmented chat with MCP servers |
agents | Agent task and job management |
video | Video generation from text prompts |
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):
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.
Details
Config management endpoints require admin authentication when API keys are configured. The discovery and instructions endpoints are unauthenticated.
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/:namefor a markdown API guide on a specific area - Explore config: Use
/api/models/config-metadatato understand configuration fields - Interact: Use the standard OpenAI-compatible endpoints for inference, and the config management endpoints for runtime tuning
Swagger UI
The full interactive API documentation is available at /swagger/index.html. All annotated endpoints can be explored and tested directly from the browser.