API Reference
Complete documentation for EdgeMind API endpoints
POST/api/chat
Chat with the AI modelRequest Body
{
messages: [
{ role: "user", content: "What is quantum mechanics?" }
]
}Response
{
id: "chat-123456",
model: "falcon-h1-90m",
content: "Quantum mechanics describes...",
tokens: 15,
inference: "contextual"
}GET/api/status
Get API health and statusTest Endpoint
GET/api/models
List available AI models{
models: [
{ id: "falcon-h1-90m", name: "Falcon-H1-Tiny-90M", type: "chat" },
{ id: "whisper-tiny", name: "Whisper-Tiny", type: "stt" },
{ id: "all-MiniLM-L6-v2", name: "all-MiniLM-L6-v2", type: "embeddings" }
]
}Code Examples
JavaScript / Fetch
// Chat with EdgeMind
const response = await fetch('/api/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
messages: [
{ role: 'user', content: 'Hello!' }
]
})
});
const data = await response.json();
console.log(data.content);