Skip to content
kenari.

Quickstart

Send your first request to kenari with a free model. You need a kenari account and either a terminal or a Python or JavaScript project.

Sign in to the dashboard, open API Keys, and select Create API Key. Add a label if you want, then select Create Key. Copy the key right away, because kenari shows it only once.

Keep the key in an environment variable. The rest of the docs read it from KENARI_API_KEY.

Terminal window
export KENARI_API_KEY=kn-...

This request calls a :free model, so it costs nothing and works with a zero balance.

Terminal window
curl https://kenari.id/v1/chat/completions \
-H "Authorization: Bearer $KENARI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "step-3-7-flash:free",
"messages": [{"role": "user", "content": "Hello!"}]
}'

A successful call returns HTTP 200 and a JSON body. The answer is in choices[0].message.content.

{
"id": "...",
"object": "chat.completion",
"model": "step-3-7-flash:free",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help you today?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 10, "total_tokens": 19 }
}

The free models change over time. List the current ones with the public models endpoint (the command needs jq):

Terminal window
curl https://kenari.id/v1/models | jq -r '.data[] | select(.pricing.free) | .id'

The OpenAI SDKs work with kenari. Point them at https://kenari.id/v1 and keep the rest of your code.

Terminal window
pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://kenari.id/v1",
api_key=os.environ["KENARI_API_KEY"],
)
response = client.chat.completions.create(
model="step-3-7-flash:free",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
Terminal window
npm install openai
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://kenari.id/v1",
apiKey: process.env.KENARI_API_KEY,
});
const response = await client.chat.completions.create({
model: "step-3-7-flash:free",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);

The Anthropic SDKs work too, with the base URL https://kenari.id and no /v1. See Messages.

Free models have per-minute and daily limits. To call paid models, open Balance and top up with QRIS from Rp 1,000. See How billing works.

SymptomCauseFix
401 with a plain-text bodyThe key is missing, mistyped, cut off when copied, or revokedCheck echo $KENARI_API_KEY. If the key is lost, create a new one under API Keys.
400 with model_not_foundThe model id is wrongCopy an id from Models and pricing.
402 with insufficient_balanceA paid model was called with too little balanceSwitch to a :free model, or top up.
405The base URL has the wrong path, such as /v1/v1 or a missing /v1Use https://kenari.id/v1 for OpenAI clients and https://kenari.id for Anthropic clients.
429A rate limit was reached. It can be a free-model limit, your account limit or a provider limitRead the code in the error, and wait for the Retry-After seconds if the response has that header. See Rate limits.