Skip to content

Local API Server

Jan provides an OpenAI-compatible API server that runs entirely on your computer. Use the same API patterns you know from OpenAI, but with complete control over your models and data.

  • OpenAI-compatible - Drop-in replacement for OpenAI API
  • Local models - Run GGUF models via llama.cpp
  • Cloud models - Proxy to OpenAI, Anthropic, and others
  • Privacy-first - Local models never send data externally
  • No vendor lock-in - Switch between providers seamlessly

Start the server in Settings > Local API Server and make requests to http://localhost:1337/v1:

Terminal window
curl http://localhost:1337/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "MODEL_ID",
"messages": [{"role": "user", "content": "Hello!"}]
}'
{
"models": [{
"title": "Jan",
"provider": "openai",
"baseURL": "http://localhost:1337/v1",
"apiKey": "YOUR_API_KEY",
"model": "MODEL_ID"
}]
}
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:1337/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="MODEL_ID",
messages=[{"role": "user", "content": "Hello!"}]
)
const response = await fetch('http://localhost:1337/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
model: 'MODEL_ID',
messages: [{ role: 'user', content: 'Hello!' }]
})
});
EndpointDescription
/v1/chat/completionsChat completions (streaming supported)
/v1/modelsList available models
/v1/models/{id}Get model information

Privacy - Your data stays on your machine with local models Cost - No API fees for local model usage Control - Choose your models, parameters, and hardware Flexibility - Mix local and cloud models as needed