API Documentation
Knowledge Engine
Send questions to the AI knowledge engine
POST /api/answer
{
"question": "What is AI?"
}
Knowledge Base
Search through documents
POST /api/search
{
"query": "artificial intelligence"
}
Authentication
Include your API key in the request header
Authorization: Bearer YOUR_API_KEY
JavaScript Example
const response = await fetch('https://api.groq.com/openai/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
model: 'llama-3.1-70b-versatile',
messages: [{ role: 'user', content: 'Hello!' }]
})
});