AI Gateway
Manage AI routing, monitor usage, and optimize costs
Get Started in Minutes
The regpilot AI Gateway provides a unified API for accessing multiple AI models with automatic routing, cost optimization, and compliance monitoring.
1
Get Your API Key
Click "Manage API Keys" in the Overview page to create your API key. Store it securely in your environment variables.
REGPILOT_API_KEY=your_api_key_here2
Make Your First Request
Choose a quality level (cheap,balanced, orfrontier) and let regpilot handle model selection automatically.
const response = await fetch('https://api.regpilot.com/api/ai/chat', {
method: 'POST',
headers: {
'X-API-Key': process.env.REGPILOT_API_KEY!,
'Content-Type': 'application/json'
},
body: JSON.stringify({
messages: [{ role: 'user', content: 'Hello!' }],
quality: 'balanced' // 'cheap', 'balanced', or 'frontier'
})
})
const reader = response.body?.getReader()
const decoder = new TextDecoder()
let text = ''
while (true) {
const { done, value } = await reader!.read()
if (done) break
text += decoder.decode(value)
}
console.log(text)