Skip to content

How to use the OpenAI-compatible API (/v1/*)

Last Updated: 2026-02-04
Content-Type: How-to
Audience: Developers


Endpoints

  • GET /v1/models
  • POST /v1/chat/completions

Authentication

Use either header:

  • Authorization: Bearer <KIRAKIRA_API_KEY> (recommended)
  • X-API-Key: <KIRAKIRA_API_KEY>

Required scopes

  • /v1/models: kirakira:models
  • /v1/chat/completions: kirakira:chat

curl examples

List models

bash
curl "https://api.kirakira.homes/v1/models" \
  -H "Authorization: Bearer $KIRAKIRA_API_KEY"

Chat completion

bash
curl "https://api.kirakira.homes/v1/chat/completions" \
  -H "Authorization: Bearer $KIRAKIRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      { "role": "user", "content": "Hello!" }
    ]
  }'

SDK example (Node.js OpenAI SDK)

js
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.KIRAKIRA_API_KEY,
  baseURL: "https://api.kirakira.homes/v1",
});

const resp = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hi Kirakira" }],
});

console.log(resp.choices[0].message.content);

Quickstart: ChatGPT-like UIs (OpenAI-compatible clients)

Kirakira exposes an OpenAI-compatible base URL at:

  • https://api.kirakira.homes/v1

So in most “ChatGPT-like” UIs, you only need:

  • Base URL: https://api.kirakira.homes/v1
  • API key: your Kirakira key (starts with kira_sk_...)
  • Model: pick one returned by GET /v1/models

OpenWebUI

OpenWebUI supports OpenAI-compatible backends. Configure it to point to Kirakira:

  • OpenAI API Base URL: https://api.kirakira.homes/v1
  • OpenAI API Key: your kira_sk_... key

This repo can run OpenWebUI for you.

  1. In the repo root .env, add:
bash
OPENWEBUI_OPENAI_API_BASE_URL=http://backend:3000/v1
OPENWEBUI_OPENAI_API_KEY=your_kira_sk_key_here
  1. Start the OpenWebUI service:
bash
docker-compose up -d openwebui
  1. Open:
  • http://localhost:5004

By default, the compose service uses the preset environment variables (not UI-persisted settings) because we set ENABLE_PERSISTENT_CONFIG=false.

If your backend is running on your host (not in Docker)

If you run backend in a terminal on your machine and only run OpenWebUI in Docker, set the base URL to the host via Docker Desktop’s special DNS name:

bash
OPENWEBUI_OPENAI_API_BASE_URL=http://host.docker.internal:5002/v1

Note:

  • If you run backend differently and it listens on another port, replace 5002 with your backend port.

Then start OpenWebUI without starting the rest of the stack:

bash
docker-compose up -d --no-deps openwebui

Common pitfalls:

  • If the UI fails to list models, confirm your key has scope kirakira:models.
  • If chat fails, confirm scope kirakira:chat.

Verification:

  • In the OpenWebUI container/host, run:
bash
curl "https://api.kirakira.homes/v1/models" \
  -H "Authorization: Bearer $KIRAKIRA_API_KEY"

LibreChat

LibreChat can connect to OpenAI-compatible endpoints as a custom OpenAI configuration.

At minimum you need:

  • Base URL: https://api.kirakira.homes/v1
  • API key: your kira_sk_... key

Recommended workflow:

  1. Add a custom OpenAI-like endpoint config in LibreChat (UI or config file, depending on your deployment).
  2. Set base URL to https://api.kirakira.homes/v1.
  3. Paste your key.
  4. Select a model that exists in Kirakira’s /v1/models response.

If your LibreChat deployment uses environment variables / YAML:

  • Look for settings equivalent to:
    • OPENAI_API_KEY
    • OPENAI_API_BASE_URL (or OPENAI_BASE_URL)

Notes:

  • LibreChat setups vary by version and deployment style; if the UI asks for “OpenAI Proxy URL” or “Base URL”, use https://api.kirakira.homes/v1.

ASO Universal Consciousness System Documentation