Documentation

Getting started

AunuCore exposes one gateway for every model in the catalog, in two shapes: OpenAI-compatible (/v1/chat/completions) and Anthropic-compatible (/v1/messages). If your code already talks to OpenAI or Claude, you only need to change the base URL and the key.

AI API — Base URL
This is the value you set as base_url in the OpenAI SDK (or any compatible client). Both and resolve. The canonical gateway host is https://api.glx.qzz.io.

1. Sign in & get a key

  1. Sign in at /login with Google — it is the only sign-in method. Your account is created automatically on the Free plan.
  2. Open your dashboard: your API key (auc_live_…), base URL and usage analytics are already there — nothing to request or redeem.
  3. Need more headroom? Pick Personal or Business on the pricing page and check out — the same account and key are upgraded in place.
  4. Rotate or revoke the key at any time from the dashboard (rotation invalidates the old key immediately).

Historical note: email/password and Firebase sign-in were retired — those endpoints now return 410 Gone. Every account signs in with Google only.

2. Two APIs — which one do I use?

AunuCore runs two independent API planes, each with its own key type, base URL and quota system. Pick the one that matches what you're building:

🤖 AI API (this page)🧰 REST API Toolkit (catalog)
What it doesChat completions in OpenAI and Anthropic shapes, embeddings, moderations, media generation — the inference surface, with MCP tools built inUtility endpoints in three groups: core features, web scraping, and fun (kata-kata & quotes)
Key prefixauc_live_…auc_rest_…
Base URLhttps://api.fallsad.biz.id
AuthBearer token in Authorization header?key=… query param, x-api-key header, or Bearer
QuotaDaily token allowance + RPM by plan: Free 5M tokens/day → Business 50M tokens/dayCalls/day by plan: Free 5 · Personal 100 · Business 1,000
Key sourceCreated automatically at Google sign-in; shown in your dashboardAuto-provisioned from your client dashboard (POST /account/rest-key) — quota follows your plan
Use it forChatbots, RAG, agents, code generation, summarization, image/video generationUtility microservices: scraping, prayer times, weather, currency, QR codes…

Rule of thumb: if you're calling a model (GPT, Claude, Gemini, Llama…), use the AI API with your auc_live_ key. If you're calling a utility endpoint (scraping, weather, QR, prayer times…), use the REST API Toolkit with your auc_rest_ key. They never mix — a auc_rest_ key cannot call chat completions, and a auc_live_ key cannot call toolkit features.

3. Authenticate

API calls use your API key as a bearer token on every request:

Authorization: Bearer auc_live_a1b2c3d4e5f6g7h8
Content-Type: application/json

The dashboard and other first-party pages instead use a short-lived session token (sess_…) issued by the Google sign-in flow — you never need to handle it yourself; it exists so the web UI can call the same account endpoints without exposing your API key. Programmatic clients should always use the API key.

StatusMeaning
401Key missing or unknown
403Key revoked or expired, or model above your plan
410Retired endpoint (email/password & Firebase sign-in)
429Rate or daily budget exceeded

4. List models

curl /models \
  -H "Authorization: Bearer $AUCORE_KEY"
{
  "object": "list",
  "data": [
    {
      "id": "aucore-router-auto",
      "owned_by": "Anthropic",
      "context_window": 1000000,
      "modalities": ["text", "vision", "tools"],
      "min_plan": "personal",
      "available": true
    }
  ]
}

available reflects your own plan, so you can filter the catalog client-side. The same list is served at /v1/models and /api/models on the gateway.

5. Chat completions

curl /chat/completions \
  -H "Authorization: Bearer $AUCORE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aucore-router-auto",
    "messages": [
      {"role": "system", "content": "You are concise."},
      {"role": "user", "content": "What is retrieval augmented generation?"}
    ],
    "temperature": 0.7,
    "max_tokens": 1024
  }'

Response

{
  "id": "chatcmpl_aucore_8f2a…",
  "object": "chat.completion",
  "model": "aucore-router-auto",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "RAG is…"},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 24, "completion_tokens": 148, "total_tokens": 172}
}

Parameters

FieldTypeNotes
modelstringRequired. Any ID from the catalog.
messagesarrayRequired. Roles: system, user, assistant, tool.
temperaturenumber0–2. Default 1.
max_tokensintegerCapped at 32,000.
top_pnumberNucleus sampling.
streambooleanServer-sent events when true.
toolsarrayFunction calling, incl. MCP tools (see §8). Personal and Business plans.
response_formatobject{"type":"json_object"} or a full json_schema — output is validated and repaired (fences stripped, JSON extracted) before it reaches you.

6. Streaming

Set "stream": true and read server-sent events. Each chunk is a data: line, ending with data: [DONE].

data: {"choices":[{"delta":{"content":"RAG"}}]}
data: {"choices":[{"delta":{"content":" combines"}}]}
data: [DONE]

Reasoning models stream their thinking as delta.reasoning_content, and tool activity is streamed live: when the gateway executes a tool for the model, the stream carries chunks with an aucore_event field (tool_call → tool_result, including the source URLs the tool returned) so your UI can show progress and citations in real time.

data: {"choices":[],"aucore_event":{"type":"tool_call","name":"mcp__general__firecrawl_scrape","status":"running"}}
data: {"choices":[],"aucore_event":{"type":"tool_result","name":"mcp__general__firecrawl_scrape","status":"done","sources":["https://news.ycombinator.com"]}}
// Node.js — stream with the OpenAI SDK
const stream = await client.chat.completions.create({
  model: "aucore-router-auto",
  messages: [{ role: "user", content: "Write a haiku" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

7. Anthropic Messages API

Prefer the Claude shape? The gateway also speaks the Anthropic Messages API at POST /v1/messages — same key, same models, Anthropic request/response format. Point the Anthropic SDK's base_url at https://api.glx.qzz.io and pass your AunuCore key as the auth token.

curl https://api.glx.qzz.io/v1/messages \
  -H "Authorization: Bearer $AUCORE_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aucore-router-auto",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "What is RAG?"}]
  }'
{
  "id": "msg_aucore_…",
  "type": "message",
  "role": "assistant",
  "content": [{"type": "text", "text": "RAG is…"}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 24, "output_tokens": 148}
}

8. MCP tools

AunuCore is MCP-ready out of the box. Platform admins register external Model Context Protocol servers on the gateway; every tool they expose is merged into chat requests and becomes callable by all models, under the name mcp__<category>__<tool> (for example mcp__general__firecrawl_scrape).

  • Server-side execution: when a model calls only MCP tools, the gateway executes them, feeds the results back and streams the final answer — your client needs no tool loop for them.
  • Mixed calls pass through: calls to your own client-side functions are returned to you untouched, exactly like stock OpenAI.
  • Sources included: URLs inside tool results are collected and surfaced in the stream events (§6) and in aucore.sources on non-streaming responses, ready for citation UIs.
  • Tool access follows your plan (tools require Personal or Business).

9. Automatic model selection

Send aucore-router-auto as the model and AunuCore chooses the cheapest model capable of handling the prompt: short prompts go to a fast small model, code-heavy or long prompts escalate automatically.

{
  "model": "aucore-router-auto",
  "messages": [{"role": "user", "content": "Summarise this in one line: …"}]
}

10. Use an existing SDK

# Python
from openai import OpenAI

client = OpenAI(base_url=, api_key=os.environ["AUCORE_KEY"])
r = client.chat.completions.create(
    model="aucore-router-auto",
    messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)

LangChain, LlamaIndex, the AI SDK, LobeChat, Open WebUI and anything else that accepts a custom base URL work the same way — see the integrations page for copy-paste configs. /v1 is accepted as an alias, so …/api/v1 and …/api both resolve.

11. Token optimization

Every request passes through the AunuCore token minimizer before it reaches a model provider. Whitespace is normalized, oversized histories are windowed to fit your plan's context budget, and bloated tool results are capped head-and-tail — typically saving 15–40% of input tokens on long conversations, which makes free-tier quotas last dramatically longer.

  • Automatic by default; nothing to configure.
  • Add "optimize": "aggressive" to the request body for deeper compression (strips filler phrases).
  • Check the savings in every response: headers X-AunuCore-Tokens-In / X-AunuCore-Tokens-Saved, or the aucore.tokens_minimized field.

12. Plans & rate limits

PlanPer minuteTokens / dayRequests / dayContextWeight
Free100 rpm5,000,00050032K0.5×
Personal150 rpm15,000,0006,000200K3×
Business300 rpm50,000,00025,0001M9×

Token allowances reset daily (UTC); wallet top-ups are separate and never reset. Model access is cumulative: Free-tier models are open to every plan, Personal-tier to Personal + Business, and Business-tier to Business only. Every response includes limit headers:

X-AunuCore-Plan: business
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 294
X-RateLimit-Reset: 1786000060
X-RateLimit-Daily-Remaining: 24985

13. Errors

Errors use the OpenAI shape on the AI API:

{
  "error": {
    "type": "rate_limit_exceeded",
    "message": "Daily token budget reached for plan free.",
    "code": 429,
    "retry_after": 41,
    "reset_at": "2026-08-17T00:00:00.000Z"
  }
}

Retry 429 and 502 with exponential backoff plus jitter. Never retry 400 or 403 without changing the request.

14. Account management & support

Beyond chat, the gateway exposes account endpoints for everything the dashboard does — all with the same Bearer key.

Profile & usage

GET   /account               # profile, plan limits, live quota
PATCH /account/profile      # update your name / email
GET   /usage                 # analytics for your key
GET   /account/history?days=30  # daily request series (max 90 days)
GET   /account/requests?limit=50 # recent request log (metadata only)

Keys

POST /account/rotate       # new master key; the old one dies instantly
POST /account/revoke       # permanently disable the current key
POST /account/rest-key     # auto-provision your auc_rest_ toolkit key (quota follows plan)

Mint up to five named secondary keys for separate projects. They authenticate as your account with the same plan limits and can be revoked independently — no need to share the master key.

POST /account/keys          # { "name": "chatbot-prod" } → key shown once
GET  /account/keys          # list every secondary key
DELETE /account/keys/:id    # revoke one key instantly

Webhooks

Register up to three HTTPS endpoints and AunuCore POSTs events to them: usage.daily, quota.warn (≥80% of the daily budget) and key.rotate.

POST /account/webhooks     # { "url": "https://your.app/hook", "events": ["usage.daily"] }
GET  /account/webhooks     # list registered webhooks
DELETE /account/webhooks/:id

Support & subscribe

POST /support   # { name, email, topic, message, consent: true }
POST /subscribe # { email } → product updates by email

Support requests require consent: true (the checkbox on the support form) and a valid email — replies are sent there by our email plane. Subscribers receive feature updates and promos; unsubscribe by contacting support.

15. Good practice

  • Keep keys on your server; have your own backend call AunuCore.
  • Rotate immediately if a key may have leaked — old keys stop working at once.
  • Set max_tokens deliberately; it is the simplest cost control you have.
  • Use aucore-router-auto when quality requirements vary per request.
  • Log the id from responses so support can trace a specific call.

16. Official SDK

The AunuCore SDK is a zero-dependency JavaScript client that works everywhere — Node.js 18+, browsers, Deno, Bun, and edge runtimes. No npm install needed — download it directly:

Download the SDK
Single file, ~8 KB, zero dependencies
Download .mjs

Quick start

// Node.js / Deno / Bun / edge — import the downloaded file
import AunuCore from "./aucore-sdk.mjs";

const ai = new AunuCore({ apiKey: "auc_live_…" });

// Chat completion
const res = await ai.chat.create({
  model: "aucore-router-auto",
  messages: [{ role: "user", content: "Hello!" }]
});
console.log(res.choices[0].message.content);

// Streaming
const stream = await ai.chat.create({ messages: […], stream: true });
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

// REST toolkit (separate key)
const rest = new AunuCore({ restKey: "auc_rest_…" });
const weather = await rest.rest.call("info/weather", { city: "Jakarta" });

Browser usage (no build step)

In a browser, add a type="module" script tag that imports the SDK from this site's CDN at /assets/sdk/aucore-sdk.mjs, then instantiate new AunuCore({ apiKey: "auc_live_…" }) and call ai.chat.create() — the same API as the Node.js example above.

How it works: the SDK is a single ES module that wraps the same REST API you'd call with fetch. It adds automatic retry on 429/5xx, request timeouts, typed errors, and a clean API surface (ai.chat.create(), ai.rest.call()). Since it's zero-dependency, you can copy the file into any project — no package manager needed. If you prefer npm, run npm publish from the sdk/ folder after setting up an npm account.

17. JavaScript SDK

Official zero-dependency SDK — /sdk. Install with curl -O https://ai.aunuhost.bond/sdk/aucore.js, then:

import { AunuCore } from "./aucore.js";
const ai = new AunuCore({ apiKey: "auc_live_…" });
const reply = await ai.chat("Hello");

The SDK wraps /chat/completions (incl. SSE streaming), /models and the auth endpoints, with automatic retries on 429/5xx.

18. REST API Toolkit — quick reference

The toolkit is a separate plane with its own base URL and key. Get your auc_rest_ key from the client dashboard — it is provisioned automatically, with a daily quota that follows your plan (Free 5 · Personal 100 · Business 1,000 calls/day). Full interactive catalog at /restapi.

# check your toolkit quota & usage
curl "https://api.fallsad.biz.id/me?key=auc_rest_…"

# call any toolkit feature with your auc_rest_ key
curl "https://api.fallsad.biz.id/api/islamic/prayer-times?lat=-6.2&lon=106.8&key=auc_rest_…"

curl "https://api.fallsad.biz.id/api/info/weather?city=Jakarta&key=auc_rest_…"

curl "https://api.fallsad.biz.id/api/tools/qr-code?text=hello&key=auc_rest_…"

Every response carries rate-limit headers (X-RateLimit-Limit, -Remaining, -Reset) so you can track your quota client-side. Check GET /me for a full usage report.


Need something not covered here? See the full API reference, the FAQ, or contact support.