Quickstart

From zero to a working API call in three moves.

1. Create an account

Open the developer signup form and register with your name, email and a password of at least eight characters. Every new account starts with 5,000 credits, and no payment details are required.

2. Generate an API key

You are signed in automatically after signup. In the dashboard, type a label (My first key is fine), press Create key, and copy the private key that appears at the top of the page. It is shown once and never again.

Prefer to automate this? Generate a key programmatically with POST /api/keys/generate.

Store the key in an environment variable so it never lands in source control:

export KAONIC_API_KEY="GK_A31D9C4E7B2F8065..."

3. Make your first call

POST /api/ask is the simplest endpoint — it takes a question and returns an answer. It is public, so you can try it before wiring up a key.

cURL

curl -X POST https://ai.gatavaseug.com/api/ask \
  -H "Content-Type: application/json" \
  -d '{"question":"Explain Kaonic Ai Beta in one paragraph"}'

JavaScript

const res = await fetch("https://ai.gatavase.com/api/ask", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ question: "Explain Kaonic Ai Beta in one paragraph" }),
});

const data = await res.json();
console.log(data.answer, data.engine, data.language);

Python

import os, requests

res = requests.post(
    "https://ai.gatavase.com/api/ask",
    json={"question": "Explain Kaonic Ai Beta in one paragraph"},
    headers={"X-Kaonic-Key": os.environ["KAONIC_API_KEY"]},
    timeout=60,
)

data = res.json()
print(data.get("answer"))

Typical response:

{
  "answer": "Kaonic Ai Beta is an Africa-led intelligence platform ...",
  "engine": "kaonic-openai",
  "intent": "openai_response",
  "language": "en"
}

Calling a key-protected endpoint

Generative endpoints require the private key. Add the X-Kaonic-Key header and the request is authenticated:

curl -X POST https://ai.gatavaseug.com/api/generate/image \
  -H "Content-Type: application/json" \
  -H "X-Kaonic-Key: $KAONIC_API_KEY" \
  -d '{"prompt":"Back-to-school poster for a Kampala school","size":"landscape_4_3"}'

Handling errors

Every failure returns a JSON body with an error code and a human-readable message. Branch on the status code, not the message text:

{
  "error": "invalid_key",
  "message": "Provide a valid Kaonic API key via Authorization: Bearer <key>."
}

The full list lives on Errors & limits. A robust client should retry 429 and 5xx with exponential backoff, and never retry 400, 401 or 403.

Where to go next