LLM Gateway API Reference
LLM Gateway is a resilient, unified AI proxy service that sits between your client applications and upstream AI model providers. It provides automated free model discovery, sub-second Groq inference, large-context Google Gemini reasoning, native multi-model fallback chaining, and retry handling.
Authentication
All endpoints (except health check) are strictly protected to prevent unauthorized public consumption. Include your internal bearer token in the HTTP Authorization header:
Quickstart Integration
# 1. Universal Auto Cascade Chat Completion
curl -X POST https://ai.buildbyzaki.space/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_INTERNAL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Tuliskan contoh TypeScript utility function."}
],
"temperature": 0.7
}'
# 2. Ultra-Fast Groq Inference (300-1000 t/s)
curl -X POST https://ai.buildbyzaki.space/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_INTERNAL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "groq/openai/gpt-oss-120b",
"messages": [{"role": "user", "content": "Jelaskan perbedaan SQL vs NoSQL"}]
}'
# 3. Simple Streaming Gateway Endpoint
curl -N -X POST https://ai.buildbyzaki.space/api/chat \
-H "Authorization: Bearer YOUR_INTERNAL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "Ceritakan lelucon programmer"}],
"model": "google/gemini-3.6-flash",
"stream": true
}'Supported Providers & Universal Cascade
Using model: "auto" activates the Universal Multi-Provider Cascade (Tier 1: Groq Ultra-Fast ➔ Tier 2: Google Gemini 3.6 Flash ➔ Tier 3: OpenRouter Curated Free Pool).
/api/v1/chat/completions
OpenAI standard chat completions endpoint. Fully compatible with OpenAI SDK in Python, Node.js, Go, LangChain, LlamaIndex, and Cursor.
{
"model": "auto", // Optional - "auto", "groq/openai/gpt-oss-120b", "google/gemini-3.6-flash"
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false, // Optional - true for SSE streaming
"temperature": 0.7, // Optional - 0.0 to 2.0
"max_tokens": 1000 // Optional
}/api/chat
Simplified gateway endpoint that returns a direct string or SSE stream for internal microservices and frontend clients.
/api/v1/embeddings
OpenAI-compatible text vector embeddings endpoint for RAG pipelines and semantic search.
/api/models
Returns the dynamic list of curated active free models from OpenRouter, their context window lengths, and active fallback pools.
/api/health
Public health check endpoint reporting active configured providers (OpenRouter, Groq, Google) and system status.