How to use the OpenAI-compatible API (/v1/*)
Last Updated: 2026-02-04
Content-Type: How-to
Audience: Developers
Endpoints
GET /v1/modelsPOST /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
curl "https://api.kirakira.homes/v1/models" \
-H "Authorization: Bearer $KIRAKIRA_API_KEY"Chat completion
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)
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
Local testing with Docker Compose (recommended)
This repo can run OpenWebUI for you.
- In the repo root
.env, add:
OPENWEBUI_OPENAI_API_BASE_URL=http://backend:3000/v1
OPENWEBUI_OPENAI_API_KEY=your_kira_sk_key_here- Start the OpenWebUI service:
docker-compose up -d openwebui- 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:
OPENWEBUI_OPENAI_API_BASE_URL=http://host.docker.internal:5002/v1Note:
- If you run backend differently and it listens on another port, replace
5002with your backend port.
Then start OpenWebUI without starting the rest of the stack:
docker-compose up -d --no-deps openwebuiCommon 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:
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:
- Add a custom OpenAI-like endpoint config in LibreChat (UI or config file, depending on your deployment).
- Set base URL to
https://api.kirakira.homes/v1. - Paste your key.
- Select a model that exists in Kirakira’s
/v1/modelsresponse.
If your LibreChat deployment uses environment variables / YAML:
- Look for settings equivalent to:
OPENAI_API_KEYOPENAI_API_BASE_URL(orOPENAI_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.