Elara API Documentation
Selamat datang di dokumentasi resmi Elara API Gateway. Gateway ini menyediakan antarmuka RESTful berkinerja tinggi yang kompatibel dengan format standar OpenAI, serta menyediakan akses langsung ke mesin multi-layer AI (Gemini, Qwen, Open Ecosystem, dan Elara Knowledge Base RAG).
Welcome to the official Elara API Gateway documentation. This gateway provides a high-performance RESTful interface fully compatible with the standard OpenAI specification, giving you direct access to our multi-layer monster engine (Google Gemini, Alibaba Qwen, Open Ecosystem, and the Elara Knowledge Base RAG system).
Seluruh sistem dynamic intelligence routing, proteksi caching, pembatasan kasta berjenjang, dan multi-layer fallback dirancang dan dikelola secara mandiri oleh RifqyDev dari Indonesia untuk menjamin ketersediaan tinggi tanpa jeda.
The comprehensive dynamic intelligence routing, caching layer, tiered quota gating, and multi-layer fallback are architected and maintained independently by RifqyDev from Indonesia to deliver maximum resilience and zero downtime.
key AutentikasiAuthentication
Untuk mengakses endpoint publik pengembang, Anda harus menyertakan API Key yang valid pada header HTTP Authorization dengan skema Bearer. API Key pengembang menggunakan format berawalan elara-sk-.
To access developer endpoints, you must include a valid secret key in the HTTP Authorization header using the Bearer scheme. Official developer keys strictly follow the elara-sk- prefix format.
Authorization: Bearer elara-sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Jangan pernah membagikan atau mempublikasikan kunci API di repositori publik (GitHub). Selalu simpan di variabel lingkungan (Environment Variables) pada sisi server backend Anda.
Never expose or publish your secret API keys in public repositories (e.g., GitHub). Always store them safely within backend server Environment Variables.
terminal Quickstart
Gunakan perintah cURL berikut untuk menguji panggilan pertama Anda ke endpoint completions yang kompatibel dengan SDK standar:
Use the following cURL command to verify your first completion request using OpenAI-standard format:
curl -X POST https://elara.rifqydev.my.id/api/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer elara-sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"model": "automatic",
"messages": [
{
"role": "system",
"content": "Anda adalah asisten AI yang cerdas, sopan, dan solutif."
},
{
"role": "user",
"content": "Jelaskan konsep komputasi kuantum dalam dua kalimat ringkas."
}
],
"temperature": 0.7
}'
api Endpoint OpenAI-CompatibleOpenAI-Compatible Endpoint
POSTEndpoint pengembang utama yang dapat digunakan langsung dengan pustaka resmi OpenAI SDK (Python, Node.js, PHP, LangChain, AutoGen).
The primary developer endpoint natively compatible with official OpenAI SDK libraries (Python, Node.js, PHP, LangChain, AutoGen, and LlamaIndex).
Parameter Permintaan (Request Body)Request Parameters (Request Body)
| Field | TipeType | Status | KeteranganDescription |
|---|---|---|---|
model |
string | WajibRequired | ID model target (contoh: automatic, qwen3.8-max, kimi-k3, elara-search, elara-translate).Target model identifier (e.g., automatic, qwen3.8-max, kimi-k3, elara-search, elara-translate). |
messages |
array | WajibRequired | Daftar objek percakapan berurutan (role: system, user, assistant).Ordered conversation turns array (roles: system, user, assistant). |
temperature |
number | OpsionalOptional | Variasi kreativitas output (rentang 0.0 - 2.0, default: 0.7).Sampling randomness (between 0.0 and 2.0, default: 0.7). |
max_tokens |
integer | OpsionalOptional | Batas maksimum kuantitas token balasan.Maximum token completion limit. |
stream |
boolean | OpsionalOptional | Mode Server-Sent Events (SSE) untuk transmisi kata-demi-kata (default: false).Stream response via Server-Sent Events (SSE) (default: false). |
Contoh Respon BerhasilSuccessful Response Example
{
"id": "chatcmpl-1715426800000",
"object": "chat.completion",
"created": 1715426800,
"model": "Gemini 3.5 Flash Lite",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Komputasi kuantum memanfaatkan fenomena mekanika kuantum seperti superposisi dan keterikatan untuk memproses data. Hal ini memungkinkan pemecahan kalkulasi rumit secara eksponensial lebih cepat dibandingkan komputer klasik."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 42,
"total_tokens": 70
}
}
toll Sistem Action Cost & Tingkatan KastaAction Cost System & Account Tiers
Elara API tidak menerapkan sistem biaya berbasis token-token mikro yang membingungkan. Setiap permintaan dihitung berdasarkan bobot komputasi (Action Cost) dari model yang digunakan:
Elara API eliminates unpredictable micro-token billing. Every request is calculated based on computational load (Action Cost) relative to the chosen model:
| Kasta (Tier)Tier | Biaya LanggananPricing | Batas Beban HarianDaily Allowance | Hak Akses ModelModel Entitlements | Batas Upload BerkasFile Upload Quota |
|---|---|---|---|---|
| Neon | Gratis (Rp 0)Free (Rp 0) | 5 Poin / Beban 100% | Auto Family, Gemini Lite, DeepSeek V4.1 Flash, DeepSeek V4 Flash 0731, Qwen 3.8 Flash, Qwen 3.7 Flash, GLM 5.3, 14 Model OpenRouter Free (Apodex Mini, Mercury Decide, Span 01 Lite, Dots 3 Note, Liquid 2.5, Nemotron Light, Inkling, Fish Audio, Laguna, Cohere Code, Nemo Reasoning, Nemo Ultra), Elara Knowledge, Elara Search, Elara Translate | Maks. 2 Foto, 3 Berkas/hariMax 2 Photos, 3 Files/day |
| Plasma | Rp 9.000 / mingguweek | 50 Poin / Flexible Load | Qwen 3.8 Omni Flash, Kimi K2.7 Code, Gemini 3.8 Flash, Gemini 3.5 Flash, Qwen 3.6 Plus, Gemma 4, NoFilterGPT, Elara Search, Elara Translate | Maks. 15 Berkas/hariMax 15 Files/day |
| Supernova | Rp 29.000 / bulanmonth | 300 Poin / God Mode | Kimi K3 (Reasoning), DeepSeek V4 Pro 0813, Wan 3.0 Video Prime (Vision), Qwen 3.8 Max, Qwen Coder Plus, Qwen VL Plus, Wan 2.7 Image, Elara Search, Elara Translate | Maks. 50 Berkas/hariMax 50 Files/day |
Beban penggunaan server akan pulih secara otomatis sebesar 1% setiap menit saat sistem dalam keadaan istirahat (idle), memberikan kuota tambahan secara dinamis kepada pengguna aktif.
Server memory load cools down automatically by 1% per minute during idle states, regenerating API capacity dynamically for active developers.
view_in_ar Katalog Lengkap Model AIComplete AI Models Catalog
Gunakan ID model berikut pada parameter model saat melakukan permintaan completions:
Use the exact model identifiers below in your model request body parameter:
| KategoriCategory | ID Model (String)Model ID (String) | Penyedia / ArsitekturProvider / Architecture | Kasta MinimumMinimum Tier | Cost |
|---|---|---|---|---|
| Auto Selector | automatic |
Elara Dynamic Classifier | Neon | 1 |
| Auto Selector | fast_mode |
DeepSeek V4.1 Flash (High-Speed) | Neon | 1 |
| Auto Selector | think_mode |
Kimi K3 / DeepSeek V4 Pro Reasoning | Neon | 3 - 8 |
| Auto Family | auto_qwen |
Dynamic Alibaba Qwen Family Tier | Neon | 1 - 8 |
| Auto Family | auto_gemini |
Dynamic Google Gemini Family Tier | Neon | 1 - 8 |
| Auto Family | auto_openrouter |
Dynamic Open Ecosystem Family Tier | Neon | 1 - 8 |
| Alibaba | qwen3.8-max |
Alibaba (Ultra Flagship) | Supernova | 8 |
| Alibaba | kimi-k3 |
Moonshot Kimi K3 (o1-Class Reasoning) | Supernova | 8 |
| Alibaba | deepseek-v4-pro-0813 |
DeepSeek V4 Pro 0813 (Deep Reasoning) | Supernova | 8 |
| Alibaba | wan3.0-video-prime |
Wan 3.0 Video Prime (Vision / Video AI) | Supernova | 8 |
| Alibaba | qwen3.8-omni-flash |
Alibaba (Omni Multimodal Flash) | Plasma | 3 |
| Alibaba | kimi-k2.7-code |
Moonshot Kimi K2.7 Code Specialist | Plasma | 3 |
| Alibaba | deepseek-v4.1-flash |
DeepSeek V4.1 Lightning Flash | Neon | 1 |
| Alibaba | deepseek-v4-flash-0731 |
DeepSeek V4 Flash 0731 Base | Neon | 1 |
| Alibaba | qwen3.8-flash |
Alibaba High-Speed Flash | Neon | 1 |
| Alibaba | qwen3.7-flash |
Alibaba High-Speed Flash | Neon | 1 |
| Alibaba | glm-5.3 |
Zhipu GLM 5.3 Multimodal Intelligence | Neon | 1 |
| Alibaba | qwen3.7-max |
Alibaba (Flagship Reasoning) | Supernova | 8 |
| Alibaba | qwen3.7-plus |
Alibaba (Balanced Plus) | Supernova | 8 |
| Alibaba | qwen3.6-plus |
Alibaba (Standard Plus) | Plasma | 4 |
| Alibaba | qwen3.6-flash |
Alibaba (Lightning Fast) | Neon | 1 |
| Alibaba | qwen3.5-plus |
Alibaba (Pro Intelligence) | Plasma | 4 |
| Alibaba | qwen3.5-flash |
Alibaba (Efficient Base) | Neon | 1 |
| Alibaba | qwen3-coder-plus |
Alibaba (Coder Specialist Plus) | Supernova | 8 |
| Alibaba | qwen3-coder-flash |
Alibaba (Coder Specialist Flash) | Plasma | 4 |
| Alibaba | qwen3-vl-plus-2025-12-19 |
Alibaba (Vision & Video Analyzer) | Supernova | 8 |
| Alibaba | qwen3-vl-flash |
Alibaba (Vision Flash) | Plasma | 4 |
| Alibaba | qwen3.5-omni-plus |
Alibaba (Omni Multimodal Plus) | Supernova | 8 |
| Alibaba | qwen3.5-omni-flash-realtime |
Alibaba (Omni Flash Realtime) | Supernova | 8 |
| Alibaba | qwen3.5-omni-plus-realtime |
Alibaba (Omni Plus Realtime) | Supernova | 8 |
| Alibaba | qwen3-omni-flash-2025-12-01 |
Alibaba (Omni Flash Engine) | Supernova | 8 |
| Google Gemini | gemini-3.8-flash |
Google DeepMind (Flash Next-Gen) | Plasma | 3 |
| Google Gemini | gemini-3.5-flash |
Google DeepMind (Standard Flash) | Plasma | 3 |
| Google Gemini | gemma |
Google DeepMind (Gemma 4 31B IT) | Plasma | 3 |
| Google Gemini | gemini-3.5-flash-lite |
Google DeepMind (Ultra-Light) | Neon | 1 |
| Google Gemini | gemini-3.1-flash-lite |
Google DeepMind (Efficient Lite) | Neon | 1 |
| Google Gemini | gemini-2.5-flash-lite |
Google DeepMind (Compact Lite) | Neon | 1 |
| Google Gemini | gemini-3.1-flash-tts |
Google DeepMind (Text-to-Speech) | Supernova | 8 |
| Google Gemini | gemini-2.5-flash-audio |
Google DeepMind (Native Voice Analyzer) | Supernova | 8 |
| Google Gemini | gemini-robotics-er |
Google DeepMind (Embodied Reasoning 1.6) | Supernova | 8 |
| OpenRouter (Free) | apodex_mini |
Apodex Mini (apodex/apodex-1.1-mini:free) | Neon | 1 |
| OpenRouter (Free) | mercury_decide |
Mercury Decide (inception/mercury-decide:free) | Neon | 1 |
| OpenRouter (Free) | span_lite |
Span 01 Lite (respan/span-01-lite:free) | Neon | 1 |
| OpenRouter (Free) | dots_note |
Dots 3 Note (dots-studio/dots-3-note-preview:free) | Neon | 1 |
| OpenRouter (Free) | liquid |
Liquid 2.5 (liquid/lfm-2.5-2.6b:free) | Neon | 1 |
| OpenRouter (Free) | nemotron_lightning |
Nemotron 3.5 Light (nvidia/nemotron-3.5-lightning:free) | Neon | 1 |
| OpenRouter (Free) | inkling_small |
Inkling Small (thinkingmachines/inkling-small:free) | Neon | 1 |
| OpenRouter (Free) | fish_audio |
Fish Audio S2.1 (fish-audio/s2.1-pro-free:free) | Neon | 1 |
| OpenRouter (Free) | laguna_s |
Laguna S 2.1 (poolside/laguna-s-2.1:free) | Neon | 1 |
| OpenRouter (Free) | inkling |
Inkling (thinkingmachines/inkling:free) | Neon | 1 |
| OpenRouter (Free) | laguna_xs |
Laguna XS 2.1 (poolside/laguna-xs-2.1:free) | Neon | 1 |
| OpenRouter (Free) | cohere_code |
Cohere Code (cohere/north-mini-code:free) | Neon | 1 |
| OpenRouter (Free) | nemotron_reasoning |
Nemo Reasoning (nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free) | Neon | 1 |
| OpenRouter (Free) | nemotron_super |
Nemo Ultra 550B (nvidia/nemotron-3-ultra-550b-a55b:free) | Neon | 1 |
| Image Gen | auto_image |
Smart Auto Image Routing | Neon | 12 |
| Image Gen | flux |
Black Forest Labs (Flux Schnell) | Neon | 12 |
| Image Gen | zimage |
Z-Image Turbo Engine | Neon | 12 |
| Image Gen | klein |
FLUX.2 Klein 4B Realism | Neon | 12 |
| Image Gen | gptimage |
GPT Image 1 Mini (DALL-E 3) | Plasma | 12 |
| Image Gen | gptimage-large |
GPT Image 1.5 Large (DALL-E 3 Large) | Supernova | 12 |
| Image Gen | wan-image |
Wan 2.7 Photorealistic Image | Supernova | 12 |
| Image Gen | qwen-image |
Qwen Image Plus | Plasma | 12 |
| Image Gen | qwen-image-2.0-pro |
Qwen Image 2.0 Pro Masterpiece | Supernova | 12 |
| Knowledge RAG | elara-knowledge |
Elara Private Local JSON RAG | Neon | 1 |
| Pencarian WebWeb Search | elara-search |
Mesin Pencari Web Real-Time TerintegrasiIntegrated Real-Time Web Grounding Engine | Neon | 3 |
| Penerjemah AITranslation | elara-translate |
Mesin Penerjemah Profesional Format-Safe (DeepL-Grade)Format-Safe Professional Translation Engine (DeepL-Grade) | Neon | 3 |
| Uncensored | nofilter |
NoFilterGPT Large Engine | Plasma | 4 |
perm_media Multimodal & Pemrosesan BerkasMultimodal & File Pipelines
Kirimkan foto, dokumen PDF, atau video dalam format Base64 secara langsung pada payload messages atau images:
Send images, PDF documents, or video frames encoded in Base64 directly within your messages or images payload:
{
"model": "automatic",
"message": "Ekstrak teks penting dari gambar ini dan terjemahkan ke Bahasa Indonesia.",
"images": [
{
"name": "document.jpg",
"mimeType": "image/jpeg",
"base64": "/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBD..."
}
]
}
shield Sistem Anti-Crash Fallback Multi-LayerMulti-Layer Anti-Crash Fallback
Untuk memastikan ketersediaan layanan hingga 99.9%, gateway menerapkan rantai pengalihan instan tanpa interupsi:
To ensure 99.9% uptime, the gateway enforces transparent, zero-interruption fallback chains:
- Primer: Mengakses model vendor yang dipilih (contoh: Alibaba Qwen / Open Ecosystem).Primary: Routes directly to the requested vendor (Alibaba Qwen / Open Ecosystem).
- Sekunder: Jika terjadi timeout atau HTTP error 429/500, gateway secara transparan mengalihkan beban komputasi ke Google Gemini Native Engine.Secondary: If timeouts or 429/500 errors occur, traffic instantly routes to Google Gemini Native Engine.
integration_instructions Contoh Kode SDK LengkapComplete SDK Integration Examples
1. Python (Official OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="elara-sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
base_url="https://elara.rifqydev.my.id/api/v1"
)
response = client.chat.completions.create(
model="qwen3.8-max",
messages=[
{"role": "system", "content": "Kamu adalah asisten koding senior."},
{"role": "user", "content": "Buatkan fungsi debounce di JavaScript modern."}
],
temperature=0.5
)
print(response.choices[0].message.content)
2. Node.js (JavaScript Modern / Fetch)
async function askElara(prompt) {
const response = await fetch("https://elara.rifqydev.my.id/api/v1/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer elara-sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
body: JSON.stringify({
model: "automatic",
messages: [
{ role: "user", content: prompt }
],
temperature: 0.7
})
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.error || "Gagal memproses permintaan");
}
console.log(data.choices[0].message.content);
}
askElara("Rancang struktur folder proyek Next.js yang skalabel.");
3. PHP (cURL Native)
<?php
$apiKey = "elara-sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$url = "https://elara.rifqydev.my.id/api/v1/completions";
$data = [
"model" => "nemotron_lightning",
"messages" => [
["role" => "user", "content" => "Berikan saran tips keamanan REST API."]
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . $apiKey
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
echo $result['choices'][0]['message']['content'];
?>
bug_report Kode Error & Panduan PenangananError Codes & Resolution Guide
Jika permintaan mengalami kegagalan, gateway mengembalikan format respon standar dengan kode status HTTP yang relevan:
When API requests fail, the gateway responds with standard HTTP error envelopes containing actionable diagnostics:
| Status HTTPHTTP Status | Deskripsi KesalahanError Description | Langkah Penanganan SolusiResolution Guide |
|---|---|---|
400 Bad Request |
Format payload JSON tidak valid atau parameter wajib (seperti messages) tidak disertakan.Malformed JSON payload or required parameters (such as messages) missing. |
Periksa kembali sintaksis JSON dan pastikan field wajib terisi.Validate JSON formatting and ensure all mandatory attributes are present. |
401 Unauthorized |
Kunci API tidak disertakan pada header atau tidak terdaftar di sistem.API key missing or unrecognized in the Authorization header. | Pastikan header Authorization: Bearer elara-sk-... disertakan dengan benar.Verify that Authorization: Bearer elara-sk-... is accurately provided. |
403 Forbidden |
Model yang diminta melampaui hak akses tingkatan kasta akun Anda (contoh: Neon mengakses model Supernova).Requested model tier exceeds your current membership privileges (e.g., Neon accessing Supernova models). | Gunakan model kasta Neon atau lakukan upgrade langganan ke kasta Plasma/Supernova.Use supported Neon models or upgrade your subscription tier in the dashboard. |
405 Method Not Allowed |
Permintaan dikirim selain menggunakan protokol method POST.Request invoked with an unsupported HTTP verb (only POST is accepted). |
Ubah method HTTP permintaan Anda menjadi POST.Change your HTTP request method to POST. |
429 Too Many Requests |
Poin Action Cost harian Anda telah habis atau server mendeteksi aktivitas pemanggilan berlebihan (rate limit).Daily Action Cost allowance exhausted or request velocity exceeded rate limits. | Tunggu periode reset harian atau beri jeda waktu istirahat agar poin mendingin (cooling recovery).Wait for the daily reset or idle the client to leverage automated cooling recovery. |
500 Internal Error |
Terjadi kendala pada runtime serverless internal penyedia.Internal upstream engine failure across multi-layer providers. | Gateway secara otomatis mencoba fallback. Jika tetap berlanjut, hubungi Administrator (RifqyDev).Fallback will automatically engage. If persistent, reach out to RifqyDev. |
{
"error": {
"message": "Akses Ditolak: Model Dewa (Supernova) ini eksklusif untuk member Supernova! Silakan upgrade paket Anda.",
"type": "permission_denied",
"code": 403
}
}