Build with Mavorium AI
One API for chat, writing, code and support bots. Sign in with your free Mavorium account and create an API key — keys are free, 25 requests a day are free, and after that you pay only for what you use from prepaid credit. No subscription.
Sign in & get an API key Create a free accountAPI docs
The Mavorium API uses the common chat completions format, so most AI SDKs work by changing the base URL and key.
Base URL
https://www.mavorium.in/mavorium-console/v1Authentication
Authorization: Bearer YOUR_API_KEYModels
mavorium-1 | Mavorium AI — free AI first, paid AI backup when you have credit (best value) |
mavorium-free | Free AI only — cheapest, can be busy at peak times |
mavorium-pro | Best quality — paid AI first (needs credit) |
Examples
curl https://www.mavorium.in/mavorium-console/v1/chat/completions \
-H "Authorization: Bearer $MAVORIUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mavorium-1",
"messages": [
{"role": "system", "content": "You are a friendly support agent."},
{"role": "user", "content": "How do I reset my password?"}
],
"max_tokens": 800
}'
# pip install openai (the Mavorium API speaks the same format)
from openai import OpenAI
client = OpenAI(base_url="https://www.mavorium.in/mavorium-console/v1", api_key="YOUR_API_KEY")
r = client.chat.completions.create(model="mavorium-1",
messages=[{"role": "user", "content": "Write a tagline for a bakery"}])
print(r.choices[0].message.content)
// Run on your server (Node 18+). Never put the key in browser code.
const r = await fetch("https://www.mavorium.in/mavorium-console/v1/chat/completions", {
method: "POST",
headers: { "Authorization": "Bearer " + process.env.MAVORIUM_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ model: "mavorium-1", messages: [{ role: "user", content: "Hello!" }] })
});
const data = await r.json();
console.log(data.choices[0].message.content);
<?php
$ch = curl_init('https://www.mavorium.in/mavorium-console/v1/chat/completions');
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('MAVORIUM_API_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['model' => 'mavorium-1', 'messages' => [['role' => 'user', 'content' => 'Hello!']]])]);
$data = json_decode(curl_exec($ch), true);
echo $data['choices'][0]['message']['content'];Response
Errors
{
"id": "chatcmpl-…", "object": "chat.completion", "model": "mavorium-1",
"choices": [{"index": 0, "message": {"role": "assistant", "content": "…"}, "finish_reason": "stop"}],
"usage": {"prompt_tokens": 21, "completion_tokens": 64, "total_tokens": 85},
"mavorium": {"engine": "free", "free_request": false, "cost_inr": 0.0043, "balance_inr": 998.21}
}
Other endpointsGET https://www.mavorium.in/mavorium-console/v1/models — list models GET https://www.mavorium.in/mavorium-console/v1/usage — your credit balance, free requests left, pricesPricing (pay as you go)
mavorium-free | ₹50 per 1M tokens |
mavorium-1 | free-AI answers ₹50 per 1M · paid-AI answers ₹750 input / ₹3,000 output per 1M |
mavorium-pro | ₹750 input / ₹3,000 output per 1M tokens |
401 | Missing, wrong or deleted API key |
402 | No credit left (or not enough for this request) — add credit in the console |
429 | Too many requests per minute |
503 | AI busy — wait a few seconds and retry |
Streaming: send "stream": true to get the answer as server-sent events (one chunk, then [DONE]). Limits: up to 4000 output tokens per request.