Skip to content

OpenAI-Compatible API

Kiomon exposes an OpenAI-compatible surface at /v1: any tool that speaks the OpenAI protocol can point at your brain by changing the base URL and API key. No custom SDKs, no glue code.

Endpoint What it does
GET /v1/models List available models: kiomon-rag and kiomon-embed
POST /v1/chat/completions Grounded Q&A over your saved library (stream + non-stream, numbered citations attached)
POST /v1/embeddings Embed text via the vector service (when enabled)
Authorization: Bearer <your-kiomon-api-key>

Keys are managed in Dashboard → Settings → API Keys. Requests are rate-limited per key/plan via the same sliding-window middleware used everywhere else.

from openai import OpenAI
client = OpenAI(
api_key="kiomon-api-key",
base_url="https://api.kiomon.com/v1",
)
resp = client.chat.completions.create(
model="kiomon-rag",
messages=[{"role": "user", "content": "How do I create a checkout session in Dodo Payments?"}],
)
print(resp.choices[0].message.content)

The same pattern works with curl, the openai Node SDK, LangChain, and any OpenAI-compatible agent framework.

Terminal window
curl https://api.kiomon.com/v1/chat/completions \
-H "Authorization: Bearer <key>" \
-H "Content-Type: application/json" \
-d '{
"model": "kiomon-rag",
"messages": [{"role": "user", "content": "Summarize what I saved about Cloudflare Workers"}],
"stream": true
}'
  • Grounded answers — the RAG system prompt is always applied: the model answers only from your saved documents, with numbered inline [1]…[4] citations in the text.
  • Streaming — SSE-style token stream (stream: true).
  • Model allow-list — you request kiomon-rag; clients can’t request an arbitrary model.
  • Stateless — send the full context each turn (OpenAI semantics); nothing is persisted to a conversation store on this path. Use the dashboard chat or /api/rag/ask for persisted multi-turn conversations.
  1. Add an OpenAI node and set:
    • Base URL: https://api.kiomon.com/v1
    • API Key: your Kiomon key
  2. Model: kiomon-rag
  3. Send the user’s question as a message — the node returns the grounded answer with sources.

Exactly the same for LangChain:

from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="kiomon-rag",
api_key="kiomon-api-key",
base_url="https://api.kiomon.com/v1",
)

/v1/embeddings returns semantic embeddings for your text using the same model that powers Kiomon’s semantic search.

Use it to:

  • Embed your own content before storing it elsewhere
  • Compare documents semantically
  • Build retrieval pipelines that share Kiomon’s embedding space
  • Multimodal parts are dropped — this is a text-only brain
  • System-message coercion is prevented — a client-supplied system message becomes “instruction flavor”; it can never override answer only from saved documents
  • Context is scoped — answers cite and quote your library, never hallucinated web content

Free/Pro daily caps per key: chat and embedding quotas are separate. See Plans & Quotas for numbers.